1 # systemd-path(1) completion -*- shell-script -*-
3 # This file is part of systemd.
5 # systemd is free software; you can redistribute it and/or modify it
6 # under the terms of the GNU Lesser General Public License as published by
7 # the Free Software Foundation; either version 2.1 of the License, or
8 # (at your option) any later version.
10 # systemd is distributed in the hope that it will be useful, but
11 # WITHOUT ANY WARRANTY; without even the implied warranty of
12 # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
13 # General Public License for more details.
15 # You should have received a copy of the GNU Lesser General Public License
16 # along with systemd; If not, see <http://www.gnu.org/licenses/>.
19 local w word=$1; shift
21 [[ $w = "$word" ]] && return
27 systemd-path | { while IFS=: read -r a b; do echo " $a"; done; }
32 local cur=${COMP_WORDS[COMP_CWORD]} prev=${COMP_WORDS[COMP_CWORD-1]}
34 [STANDALONE]='-h --help --version'
38 _init_completion || return
40 if __contains_word "$prev" ${OPTS[ARG]}; then
46 COMPREPLY=( $(compgen -W '$comps' -- "$cur") )
50 if [[ "$cur" = -* ]]; then
51 COMPREPLY=( $(compgen -W '${OPTS[*]}' -- "$cur") )
55 comps=$( __get_names )
56 COMPREPLY=( $(compgen -W '$comps' -- "$cur") )
60 complete -F _systemd_path systemd-path