]> git.ipfire.org Git - thirdparty/systemd.git/commit
improve zsh completion (#32098)
authorEisuke Kawashima <e-kwsm@users.noreply.github.com>
Mon, 15 Apr 2024 08:58:48 +0000 (17:58 +0900)
committerGitHub <noreply@github.com>
Mon, 15 Apr 2024 08:58:48 +0000 (10:58 +0200)
commit20927c0eec5832b5f4cc0433e8fc36f3f5fed541
treef56fe650d2c428adf5200d2fa8c827ee3f66f20e
parentd1a7e030c5daa4a09ee93b8af6b28ecaac5d34d0
improve zsh completion (#32098)

* fix error
* remove options that are no longer supported
* add missing options
* stop completion if an option `--help` or `--version` is supplied

[[[
zjs: a note for the reader:

zshcompsys(1) in the section about optspecs in _arguments says:

> Each of the forms above may be preceded by a list in parentheses of option names  and  argument  num‐
> bers.  If the given option is on the command line, the options and arguments indicated in parentheses
> will not be offered.  For example, ‘(-two -three 1)-one:...' completes the option ‘-one'; if this ap‐
> pears  on  the  command line, the options -two and -three and the first ordinary argument will not be
> completed after it.  ‘(-foo):...' specifies an ordinary argument completion; -foo will  not  be  com‐
> pleted if that argument is already present.
>
> Other  items  may  appear in the list of excluded options to indicate various other items that should
> not be applied when the current specification is matched: a single star (\*) for  the  rest  arguments
> (i.e. a specification of the form ‘\*:...'); a colon (:) for all normal (non-option-) arguments; and a
> hyphen (-) for all options.  For example, if ‘(\*)' appears before an option and the option appears on
> the  command  line,  the  list  of remaining arguments (those shown in the above table beginning with
> ‘\*:') will not be completed.

The intended effect of the change is to remove irrelevant completion matches from the completion.

tl;dr: (- : ) prevents further completion
]]]
23 files changed:
shell-completion/zsh/_bootctl
shell-completion/zsh/_busctl
shell-completion/zsh/_coredumpctl
shell-completion/zsh/_hostnamectl
shell-completion/zsh/_journalctl
shell-completion/zsh/_kernel-install
shell-completion/zsh/_localectl
shell-completion/zsh/_loginctl
shell-completion/zsh/_machinectl
shell-completion/zsh/_networkctl
shell-completion/zsh/_oomctl
shell-completion/zsh/_resolvectl
shell-completion/zsh/_systemctl.in
shell-completion/zsh/_systemd
shell-completion/zsh/_systemd-analyze
shell-completion/zsh/_systemd-delta
shell-completion/zsh/_systemd-inhibit
shell-completion/zsh/_systemd-nspawn
shell-completion/zsh/_systemd-path
shell-completion/zsh/_systemd-run
shell-completion/zsh/_systemd-tmpfiles
shell-completion/zsh/_timedatectl
shell-completion/zsh/_udevadm