| 1 |
# bash completion for augtool -*- shell-script -*- |
| 2 |
|
| 3 |
_augtool() |
| 4 |
{ |
| 5 |
local cur prev words cword |
| 6 |
_init_completion || return |
| 7 |
|
| 8 |
case $prev in |
| 9 |
--help | --version | -!(-*)[hV]) |
| 10 |
return |
| 11 |
;; |
| 12 |
--load-file | --file | -!(-*)[lf]) |
| 13 |
_filedir |
| 14 |
return |
| 15 |
;; |
| 16 |
--root | --include | -!(-*)[rI]) |
| 17 |
_filedir -d |
| 18 |
return |
| 19 |
;; |
| 20 |
esac |
| 21 |
|
| 22 |
if [[ "$cur" == -* ]]; then |
| 23 |
local opts="$(_parse_help "$1")" |
| 24 |
COMPREPLY=($(compgen -W '${opts:-$(_parse_help "$1")}' -- "$cur")) |
| 25 |
fi |
| 26 |
} && |
| 27 |
complete -F _augtool augtool |
| 28 |
|
| 29 |
# ex: filetype=sh |