Repository is archived
No commit activity in last 3 years
No release in over 3 years
Default options for the stdlib's OptionParser
2005
2006
2007
2008
2009
2010
2011
2012
2013
2014
2015
2016
2017
2018
2019
2020
2021
2022
2023
2024
 Dependencies

Development

>= 0
>= 0
 Project Readme

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)