Default options for Ruby's stdlib's OptionParser
Ruby
Fetching latest commit…
Cannot retrieve the latest commit at this time.
Permalink
Failed to load latest commit information.
lib/optparse
man
.gitignore
Gemfile
Gemfile.lock
README.rdoc
Rakefile
optparse-defaults.gemspec

README.rdoc

OptionParser::Defaults

Adds support for default options to the stdlib's OptionParser.

Default options are parsed before any given command-line options, and they're also added to the bottom of the help message.

Usage

parser = OptionParser.with_defaults do |opts|
           opts.defaults = %w(--foo --no-bar --baz=42)
           # ... and so on ...
         end

parser.order(ARGV)