summaryrefslogtreecommitdiff
path: root/lib/options.rb
diff options
context:
space:
mode:
Diffstat (limited to 'lib/options.rb')
-rw-r--r--lib/options.rb12
1 files changed, 6 insertions, 6 deletions
diff --git a/lib/options.rb b/lib/options.rb
index 79e3c51..ee30295 100644
--- a/lib/options.rb
+++ b/lib/options.rb
@@ -5,12 +5,12 @@ module RCM
module Options
@@options = { debug: false }
- after_double_dash = ARGV.slice_before('--').to_a.last.drop(1)
-
- OptionParser.new do |opts|
- opts.banner = 'Usage: rake [task] -- [options]'
- opts.on('-v', '--[no-]debug', 'debug output') { |v| @@options[:debug] = v }
- end.parse!(after_double_dash)
+ if (after_double_dash = ARGV.slice_before('--').to_a.last&.drop(1))
+ OptionParser.new do |opts|
+ opts.banner = 'Usage: rake [task] -- [options]'
+ opts.on('-v', '--[no-]debug', 'debug output') { |v| @@options[:debug] = v }
+ end.parse!(after_double_dash)
+ end
def option(key)
raise "No such option: #{key}" unless @@options.key?(key)