as: Regexp
#132-abc foo
should assign foo
to the option c
if it expects an argument (#114).-h
or --help
is passed. #106--help
option exits by default (#107, Autumn Perrault).parse!
removes commands and their options.Slop.optspec
.:as => :count
when using multiple switches.to_hash
output. (#59)Slop#strict?
method.option=argument
syntax does not consume following arguments (#55).--option=value
is being evaluated before multiple switches (#52):argument => :optional
works with :option=
format.Slop::Commands
and removed existing command system:optional
has been renamed to :optional_argument
:required
for mandatory options:argument
now accepts an :optional
symbol as well as boolean value:as
option to accept an object responding to :call for
custom type conversions (#45)define_method
for checking an options presence (and caching it) #37=
for accepting argumentsrespond_to?
nil
for any options using casting which don't expect arguments (#33)#[]
method on it=
char for options which accept an argumentSupport bup.options
style optspec parsing
Allow :as
to accept a count
value (Conrad Irwin):
on :v, :verbose, :as => :count # -vv; opts[:verbose] #=> 2
Slop#missing
for returning a list of missing options parsedSlop#present?
to accept multiple arguments:all_accept_arguments
to Slop configuration options, this saves
having to specify that every option takes an argumentSlop#to_struct
for building new classes from optionsSlop::Options#to_hash
continue using Slop#to_hash
directly.
This method also now returns symbols by default instead of strings. If
you want strings use opts.to_hash(false)
:multiple_switches
is now enabled by default, to parse fbar
as the
option f
with value bar
you must disable :multiple_switches
Slop::Options#to_help
and merged its contents into Slop#help
lib/slop/options.rb
and merged Slop::Options
into slop.rblib/slop/option.rb
and merged Slop::Option
into slop.rbSlop::Option
now inherits from Struct.new
:required
option to Slop::Option.
This exception is raised when a mandatory option is not used:multiple_switches
--
is parsed as an argument and not option even
if prefixed with /--?/
Slop#option?
for
checking an options presence (Rob Gleeson)execute
passes command arguments to the blockexecute
method to Slop for commands. This block will be invoked
when a specific command is used. The Slop object will be yielded to the
blockon
to be used as an :as
option. ie:
on :people, 'Some people', Array
on '--name NAME'
and
on 'password [OPTIONAL]'
:arguments
setting to enable argument passing for all options:ignore_case
to Slop options for case insensitive option matching:on_noopts
for triggering an event when the arguments contain no
options:unless
to Slop::Option for omitting execution of the Options block
when this object exists in the Array of items passed to Slop.new-
parse!
should not remove items with the same value as items used
in option arguments. Fixes #22 (Utkarsh Kukreti)ARGV
is empty when using the on_empty
eventSlop#get
as alias to Slop#[]
Slop#present?
as alias for Slop#<option>?
Option#count
for monitoring how many times an option is called:io
for using a custom IO object when using the :help
option