console_runner 0.1.19 → 0.1.20
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 +5 -1
- 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: 0c79e1d20d6a2c13058ab7bfc7392db15f0fa18f
|
4
|
+
data.tar.gz: 4c1d9bf3a7426c484acf0278241b65e61f5281b1
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 79b5f19ec17a3948780cece0cd4498f87e20c1286acc5df491b06550b130a57fec3497d5c2708a84aec0fe05a77b70ab3480b55f533b8332fd3bd94e57700d4f
|
7
|
+
data.tar.gz: 9c691933f59ff3b88dd7b953e74f77343224c6798c89eec1b52235e002c3da12c0f3617ec8527afe2d07012b02cae1ee305e33f10848cb4638b7f78b44f8b338
|
data/lib/command_line_parser.rb
CHANGED
@@ -27,6 +27,10 @@ class CommandLineParser
|
|
27
27
|
@debug
|
28
28
|
end
|
29
29
|
|
30
|
+
def self.debug=(value)
|
31
|
+
@debug=value
|
32
|
+
end
|
33
|
+
|
30
34
|
def tool_banner
|
31
35
|
result = FileParser.select_runnable_tags(@file_parser.clazz).map(&:text).join("\n")
|
32
36
|
result += "\n\nAvailable actions:\n"
|
@@ -45,7 +49,7 @@ class CommandLineParser
|
|
45
49
|
action_index = ARGV.index(action)
|
46
50
|
scope = ARGV[0..action_index] if action_index
|
47
51
|
end
|
48
|
-
|
52
|
+
CommandLineParser.debug = ARGV.any? { |a| %w(-d --debug).include? a }
|
49
53
|
return unless scope.any? { |a| %w(-h --help).include? a }
|
50
54
|
@parser.banner("\n" + banner)
|
51
55
|
Trollop::with_standard_exception_handling(@parser) { raise Trollop::HelpNeeded }
|