diff --git a/shell-completion/bash/systemctl.in b/shell-completion/bash/systemctl.in index f6be3827cf..b26381a324 100644 --- a/shell-completion/bash/systemctl.in +++ b/shell-completion/bash/systemctl.in @@ -320,11 +320,20 @@ _systemctl () { elif __contains_word "$verb" ${VERBS[JOBS]}; then comps=$( __systemctl $mode list-jobs | { while read -r a b; do echo " $a"; done; } ) - elif __contains_word "$verb" ${VERBS[ENVS]}; then + elif [ "$verb" = 'unset-environment' ]; then + comps=$( __systemctl $mode show-environment \ + | while read -r line; do echo " ${line%%=*}"; done ) + compopt -o nospace + + elif [ "$verb" = 'set-environment' ]; then comps=$( __systemctl $mode show-environment \ | while read -r line; do echo " ${line%%=*}="; done ) compopt -o nospace + elif [ "$verb" = 'import-environment' ]; then + COMPREPLY=( $(compgen -A variable -- "$cur_orig") ) + return 0 + elif __contains_word "$verb" ${VERBS[FILE]}; then comps=$( compgen -A file -- "$cur" ) compopt -o filenames diff --git a/shell-completion/zsh/_systemctl.in b/shell-completion/zsh/_systemctl.in index 4830aeba5f..22c40898e3 100644 --- a/shell-completion/zsh/_systemctl.in +++ b/shell-completion/zsh/_systemctl.in @@ -365,6 +365,11 @@ for fun in set-environment unset-environment ; do } done +(( $+functions[_systemctl_import-environment] )) || _systemctl_import-environment() +{ + _parameters +} + (( $+functions[_systemctl_link] )) || _systemctl_link() { _sd_unit_files }