diff options
Diffstat (limited to 'README.md')
-rw-r--r-- | README.md | 12 |
1 files changed, 7 insertions, 5 deletions
@@ -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 |