X-Git-Url: https://www.chiark.greenend.org.uk/ucgi/~ianmdlvl/git?a=blobdiff_plain;f=shell-completion%2Fzsh%2F_loginctl;h=6f6ff6e314a6ab458cbf574c10346839bf569c54;hb=e19b8719a54c343372e16b462c27f1e84c987b85;hp=1e2a4db2a0730d568f009a7ca7747b116ec58c96;hpb=5202b4c32abb1379ffe08d74a542d91f12490e54;p=elogind.git diff --git a/shell-completion/zsh/_loginctl b/shell-completion/zsh/_loginctl index 1e2a4db2a..6f6ff6e31 100644 --- a/shell-completion/zsh/_loginctl +++ b/shell-completion/zsh/_loginctl @@ -37,7 +37,12 @@ for fun in session-status show-session activate lock-session unlock-session term _sys_all_sessions_descr[(i)$_ignore:*]=() done - _describe -t systemd-sessions session _sys_all_sessions_descr _sys_all_sessions "$@" + if zstyle -T ":completion:${curcontext}:systemd-sessions" verbose; then + _describe -t systemd-sessions session _sys_all_sessions_descr _sys_all_sessions "$@" + else + local expl + _wanted systemd-sessions expl session compadd "$@" -a _sys_all_sessions + fi } done @@ -56,8 +61,14 @@ for fun in user-status show-user enable-linger disable-linger terminate-user kil _sys_all_users[(i)$_ignore]=() _sys_all_users_descr[(i)$_ignore:*]=() done + # using the common tag `users' here, not rolling our own `systemd-users' tag - _describe -t users user ${_sys_all_users_descr:+_sys_all_users_descr} _sys_all_users "$@" + if zstyle -T ":completion:${curcontext}:users" verbose; then + _describe -t users user ${_sys_all_users_descr:+_sys_all_users_descr} _sys_all_users "$@" + else + local expl + _wanted users expl user compadd "$@" -a _sys_all_users + fi } done @@ -72,7 +83,12 @@ done _sys_all_seats_descr[(i)$_ignore:*]=() done - _describe -t systemd-seats seat _sys_all_seats_descr _sys_all_seats "$@" + if zstyle -T ":completion:${curcontext}:systemd-seats" verbose; then + _describe -t systemd-seats seat _sys_all_seats_descr _sys_all_seats "$@" + else + local expl + _wanted systemd-seats expl seat compadd "$@" -a _sys_all_seats + fi } for fun in seat-status show-seat terminate-seat ; do (( $+functions[_loginctl_$fun] )) || _loginctl_$fun()