Skip to content

Instantly share code, notes, and snippets.

Anders K. Madsen lillesvin

View GitHub Profile
@rkumar
rkumar / gist:445735
Created Jun 20, 2010
ruby's OptionParser to get subcommands
View gist:445735
#!/usr/bin/env ruby -w
## Using ruby's standard OptionParser to get subcommand's in command line arguments
## Note you cannot do: opt.rb help command
## other options are commander, main, GLI, trollop...
# run it as
# ruby opt.rb --help
# ruby opt.rb foo --help
# ruby opt.rb foo -q
# etc
You can’t perform that action at this time.