console_runner 0.1.18 → 0.1.19
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/lib/command_line_parser.rb +2 -2
- data/lib/console_runner/version.rb +1 -1
- metadata +1 -1
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: df82927720c132e22e5827e1f1ad7ea13b3e320f
|
4
|
+
data.tar.gz: 02cf4ea9fb249c8a919fc53d66537aa331449d82
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 8647ea0b4742fd25473a34dbc18a154d12bfb78f976663090e95748dd4fa0522d3efdcb487e6e415e291d63308c9005fa3c746b16f85dc6f05874e1f6ba63bd2
|
7
|
+
data.tar.gz: 5a0b7fb1485479310d5ff313a5407a76b4eaa68119735dc50dee2aa922b830034a39a2bbc7a37fd1e2052f287a0d9b51ff5d8e14a99bb2188f008fd3de62d1d1
|
data/lib/command_line_parser.rb
CHANGED
@@ -19,7 +19,6 @@ class CommandLineParser
|
|
19
19
|
]
|
20
20
|
end.to_h
|
21
21
|
@parser = Trollop::Parser.new
|
22
|
-
@parser.opt(:debug, 'Run in debug mode.', type: :flag)
|
23
22
|
@parser.stop_on @sub_commands
|
24
23
|
@initialize_method = nil
|
25
24
|
end
|
@@ -46,7 +45,7 @@ class CommandLineParser
|
|
46
45
|
action_index = ARGV.index(action)
|
47
46
|
scope = ARGV[0..action_index] if action_index
|
48
47
|
end
|
49
|
-
@debug =
|
48
|
+
@debug = ARGV.any? { |a| %w(-d --debug).include? a }
|
50
49
|
return unless scope.any? { |a| %w(-h --help).include? a }
|
51
50
|
@parser.banner("\n" + banner)
|
52
51
|
Trollop::with_standard_exception_handling(@parser) { raise Trollop::HelpNeeded }
|
@@ -63,6 +62,7 @@ class CommandLineParser
|
|
63
62
|
raise_on_action_absence @sub_commands
|
64
63
|
@initialize_method ||= MethodParser.new(@file_parser.initialize_method) if @file_parser.initialize_method
|
65
64
|
@method = MethodParser.new action
|
65
|
+
@parser.opt(:debug, 'Run in debug mode.', type: :flag)
|
66
66
|
[@initialize_method, @method].each do |method|
|
67
67
|
next unless method
|
68
68
|
method.trollop_opts.each { |a| @parser.opt(*a) }
|