alias def_option
s.
check incompatible argument styles.
1.4.x compatibility.
added OptionParser#notwice.
check incompatible argument styles.
1.4.x support.
use braces for ARGV.options
block.
added OptionParser#notwice.
0.7.9 release, trivial features.
added OptionParser::LastModified.
error handle in fake main code.
avoid parse error on 1.7.2 2001-01-22 too.
strip directory portion for default program name.
avoid parse error on 1.7.2 2001-01-22.
OptionParser::ParseError instances have each reason to override default reason.
surounded release code with parentheses.
OptionParser#version, OptionParser#release attributes.
OptionParser#ver which returns version string.
0.7.8 release
added OptionParser.inc and OptionParser#inc.
acceptable patterns.
OptionParser#complete has raised OptionParser::AmbiguousOption wrongly, not but OptionParser::InvalidOption(0.7.6.2 bug).
patch from Hugh Sasse Staff Elec Eng <hgs@dmu.ac.uk>
allows space for separator between switch and argument.
prefer return from block not but catch/throw.
fixed keyword completion and array
0.7.6 release.
OptionParser::load doesn't raise even if HOME
environment
variable is not set,
and returns true
/false
.
distinguish between no argument and empty list for Array
.
uses block_given?
instead of iterator?
.
avoid warnings with -w.
OptionParser::Version
is now Comparable
.
OptionParser::Release
added.
0.7.5 release.
Class#module_function
is no longer available.
allows Module
for option class not only Class
.
added OptionParser::load and OptionParser::environment experimentally.
added OptionParser#program_name.
added OptionParser::ParseError#recover document,
and pushes @args
back at once.
removed check_twice
from OptionParser#switch.
uses OptionParser::visit in OptionParser::summarize.
Renamed safe_call
to OptionParser.yieldproc.
Fixed arity problem(I hope!!).
refined documents for OptionParser::Arguable#options.
argument to char range option was wrong.
used ((:name:)) format for class/module description in headlines.
not convert nil
to numerics.
added example section.
added documents.
Fixed Proc#call arity problem.
Passes an array to proc
directly, without * expansion.
Modified rest array argument passing.
OptionParser::Filling module which extends method fill
like as Array
.
Added OptionParser::OptionMap.
Keyword completion uses only Hash
now.
OptionParser::CompletingHash came class instead of module.
Missed argument string in option summary.
Changed parameters format.
Moved OptionParser::Switch.guess to class methods section.
Added OptionParser::check_twice.
Guards [nil]
while passing to proc.
Added argument check for Array
argument class.
Merged methods match
and complete
of
OptionParser::List.
Methods complete
of OptionParser and
OptionParser::List take arguments that specifys which table
used, and optional arguments for completion.
Character class options regexp was wrong.
Added character class short option.
When no matched options found, OptionParser::AmbiguousOption raised instead of OptionParser::InvalidOption.
Indented *
list under :
list.
Added a few documents.
Categorized initialize
methods to class methods in documents.
Generally uses convert
method of pattern
for conversion.
Added OptionParser::FillingHash.
Error recovery while invoking handlers.
Added OptionParser#safe_call.
to_f
and oct
are unsafe without argument
check. Float
and OctalInteger
may deal raw argument
while conversion, and return 0(or 0.0) on nil
.
Made possible to completion to Symbol
.
Using method convert
of module OptionParser::Completion
to convert arguments.
nil
to OptionParser::OptionalArgument switch without
argument.
Added documents.
Removed change log.
Modularized completion.
Keyword argument class and OptionParser::AmbiguousArgument exception.
Fixed numeric regular expressions.
Fixed default pattern.
Defaulted short style argument classes to Object
or
TrueClass
according to argument specification.
renamed instance variable of @options to @optparse*1.
initializes instance variable.
args in message are joined with space instead of =
.
args in inspection are joined with space.
Long style options without argument may be boolean flag.
long style option description designates default argument class.
couldn't recover error in the case of long style completion for one-character option.
Object
argument class passes argument string itself.
Avoiding return from proc-closure
bug.
Visitor pattern for OptionParser::List.
Forgotten default pattern and converter for short style option.
Parse error recovery.
Undocumented feature B-)
Fixed document indentation. Thanks to Tosh.
Defaulted banner message.
Added document Switch classes.
argument style without preceding =
should be
REQUIRED_ARGUMENT
,
OptionParser::Switch#parse_arg expands matched data to array.
Bug fix when no arguments given to switch using converter.
Modifying argv in option handers is safe even while parsing crunched short options.
Fixed exception when short option cannot be completed.
When called as iterator, OptionParser::Arguable#options rescues
OptionParser::ParseError and returns nil
with printing the
error message to STDERR
.
If no short options match, try completion with long options.
When no arguments is passed, OptionParser::Switch::OptionalArgument
misparsed and resulted true
, where it must be nil
.
Forgotten changing guess_style to style.
Added OptionParser::ParseError#inspect returns inspection string in format same as older versions.
removed OptionParser::guess_style to OptionParser::Switch.guess.
Short style options ignored after -
or +
, but now ignore
themselves.
And boolean switches can take argument -
and +
as false
and true
respectively.
OptionParser::ParseError changed to:
have sub classes instead of style flag,
have an attribute arg represents the argument string caused the exception,
and default stringizing methods message
and to_s
return
error message same as to_str
.
multiple argument style values.
OptionParser#new takes block or return self
.
OptionParser::ArgumentStyles are now symbol.
Option string with argument style is prior to ones without style. Followings are equivalent now.
on("-f", "--flag=VALUE") on("-f=VALUE", "--flag")
OptionParser::Arguable.options can be undefed by setting
nil
or false
with OptionParser::Arguable.options=.
comments feedback from japanese document.
OptionParser::List.update is private.
OptionParser::Arguable.options takes block.
Directly specified matchable object is prior to accepted classes in OptionParser::switch.
In OptionParser::Switch#parse_arg, relaxed matched result.
Now uses method index, and added some documents.
Made OptionParser::Switch#parse_arg safer.
Now OptionParser::Switch#summarize and OptionParser::List#summarize have same signature.
Now OptionParser::Switch#pattern is anything can match to
String
, not only Regexp
.
New release.
Added OptionParser.with that behaves like as older new
.
No use of dying.rb
.
Added OptionParser::Acceptables.
OptionParser.switch accepts also Method
as handler, not
only Proc
.
Fixed doc of OptionParser#new as 0.6.
OptionParser#new no longer evaluates block in its context, just yields itself.
Made OptionParser#switch(was register
public, and added
OptionParser::List#append and OptionParser::List#prepend.
OptionParser#on accepts separated option argument description,
like as "=ARGUMENT"
.
Removed exit
methods to dying.rb
.
Added OptionParser::Arguable.
Accepts comma separated list arguments.Array
Not use return value from String#sub!
.
Used empty string for optional argument when absent.(Revision 0.4.5.1)
OptionParser#on can take just messages.
Bug fix of boolean switch.
OptionParser::List#atype now holds pattern and converter pairs. pattern and conv no longer exist.
Passes matched substrings instead of $~, to converters.
Added OptionParser#banner, and now OptionParser#new takes summary formatting parameters.
When an empty string given as optional argument to short style, OptionParser::ParseError explicits empty argument not but missing argument.
Added FalseClass, opposite of TrueClass.
Passes matched substrings instead of $~, to converters.
Added OptionParser#banner, and now OptionParser#new takes summary formatting parameters.
When an empty string given as optional argument to short style, OptionParser::ParseError explicits empty argument not but missing argument.
Added FalseClass, opposite of TrueClass.
Modified for 1.5.2
Failed long style completion for deferred switches.
Changed default options list to singleton of OptionParser::List instead class itself. There was no reasons that it's must be.
Added OptionParser#summary_width and OptionParser#summary_indent.
Removed OptionParser::List::on back to OptionParser again, and
searches pattern
and converter
in the stack.
OptionParser::Switch#parse no longer uses yielded return value.
Short style options support =argument
.
OptionParser#on ignored argument class.
All OptionParser::ParseError holds erred option, and able to
retry
.
Added optparse/time.rb
into MANIFEST.
Now OptionParser has stack structure. New option list is created with OptionParser#new, and removed with OptionParser#remove.
OptionParser#summarize accepts formatting parameters.
When OptionParser::InvalidOption raises, $!.message
holds
whole erred option, including argument if present. So it's possible
to retry
with unshifting it.
Simplified OptionParser#order, OptionParser#permute and OptionParser#parse. Now they're just front-ends for !-ed versions.
Added MANIFEST.
Made Example a link rather than included.
Rewrote TrueClass description in Acceptable argument classes.
OptionParser#on_head added
Multiple long-style option in one summary line.
Relaxed check for ambiguous, but actually one option.
Bug-fixes
OptionParser::Switch#format: wrong local variable
Rewrote RD.
Added some methods:
destructive parse methods OptionParser#order!, OptionParser#permute! and OptionParser#parse!.
Miscellaneous utility, OptionParser.exit. Of course, it doesn't concern with option parsing directly, however, often used while command-line processing.
Added OptionParser.accept, OptionParser.reject, OptionParser#accept, OptionParser#reject
Prefixed instance variables of OptionParser with '_' to prevent interferences from attributes defined with OptionParser#variable.
Now OptionParser#variable returns attributes list.
Adding boolean flag switch.
Added default stringize method OptionParser::ParseError#to_str.
Missing argument for short option caused no failure and ignored silently.
OptionParser#permute ignored arguments after --.
Refined example code.
Adding boolean flag switch.
Initial revision.
*1might not conflict