diff options
author | Lee Jarvis <ljjarvis@gmail.com> | 2015-06-20 17:38:19 +0100 |
---|---|---|
committer | Lee Jarvis <ljjarvis@gmail.com> | 2015-06-20 17:43:33 +0100 |
commit | b197bf93641525f84ef11417002d283f3f1702f7 (patch) | |
tree | 73cc4d4728d1ee083a1de02ceaa2e9a86d5f6d2c /lib | |
parent | 6b511f36f92ace360d9d365d2a23906849a128f5 (diff) | |
download | slop-b197bf93641525f84ef11417002d283f3f1702f7.tar.gz |
Simplify checking for grouped short flags
Diffstat (limited to 'lib')
-rw-r--r-- | lib/slop/parser.rb | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/lib/slop/parser.rb b/lib/slop/parser.rb index 1bfa134..1e810d8 100644 --- a/lib/slop/parser.rb +++ b/lib/slop/parser.rb @@ -94,7 +94,7 @@ module Slop process(option, arg) elsif flag.start_with?("--no-") && option = matching_option(flag.sub("no-", "")) process(option, false) - elsif flag =~ /\A-[^-]/ && flag.size > 2 + elsif flag =~ /\A-[^-]{2,}/ # try and process as a set of grouped short flags. drop(1) removes # the prefixed -, then we add them back to each flag separately. flags = flag.split("").drop(1).map { |f| "-#{f}" } |