summaryrefslogtreecommitdiff
path: root/lib
diff options
context:
space:
mode:
authorLee Jarvis <ljjarvis@gmail.com>2014-12-19 17:25:11 +0000
committerLee Jarvis <ljjarvis@gmail.com>2014-12-19 17:25:11 +0000
commit5ac09189a90261807ca0799e49ccfc4dca4484e7 (patch)
treeee65e2363e1e983f8974aa2ed6e372a3f3a4431e /lib
parent7cee65ee47c365799bfe0f03217036c1dc0787b2 (diff)
downloadslop-5ac09189a90261807ca0799e49ccfc4dca4484e7.tar.gz
Provide and option to disable banners
Diffstat (limited to 'lib')
-rw-r--r--lib/slop/options.rb3
1 files changed, 2 insertions, 1 deletions
diff --git a/lib/slop/options.rb b/lib/slop/options.rb
index c612997..bb0112b 100644
--- a/lib/slop/options.rb
+++ b/lib/slop/options.rb
@@ -5,6 +5,7 @@ module Slop
DEFAULT_CONFIG = {
suppress_errors: false,
type: "null",
+ banner: true,
}
# The Array of Option instances we've created.
@@ -97,7 +98,7 @@ module Slop
# Returns the help text for this options. Used by Result#to_s.
def to_s(prefix: " " * 4)
- str = banner + "\n"
+ str = config[:banner] ? "#{banner}\n" : ""
len = longest_flag_length
options.select(&:help?).each_with_index do |opt, i|