Skip to content
This repository has been archived by the owner on Jan 9, 2019. It is now read-only.

matthewtodd/optparse-defaults

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

5 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

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

Resources

Stars

Watchers

Forks

Packages

No packages published

Languages