Object
came true, previous behavior is for NilClass
now.0.8.6
def_option
s.ARGV.options
block.0.7.8 release
0.7.6 release.
HOME
environment
variable is not set,true
/false
.Array
.block_given?
instead of iterator?
.OptionParser::Version
is now Comparable
.OptionParser::Release
added.0.7.5 release.
Class#module_function
is no longer available.Module
for option class not only Class
.@args
back at once.check_twice
from OptionParser#switch.Renamed safe_call
to OptionParser.yieldproc.
Fixed arity problem(I hope!!).
nil
to numerics.Fixed Proc#call arity problem.
Passes an array to proc
directly, without * expansion.
Modified rest array argument passing.
fill
like as Array
.Hash
now.
OptionParser::CompletingHash came class instead of module.[nil]
while passing to proc.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.
convert
method of pattern
for conversion.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
.Symbol
.convert
of module OptionParser::Completion
to convert arguments.nil
to OptionParser::OptionalArgument switch without
argument.Removed change log.
Fixed default pattern.
Defaulted short style argument classes to Object
or
TrueClass
according to argument specification.
=
.Long style options without argument may be boolean flag.
Object
argument class passes argument string itself.Avoiding return from proc-closure
bug.
Visitor pattern for OptionParser::List.
Fixed document indentation. Thanks to Tosh.
Defaulted banner message.
Added document Switch classes.
=
should be
REQUIRED_ARGUMENT
,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:
message
and to_s
return
error message same as to_str
.multiple argument style values.
OptionParser#new takes block or return self
.
Option string with argument style is prior to ones without style. Followings are equivalent now.
on("-f", "--flag=VALUE") on("-f=VALUE", "--flag")
nil
or false
with OptionParser::Arguable.options=.comments feedback from japanese document.
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.
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
Rewrote RD.
Added some methods:
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