diff options
Diffstat (limited to 'lib/puppet/string/option.rb')
-rw-r--r-- | lib/puppet/string/option.rb | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/lib/puppet/string/option.rb b/lib/puppet/string/option.rb index f499e4b95..be7bbb76e 100644 --- a/lib/puppet/string/option.rb +++ b/lib/puppet/string/option.rb @@ -70,10 +70,10 @@ class Puppet::String::Option end def optparse_to_name(declaration) - unless found = declaration.match(/^-+([^= ]+)/) or found.length != 1 then + unless found = declaration.match(/^-+(?:\[no-\])?([^ =]+)/) then raise ArgumentError, "Can't find a name in the declaration #{declaration.inspect}" end - name = found.captures.first.sub('[no-]', '').tr('-', '_') + name = found.captures.first.tr('-', '_') raise "#{name.inspect} is an invalid option name" unless name.to_s =~ /^[a-z]\w*$/ name.to_sym end |