diff options
author | Michael Muré <batolettre@gmail.com> | 2019-06-23 14:37:04 +0200 |
---|---|---|
committer | GitHub <noreply@github.com> | 2019-06-23 14:37:04 +0200 |
commit | fb964bd3e99546df6edb5a4c913d0960dabe9826 (patch) | |
tree | 0846697446f1a75a170c8cef749b35992a40bde5 /vendor/github.com/spf13/cobra/zsh_completions.md | |
parent | 89c6732354ba4efd7c36c253fc5d02f0b6c7a7a4 (diff) | |
parent | b64587f87abdca0bb15120bf3da48eedd812ca6b (diff) | |
download | git-bug-fb964bd3e99546df6edb5a4c913d0960dabe9826.tar.gz |
Merge pull request #168 from MichaelMure/dependabot/dep/github.com/spf13/cobra-0.0.5
build(deps): bump github.com/spf13/cobra from 0.0.4 to 0.0.5
Diffstat (limited to 'vendor/github.com/spf13/cobra/zsh_completions.md')
-rw-r--r-- | vendor/github.com/spf13/cobra/zsh_completions.md | 39 |
1 files changed, 39 insertions, 0 deletions
diff --git a/vendor/github.com/spf13/cobra/zsh_completions.md b/vendor/github.com/spf13/cobra/zsh_completions.md new file mode 100644 index 00000000..df9c2eac --- /dev/null +++ b/vendor/github.com/spf13/cobra/zsh_completions.md @@ -0,0 +1,39 @@ +## Generating Zsh Completion for your cobra.Command + +Cobra supports native Zsh completion generated from the root `cobra.Command`. +The generated completion script should be put somewhere in your `$fpath` named +`_<YOUR COMMAND>`. + +### What's Supported + +* Completion for all non-hidden subcommands using their `.Short` description. +* Completion for all non-hidden flags using the following rules: + * Filename completion works by marking the flag with `cmd.MarkFlagFilename...` + family of commands. + * The requirement for argument to the flag is decided by the `.NoOptDefVal` + flag value - if it's empty then completion will expect an argument. + * Flags of one of the various `*Array` and `*Slice` types supports multiple + specifications (with or without argument depending on the specific type). +* Completion of positional arguments using the following rules: + * Argument position for all options below starts at `1`. If argument position + `0` is requested it will raise an error. + * Use `command.MarkZshCompPositionalArgumentFile` to complete filenames. Glob + patterns (e.g. `"*.log"`) are optional - if not specified it will offer to + complete all file types. + * Use `command.MarkZshCompPositionalArgumentWords` to offer specific words for + completion. At least one word is required. + * It's possible to specify completion for some arguments and leave some + unspecified (e.g. offer words for second argument but nothing for first + argument). This will cause no completion for first argument but words + completion for second argument. + * If no argument completion was specified for 1st argument (but optionally was + specified for 2nd) and the command has `ValidArgs` it will be used as + completion options for 1st argument. + * Argument completions only offered for commands with no subcommands. + +### What's not yet Supported + +* Custom completion scripts are not supported yet (We should probably create zsh + specific one, doesn't make sense to re-use the bash one as the functions will + be different). +* Whatever other feature you're looking for and doesn't exist :) |