summaryrefslogtreecommitdiff
path: root/src/grp-utils/systemd-path/systemd-path.completion.zsh
blob: 4919cf42506356038f97f78530be6b3d9b2721be (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
#compdef systemd-path

__get_names() {
        systemd-path | { while IFS=: read -r a b; do echo " $a"; done; }
}

__names() {
        local -a _names
        _names=(${(fo)"$(__get_names)"})
        typeset -U _names
        _describe 'names' _names
}

_arguments \
        {-h,--help}'[Show help message]' \
        '--version[Show package version]' \
        '--host=[Sufix to append to paths]:suffix' \
	'*:name:__names'