From 2c12a402cb1e8277c271ced8dc9c06d20b8f6017 Mon Sep 17 00:00:00 2001 From: Zbigniew Jędrzejewski-Szmek Date: Mon, 21 Jul 2014 21:11:56 -0400 Subject: 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. --- shell-completion/zsh/_sd_unit_files | 9 +++++++++ shell-completion/zsh/_systemctl.in | 6 ++++-- shell-completion/zsh/_systemd-analyze | 12 +++++++++++- 3 files changed, 24 insertions(+), 3 deletions(-) create mode 100644 shell-completion/zsh/_sd_unit_files (limited to 'shell-completion/zsh') diff --git a/shell-completion/zsh/_sd_unit_files b/shell-completion/zsh/_sd_unit_files new file mode 100644 index 0000000000..4778a0420d --- /dev/null +++ b/shell-completion/zsh/_sd_unit_files @@ -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)' +} diff --git a/shell-completion/zsh/_systemctl.in b/shell-completion/zsh/_systemctl.in index d9b8d1c0e3..d364d17dd9 100644 --- a/shell-completion/zsh/_systemctl.in +++ b/shell-completion/zsh/_systemctl.in @@ -261,7 +261,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 @@ -297,7 +299,7 @@ _unit_states() { _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[@]}" } diff --git a/shell-completion/zsh/_systemd-analyze b/shell-completion/zsh/_systemd-analyze index 2eda5fe8a9..c101ad0fae 100644 --- a/shell-completion/zsh/_systemd-analyze +++ b/shell-completion/zsh/_systemd-analyze @@ -6,6 +6,10 @@ _systemd_analyze_set-log-level() { _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. @@ -17,6 +21,7 @@ _systemd_analyze_command(){ '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 @@ -38,7 +43,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' -- cgit v1.2.3-54-g00ecf