toys-core 0.3.9 → 0.3.9.1
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/CHANGELOG.md +4 -0
- data/lib/toys/core_version.rb +1 -1
- data/lib/toys/standard_middleware/add_verbosity_flags.rb +4 -2
- data/lib/toys/standard_middleware/show_help.rb +14 -12
- metadata +1 -1
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 3ddc8eac1d584a35898abadd2c8ef601c6fa4c98fc6854e0bd5578e47f46b6ae
|
4
|
+
data.tar.gz: e15d35d38f56128bb8d5cdef467db338b6e813f88df5be5cbe4a44b9698703fd
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 0ff220cbdc9fca5b657d7f4924ad5ac263984ece39be6ed267c2d1f1989004ebcba2cb00f69c3427c890c45341fe0829852987ff324e02d2915abe9a58b4d380
|
7
|
+
data.tar.gz: 20bc712ca5414341e309178d7367f7d4bdc506a8bd1d7f0fda3fa01f4f9f4d64e8c733f0879060d610626a760b6f5db3bb8279ffe096bc50b35f79d99f1a0f29
|
data/CHANGELOG.md
CHANGED
data/lib/toys/core_version.rb
CHANGED
@@ -79,8 +79,10 @@ module Toys
|
|
79
79
|
# Configure the tool flags.
|
80
80
|
#
|
81
81
|
def config(tool_definition, _loader)
|
82
|
-
|
83
|
-
|
82
|
+
unless tool_definition.argument_parsing_disabled?
|
83
|
+
add_verbose_flags(tool_definition)
|
84
|
+
add_quiet_flags(tool_definition)
|
85
|
+
end
|
84
86
|
yield
|
85
87
|
end
|
86
88
|
|
@@ -150,19 +150,21 @@ module Toys
|
|
150
150
|
# Configure flags and default data.
|
151
151
|
#
|
152
152
|
def config(tool_definition, loader)
|
153
|
-
|
154
|
-
|
155
|
-
|
156
|
-
if
|
157
|
-
tool_definition.
|
158
|
-
|
159
|
-
|
153
|
+
unless tool_definition.argument_parsing_disabled?
|
154
|
+
help_flags = add_help_flags(tool_definition)
|
155
|
+
usage_flags = add_usage_flags(tool_definition)
|
156
|
+
if @allow_root_args && (!help_flags.empty? || !usage_flags.empty?)
|
157
|
+
if tool_definition.root? && tool_definition.arg_definitions.empty?
|
158
|
+
tool_definition.set_remaining_args(:_tool_name,
|
159
|
+
display_name: "TOOL_NAME",
|
160
|
+
desc: "The tool for which to display help")
|
161
|
+
end
|
162
|
+
end
|
163
|
+
if (!help_flags.empty? || @fallback_execution) &&
|
164
|
+
loader.has_subtools?(tool_definition.full_name)
|
165
|
+
add_recursive_flags(tool_definition)
|
166
|
+
add_search_flags(tool_definition)
|
160
167
|
end
|
161
|
-
end
|
162
|
-
if (!help_flags.empty? || @fallback_execution) &&
|
163
|
-
loader.has_subtools?(tool_definition.full_name)
|
164
|
-
add_recursive_flags(tool_definition)
|
165
|
-
add_search_flags(tool_definition)
|
166
168
|
end
|
167
169
|
yield
|
168
170
|
end
|