lib/twurl/cli.rb in twurl-0.7.0 vs lib/twurl/cli.rb in twurl-0.8.0
- old
+ new
@@ -70,10 +70,11 @@
quiet
disable_ssl
request_method
help
version
+ proxy
end
end
arguments = option_parser.parse!(args)
Twurl.options.command = extract_command!(arguments)
@@ -245,10 +246,16 @@
on_tail("-v", "--version", "Show version") do
CLI.puts Version
exit
end
end
+
+ def proxy
+ on('-P', '--proxy [proxy]', 'Specify HTTP proxy to forward requests to (default: No proxy)') do |proxy|
+ options.proxy = proxy
+ end
+ end
end
end
class Options < OpenStruct
DEFAULT_REQUEST_METHOD = 'get'
@@ -282,8 +289,12 @@
super || DEFAULT_PROTOCOL
end
def host
super || DEFAULT_HOST
+ end
+
+ def proxy
+ super || nil
end
end
end