diff options
Diffstat (limited to 'lib')
-rw-r--r-- | lib/slop.rb | 2 | ||||
-rw-r--r-- | lib/slop/types.rb | 7 |
2 files changed, 8 insertions, 1 deletions
diff --git a/lib/slop.rb b/lib/slop.rb index 3d7a95c..7c466a3 100644 --- a/lib/slop.rb +++ b/lib/slop.rb @@ -6,7 +6,7 @@ require 'slop/types' require 'slop/error' module Slop - VERSION = '4.8.2' + VERSION = '4.9.0' # Parse an array of options (defaults to ARGV). Accepts an # optional hash of configuration options and block. diff --git a/lib/slop/types.rb b/lib/slop/types.rb index c53319c..4ccd42e 100644 --- a/lib/slop/types.rb +++ b/lib/slop/types.rb @@ -6,6 +6,13 @@ module Slop end end + # Cast the option argument to a symbol. + class SymbolOption < Option + def call(value) + value.to_sym + end + end + # Cast the option argument to true or false. # Override default_value to default to false instead of nil. # This option type does not expect an argument. However, the API |