Created
April 29, 2012 23:03
-
-
Save RyanScottLewis/2553765 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| ryguy@RyBook ~/Code/Ruby/Scratchpad/slop-test $ gem list slop | |
| *** LOCAL GEMS *** | |
| slop (3.1.1) | |
| ryguy@RyBook ~/Code/Ruby/Scratchpad/slop-test $ cat test.rb | |
| require 'slop' | |
| opts = Slop.new do | |
| on :v, :verbose, "Enable verbose mode" | |
| end | |
| opts.parse | |
| p opts.to_hash | |
| print "Verbose? " | |
| puts opts.verbose?, "" | |
| ryguy@RyBook ~/Code/Ruby/Scratchpad/slop-test $ ruby test.rb | |
| {:verbose=>nil} | |
| Verbose? false | |
| ryguy@RyBook ~/Code/Ruby/Scratchpad/slop-test $ ruby test.rb -v | |
| {:verbose=>nil} | |
| Verbose? true |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment