shell-completion: systemd-analyze verify, systemctl link

Some zsh completion helpers were not installed, so completion
was broken.

Add systemd-analyze verify. Make systemctl link complete only
unit names.

(cherry picked from commit 2c12a402cb)

Conflicts:
	TODO

[backport: undo verify and busname changes]
This commit is contained in:
Zbigniew Jędrzejewski-Szmek
2014-07-21 21:11:56 -04:00
parent 7919b87d1f
commit b76c90d451
4 changed files with 20 additions and 2 deletions
+2
View File
@@ -362,6 +362,8 @@ dist_zshcompletion_DATA = \
shell-completion/zsh/_systemd-analyze \
shell-completion/zsh/_systemd-run \
shell-completion/zsh/_sd_hosts_or_user_at_host \
shell-completion/zsh/_sd_outputmodes \
shell-completion/zsh/_sd_unit_files \
shell-completion/zsh/_systemd-delta \
shell-completion/zsh/_systemd
+9
View File
@@ -0,0 +1,9 @@
#autoload
_sd_unit_files() {
local files expl
files=( '*:files:->files' )
_description files expl 'unit file'
_files "$expl[@]" -g '*.(automount|busname|device|mount|path|service|snapshot|socket|swap|target|timer)'
}
+3 -1
View File
@@ -259,7 +259,9 @@ for fun in set-environment unset-environment ; do
}
done
(( $+functions[_systemctl_link] )) || _systemctl_link() { _files }
(( $+functions[_systemctl_link] )) || _systemctl_link() {
_sd_unit_files
}
# no systemctl completion for:
# [STANDALONE]='daemon-reexec daemon-reload default
+6 -1
View File
@@ -38,7 +38,12 @@ _systemd_analyze_command(){
_arguments \
{-h,--help}'[Show help text.]' \
'--user[Shows performance data of user sessions instead of the system manager.]' \
'--system[Operate on system systemd instance.]' \
'--user[Operate on user systemd instance.]' \
'--no-pager[Do not user pager.]' \
'--no-man[Do not check man pages.]' \
'--order[When generating graph for dot, show only order]' \
'--require[When generating graph for dot, show only requirement]' \
{-H+,--host=}'[Operate on remote host]:userathost:_sd_hosts_or_user_at_host' \
{-M+,--machine=}'[Operate on local container]:machine' \
'*::systemd-analyze commands:_systemd_analyze_command'