summaryrefslogtreecommitdiff
path: root/lib
diff options
context:
space:
mode:
authorThomas Bénéteau <thomas@bitwise.me>2017-08-05 22:04:05 +1200
committerThomas Bénéteau <thomas@bitwise.me>2017-08-05 22:08:38 +1200
commite52f389dc2ee7f5988b6abfb20651f9edd6b7a26 (patch)
tree142c0571102f1c1314910958c69f785b7c504ed0 /lib
parentbdd21e885e577ed42459c9afe185ede8e9d25fde (diff)
downloadslop-e52f389dc2ee7f5988b6abfb20651f9edd6b7a26.tar.gz
Fix bug preventing '--' being passed as the first argument.
Diffstat (limited to 'lib')
-rw-r--r--lib/slop/parser.rb1
1 files changed, 1 insertions, 0 deletions
diff --git a/lib/slop/parser.rb b/lib/slop/parser.rb
index 7d8ad46..3cba82b 100644
--- a/lib/slop/parser.rb
+++ b/lib/slop/parser.rb
@@ -148,6 +148,7 @@ module Slop
def partition(strings)
if strings.include?("--")
partition_idx = strings.index("--")
+ return [[], strings[1..-1]] if partition_idx.zero?
[strings[0..partition_idx-1], strings[partition_idx+1..-1]]
else
[strings, []]