matthewtodd / optparse-defaults

Default options for Ruby's stdlib's OptionParser

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

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)

About

Default options for Ruby's stdlib's OptionParser


Languages

Language:Ruby 100.0%