Haim Ashkenazi
d57d0497c3
zsh-completion: added escapinng of single quotes in flag description.
2018-03-17 20:55:27 +02:00
Haim Ashkenazi
70f3e356eb
zsh-completion: completion should always parse the root command!
...
It was running on the command it was invoked from which caused some
additional helpers (--help, --version) not to be generated.
2018-03-04 23:56:31 +02:00
Haim Ashkenazi
6ada43c6e8
zsh-completion: added support for filename globbing.
2018-03-02 14:00:08 +02:00
Haim Ashkenazi
d925cc6916
zsh-completion: removed forgotten function.
2018-03-01 08:02:33 +02:00
Haim Ashkenazi
9df4b2fced
zsh-completion: two fixes for identifying flag usage:
...
Fixed after input from @eparis:
- Decide on option parameter by checking NoOptDefVal
- Slices also could be specified multiple times.
2018-02-28 21:52:35 +02:00
Haim Ashkenazi
f7c1ed9054
zsh-completions: revised flags completion rendering + new features:
...
- If the flags are not bool the completion expects argument.
- You don't have to specify file extensions for file completion to
work.
- Allow multiple occurrences of flag if type is stringArray.
Need to verify that these assumption are correct :)
2018-02-28 17:04:17 +02:00
Haim Ashkenazi
91a14a05fe
zsh-completion template refactoring:
...
- removed redundant function
- improved other functions :)
- better names for other functions
2018-02-28 12:49:53 +02:00
Haim Ashkenazi
991feef2f5
zsh-completion: added support for subcommand description.
...
Also make the template more elegant on the way...
2018-02-26 22:31:06 +02:00
Haim Ashkenazi
7091b88f98
zsh-completion ignores hidden commands and flags :)
2018-02-25 14:12:58 +02:00
Haim Ashkenazi
892ebc0721
zsh-completion fixed reference to cmd name
...
cmd.Use is not the command name :). Found it once I figured out
that I need to execute the command in order to fully test the
generated completion.
2018-02-25 08:20:34 +02:00
Haim Ashkenazi
3100f0b575
First try at better zsh completions:
...
A very basic POC. Need to refactor to generate completion
structure before passing to the template to avoid repeated
computations.
What works:
* Real zsh completion (not built on bash)
* Basic flags (with long flag and optional shorthand)
* Basic filename completion indication (not with file extensions though)
What's missing:
* File extensions to filename completions
* Positional args
* Do we require handling only short flags?
2018-02-24 18:53:13 +02:00
Eric Paris
b787445794
Use func (c *Command) consistently ( #530 )
...
It makes the docs looks better. The idea was suggested by @SamWhited
2017-09-05 13:20:51 -04:00
agmen
4de692c1eb
adding a GenZshCompletionFile function to mirror bash_completion ( #529 )
2017-09-05 12:32:32 -04:00
bpicode
d7ba19510d
Add basic zsh completion (command hierarchy only)
...
Partially fixes #107
See PR #497
2017-07-30 02:44:28 -06:00