thor-completion 0.0.4 → 0.0.5
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +4 -4
- data/CHANGELOG.md +6 -0
- data/lib/thor/completion/version.rb +1 -1
- data/lib/thor/completion/zsh.rb +5 -4
- metadata +5 -5
checksums.yaml
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
---
|
|
2
2
|
SHA256:
|
|
3
|
-
metadata.gz:
|
|
4
|
-
data.tar.gz:
|
|
3
|
+
metadata.gz: c49505c007d48270ffb369298b6f8b11917200030e3d00e96cb6582555fc76a5
|
|
4
|
+
data.tar.gz: f85beb78adb7934319054ef69f10092df9c9a610bf7a406b977d6d0be873253d
|
|
5
5
|
SHA512:
|
|
6
|
-
metadata.gz:
|
|
7
|
-
data.tar.gz:
|
|
6
|
+
metadata.gz: 6545bcb815d53e9bc37cf24def563862462ab497bb0132eb251a46ae7e351872e1b6e2c296aedc0be93396d79f2d2f6215a6c3e7e5a263dcf56da9efd15badd6
|
|
7
|
+
data.tar.gz: ebc1fa9a160ef976a92ce3e58380c1d7da84f8d163a53451394e4bb59807e379ba14b15f68f726291aaf6b24ba4e403e7521add28e05051a4ce2442120473011
|
data/CHANGELOG.md
CHANGED
|
@@ -11,6 +11,12 @@ Prefix your message with one of the following:
|
|
|
11
11
|
- [Security] in case of vulnerabilities.
|
|
12
12
|
-->
|
|
13
13
|
|
|
14
|
+
## v0.0.5
|
|
15
|
+
|
|
16
|
+
- [Fixed] Remove position number from variadic arguments in zsh completions.
|
|
17
|
+
- [Fixed] Prioritize subcommand state handling over arguments for commands with
|
|
18
|
+
subcommands.
|
|
19
|
+
|
|
14
20
|
## v0.0.4
|
|
15
21
|
|
|
16
22
|
- [Fixed] Escape newlines in option descriptions for zsh completions.
|
data/lib/thor/completion/zsh.rb
CHANGED
|
@@ -152,7 +152,7 @@ class Thor
|
|
|
152
152
|
end
|
|
153
153
|
|
|
154
154
|
# Add positional arguments
|
|
155
|
-
if cmd[:arguments]&.any?
|
|
155
|
+
if cmd[:arguments]&.any? && !cmd[:subcommands]&.any?
|
|
156
156
|
cmd[:arguments].each_with_index do |arg, idx|
|
|
157
157
|
args << format_argument(arg, idx + 1)
|
|
158
158
|
end
|
|
@@ -280,14 +280,15 @@ class Thor
|
|
|
280
280
|
arg_name = arg[:name]
|
|
281
281
|
arg_desc = arg[:description] || arg_name
|
|
282
282
|
variadic = arg[:variadic] ? "*" : ""
|
|
283
|
+
pos = variadic.empty? ? position.to_s : ""
|
|
283
284
|
|
|
284
285
|
if arg[:completion]
|
|
285
286
|
completion = format_completion(arg[:completion])
|
|
286
|
-
"'#{variadic}#{
|
|
287
|
+
"'#{variadic}#{pos}:#{arg_desc}:#{completion}'"
|
|
287
288
|
elsif arg[:required] == false
|
|
288
|
-
"'#{variadic}#{
|
|
289
|
+
"'#{variadic}#{pos}::#{arg_desc}:_files'"
|
|
289
290
|
else
|
|
290
|
-
"'#{variadic}#{
|
|
291
|
+
"'#{variadic}#{pos}:#{arg_desc}:_files'"
|
|
291
292
|
end
|
|
292
293
|
end
|
|
293
294
|
|
metadata
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
|
2
2
|
name: thor-completion
|
|
3
3
|
version: !ruby/object:Gem::Version
|
|
4
|
-
version: 0.0.
|
|
4
|
+
version: 0.0.5
|
|
5
5
|
platform: ruby
|
|
6
6
|
authors:
|
|
7
7
|
- Nando Vieira
|
|
@@ -165,10 +165,10 @@ metadata:
|
|
|
165
165
|
rubygems_mfa_required: 'true'
|
|
166
166
|
homepage_uri: https://github.com/fnando/thor-completion
|
|
167
167
|
bug_tracker_uri: https://github.com/fnando/thor-completion/issues
|
|
168
|
-
source_code_uri: https://github.com/fnando/thor-completion/tree/v0.0.
|
|
169
|
-
changelog_uri: https://github.com/fnando/thor-completion/tree/v0.0.
|
|
170
|
-
documentation_uri: https://github.com/fnando/thor-completion/tree/v0.0.
|
|
171
|
-
license_uri: https://github.com/fnando/thor-completion/tree/v0.0.
|
|
168
|
+
source_code_uri: https://github.com/fnando/thor-completion/tree/v0.0.5
|
|
169
|
+
changelog_uri: https://github.com/fnando/thor-completion/tree/v0.0.5/CHANGELOG.md
|
|
170
|
+
documentation_uri: https://github.com/fnando/thor-completion/tree/v0.0.5/README.md
|
|
171
|
+
license_uri: https://github.com/fnando/thor-completion/tree/v0.0.5/LICENSE.md
|
|
172
172
|
rdoc_options: []
|
|
173
173
|
require_paths:
|
|
174
174
|
- lib
|