summaryrefslogtreecommitdiff
path: root/lib/slop/options.rb
diff options
context:
space:
mode:
Diffstat (limited to 'lib/slop/options.rb')
-rw-r--r--lib/slop/options.rb2
1 files changed, 1 insertions, 1 deletions
diff --git a/lib/slop/options.rb b/lib/slop/options.rb
index c1873d0..b739c5e 100644
--- a/lib/slop/options.rb
+++ b/lib/slop/options.rb
@@ -101,7 +101,7 @@ module Slop
str = config[:banner] ? "#{banner}\n" : ""
len = longest_flag_length
- options.select(&:help?).sort_by(&:tail).each_with_index do |opt, i|
+ options.select(&:help?).each_with_index.sort_by{ |o,i| [o.tail, i] }.each do |opt, i|
# use the index to fetch an associated separator
if sep = separators[i]
str << "#{sep}\n"