Some zsh completion helpers were not installed, so completion
was broken.
Add systemd-analyze verify. Make systemctl link complete only
unit names.
shell-completion/zsh/_systemd-analyze \
shell-completion/zsh/_systemd-run \
shell-completion/zsh/_sd_hosts_or_user_at_host \
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
shell-completion/zsh/_systemd-delta \
shell-completion/zsh/_systemd
* register catalog database signature as file magic
* register catalog database signature as file magic
+* zsh shell completion: <command> <verb> -<TAB> should complete options, but currently
+ does not
+
Regularly:
* look for close() vs. close_nointr() vs. close_nointr_nofail()
Regularly:
* look for close() vs. close_nointr() vs. close_nointr_nofail()
comps=$(compgen -A signal)
;;
--type|-t)
comps=$(compgen -A signal)
;;
--type|-t)
- comps='automount device mount path service snapshot socket swap target timer'
+ comps='automount busname device mount path service snapshot socket swap target timer'
;;
--state)
comps='loaded not-found stub
;;
--state)
comps='loaded not-found stub
[CRITICAL_CHAIN]='critical-chain'
[DOT]='dot'
[LOG_LEVEL]='set-log-level'
[CRITICAL_CHAIN]='critical-chain'
[DOT]='dot'
[LOG_LEVEL]='set-log-level'
)
_init_completion || return
)
_init_completion || return
comps='debug info notice warning err crit alert emerg'
fi
comps='debug info notice warning err crit alert emerg'
fi
+ elif __contains_word "$verb" ${VERBS[VERIFY]}; then
+ if [[ $cur = -* ]]; then
+ comps='--help --version --system --user --no-man'
+ else
+ comps=$( compgen -A file -- "$cur" )
+ compopt -o filenames
+ fi
+
fi
COMPREPLY=( $(compgen -W '$comps' -- "$cur") )
fi
COMPREPLY=( $(compgen -W '$comps' -- "$cur") )
--- /dev/null
+#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)'
+}
-(( $+functions[_systemctl_link] )) || _systemctl_link() { _files }
+(( $+functions[_systemctl_link] )) || _systemctl_link() {
+ _sd_unit_files
+}
# no systemctl completion for:
# [STANDALONE]='daemon-reexec daemon-reload default
# no systemctl completion for:
# [STANDALONE]='daemon-reexec daemon-reload default
_unit_types() {
local -a _types
_unit_types() {
local -a _types
- _types=(automount device mount path service snapshot socket swap target timer)
+ _types=(automount busname device mount path service snapshot socket swap target timer)
_values -s , "${_types[@]}"
}
_values -s , "${_types[@]}"
}
_describe -t level 'logging level' _levels || compadd "$@"
}
_describe -t level 'logging level' _levels || compadd "$@"
}
+_systemd_analyze_verify() {
+ _sd_unit_files
+}
+
_systemd_analyze_command(){
local -a _systemd_analyze_cmds
# Descriptions taken from systemd-analyze --help.
_systemd_analyze_command(){
local -a _systemd_analyze_cmds
# Descriptions taken from systemd-analyze --help.
'dot:Dump dependency graph (in dot(1) format)'
'dump:Dump server status'
'set-log-level:Set systemd log threshold'
'dot:Dump dependency graph (in dot(1) format)'
'dump:Dump server status'
'set-log-level:Set systemd log threshold'
+ 'verify:Check unit files for correctness'
)
if (( CURRENT == 1 )); then
)
if (( CURRENT == 1 )); then
_arguments \
{-h,--help}'[Show help text.]' \
_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]' \
'--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'
'*::systemd-analyze commands:_systemd_analyze_command'