summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorLee Jarvis <ljjarvis@gmail.com>2013-01-08 12:07:57 +0000
committerLee Jarvis <ljjarvis@gmail.com>2013-01-08 12:07:57 +0000
commit19e946c37c62e6bb2dc6ec0b44588fcf7c01f72a (patch)
tree0729ee21d9f4a672307802f11e38fea801403a3b
parent52132159e28fefec43c523108c1884de84f0247d (diff)
downloadslop-19e946c37c62e6bb2dc6ec0b44588fcf7c01f72a.tar.gz
add [command] to banner if commands exist
-rw-r--r--lib/slop.rb2
1 files changed, 1 insertions, 1 deletions
diff --git a/lib/slop.rb b/lib/slop.rb
index 2c56df5..82c1bc4 100644
--- a/lib/slop.rb
+++ b/lib/slop.rb
@@ -431,7 +431,7 @@ class Slop
end
banner = config[:banner]
- banner = "Usage: #{File.basename($0, '.*')} [options]" if banner.nil?
+ banner = "Usage: #{File.basename($0, '.*')}#{' [command]' if @commands.any?} [options]" if banner.nil?
if banner
"#{banner}\n#{@separators[0] ? "#{@separators[0]}\n" : ''}#{optstr}"
else