-
Notifications
You must be signed in to change notification settings - Fork 1.7k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
e27feb4
commit 8a0b42d
Showing
4 changed files
with
69 additions
and
106 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,29 @@ | ||
#compdef %[1]s | ||
compdef _%[1]s %[1]s | ||
|
||
# This is a shell completion script auto-generated by https://github.com/urfave/cli for zsh. | ||
|
||
_%[1]s() { | ||
local -a opts # Declare a local array | ||
local current | ||
current=${words[-1]} # -1 means "the last element" | ||
if [[ "$current" == "-"* ]]; then | ||
# Current word starts with a hyphen, so complete flags/options | ||
opts=("${(@f)$(${words[@]:0:#words[@]-1} ${current} --generate-shell-completion)}") | ||
else | ||
# Current word does not start with a hyphen, so complete subcommands | ||
opts=("${(@f)$(${words[@]:0:#words[@]-1} --generate-shell-completion)}") | ||
fi | ||
|
||
if [[ "${opts[1]}" != "" ]]; then | ||
_describe 'values' opts | ||
else | ||
_files | ||
fi | ||
} | ||
|
||
# Don't run the completion function when being source-ed or eval-ed. | ||
# See https://github.com/urfave/cli/issues/1874 for discussion. | ||
if [ "$funcstack[1]" = "_%[1]s" ]; then | ||
_%[1]s | ||
fi |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters