summaryrefslogtreecommitdiff
path: root/README.md
diff options
context:
space:
mode:
authorTim Rogers <tim@gocardless.com>2015-06-13 18:40:32 +0100
committerTim Rogers <tim@gocardless.com>2015-06-13 18:40:32 +0100
commitfd0e2d8bc3d1c647e6b051f48b8bedbe77934c0c (patch)
tree38105cadafc1b4f0609121b1d2f043af46ed4425 /README.md
parent1a075c05d38be0df849119530378043994c05c91 (diff)
downloadslop-fd0e2d8bc3d1c647e6b051f48b8bedbe77934c0c.tar.gz
Better handling of option names with multiple words
Diffstat (limited to 'README.md')
-rw-r--r--README.md12
1 files changed, 7 insertions, 5 deletions
diff --git a/README.md b/README.md
index 7a46538..77045a4 100644
--- a/README.md
+++ b/README.md
@@ -22,19 +22,21 @@ opts = Slop.parse do |o|
o.integer '--port', 'custom port', default: 80
o.bool '-v', '--verbose', 'enable verbose mode'
o.bool '-q', '--quiet', 'suppress output (quiet mode)'
+ o.bool '-c', '--check-ssl-certificate', 'check SSL certificate for host'
o.on '--version', 'print the version' do
puts Slop::VERSION
exit
end
end
-ARGV #=> -v --host 192.168.0.1
+ARGV #=> -v --host 192.168.0.1 --check-ssl-certificate
-opts[:host] #=> 192.168.0.1
-opts.verbose? #=> true
-opts.quiet? #=> false
+opts[:host] #=> 192.168.0.1
+opts.verbose? #=> true
+opts.quiet? #=> false
+opts.check_ssl_certificate? #=> true
-opts.to_hash #=> { host: "192.168.0.1", port: 80, verbose: true, quiet: false }
+opts.to_hash #=> { host: "192.168.0.1", port: 80, verbose: true, quiet: false, check_ssl_certificate: true }
```
Option types