You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
This is something I struggled with but I was able to get around it by using pry.
Sample code:
require "docopt"
require "pry"
doc = <<DOCOPT
Usage: #{__FILE__} <country> <state> <city> <street_name>
Options:
-h --help show this help message and exit
DOCOPT
begin
require "pp"
pp = Docopt::docopt(doc)
binding.pry
rescue Docopt::Exit => e
puts e.message
end
The output will be something like this:
19: DOCOPT
20:
21: begin
22: require "pp"
23: pp = Docopt::docopt(doc)
=> 24: binding.pry
25: rescue Docopt::Exit => e
26: puts e.message
27: end
28:
29: # SETUP for calls.
This is my simple code:
#encoding: UTF-8
#!/usr/bin/env ruby
require "net/http"
require "docopt"
require "uri"
doc=<<DOCOPT
Usage:
screengrab (application_id) [-c=(us|pl|de|gb|au)]
screengrab -h|--help
screengrab --version
Options:
-h|--help Show this help
--version Show version
-c=(us|pl|de|gb|au) Lookup in specific Store.
DOCOPT
begin
require "pp"
options = Docopt::docopt(doc,version:"1.0")
pp options
rescue Docopt::Exit => e
puts e.message
exit 1
end
no matter what I do, command
pp options
do not produce any dictionary on screenThe text was updated successfully, but these errors were encountered: