diff options
| author | Jun-ichi Takimoto <takimoto-j@kba.biglobe.ne.jp> | 2021-10-24 21:43:38 +0900 |
|---|---|---|
| committer | Jun-ichi Takimoto <takimoto-j@kba.biglobe.ne.jp> | 2021-10-24 21:43:38 +0900 |
| commit | b4c8aee52dfe5788e4ec440a0da8e59f5eab4cc4 (patch) | |
| tree | 4279670e7d9f51d3d3fca584ea0a515ba5b02af8 /Etc | |
| parent | 49493: fix '_arguments --' to correctly recognize optional argument (diff) | |
| download | zsh-b4c8aee52dfe5788e4ec440a0da8e59f5eab4cc4.tar zsh-b4c8aee52dfe5788e4ec440a0da8e59f5eab4cc4.tar.gz zsh-b4c8aee52dfe5788e4ec440a0da8e59f5eab4cc4.tar.bz2 zsh-b4c8aee52dfe5788e4ec440a0da8e59f5eab4cc4.tar.lz zsh-b4c8aee52dfe5788e4ec440a0da8e59f5eab4cc4.tar.xz zsh-b4c8aee52dfe5788e4ec440a0da8e59f5eab4cc4.tar.zst zsh-b4c8aee52dfe5788e4ec440a0da8e59f5eab4cc4.zip | |
49520: document $_args_chache_cmd
Diffstat (limited to 'Etc')
| -rw-r--r-- | Etc/completion-style-guide | 10 |
1 files changed, 10 insertions, 0 deletions
diff --git a/Etc/completion-style-guide b/Etc/completion-style-guide index 62e6a2787..4fa0040a5 100644 --- a/Etc/completion-style-guide +++ b/Etc/completion-style-guide @@ -570,3 +570,13 @@ Misc. remarks data derived from another command's output to the helper. Consider using some variation of the `q` expansion flag to deal with this: `_call_program vals $words[1] ${(q-)myfile}' +10) If you are going to create a new completion function '_cmd' for a + command 'cmd', and if the 'cmd' supports the --help option, then you + may try + compdef _gnu_generic cmd + cmd -<TAB> + _gnu_generic may not work sufficiently well for 'cmd', but the specs + for _arguments generated from the help text are cached in a variable + '_args_cache_cmd', and you can save them in a file '_cmd' by + print -r -- ${(F)${(@qqq)_args_cache_cmd}} > _cmd + and use the file as a draft of the new completion function. |
