diff options
author | Victor Gama <hey@vito.io> | 2023-02-10 16:25:08 -0300 |
---|---|---|
committer | Victor Gama <hey@vito.io> | 2023-02-15 11:43:06 -0300 |
commit | a23fa41a5674485600365985bea2a905e5e087df (patch) | |
tree | c781122a70e710929731ca811cd3f2d7ea4c0023 /lib/slop/options.rb | |
parent | fc4622fc08d7982847ff583ad691ee4ba47f63f8 (diff) | |
download | slop-a23fa41a5674485600365985bea2a905e5e087df.tar.gz |
Add optional type validation
Diffstat (limited to 'lib/slop/options.rb')
-rwxr-xr-x | lib/slop/options.rb | 4 |
1 files changed, 4 insertions, 0 deletions
diff --git a/lib/slop/options.rb b/lib/slop/options.rb index 17e9501..5e71eac 100755 --- a/lib/slop/options.rb +++ b/lib/slop/options.rb @@ -7,6 +7,7 @@ module Slop type: "null", banner: true, underscore_flags: true, + validate_types: false, } # The Array of Option instances we've created. @@ -24,6 +25,9 @@ module Slop # The String banner prefixed to the help string. attr_accessor :banner + # Whether we should validate types of values provided by the user + attr_accessor :validate_types + def initialize(**config, &block) @options = [] @separators = [] |