Debian Codegraph @

src/bash-completion/augprint

raw
1 # bash completion for augtool -*- shell-script -*-
2
3 _augprint()
4 {
5 local cur prev words cword
6 _init_completion || return
7
8 case $prev in
9 --help | --version | -!(-*)[hV])
10 return
11 ;;
12 --target | -!(-*)[t])
13 _filedir
14 return
15 ;;
16 --lens | -!(-*)[l])
17 local lenses
18 lenses="$(augtool --noload 'match /augeas/load/*/lens' | sed -e 's/.*@//')"
19 COMPREPLY=($(compgen -W "${lenses,,}" -- "${cur,,}"))
20 return
21 ;;
22 esac
23
24 if [[ "$cur" == -* ]]; then
25 local opts="$(_parse_help "$1")"
26 COMPREPLY=($(compgen -W '${opts:-$(_parse_help "$1")}' -- "$cur"))
27 else
28 _filedir
29 fi
30 } &&
31 complete -F _augprint augprint
32
33 # ex: filetype=sh