]> git.ipfire.org Git - thirdparty/util-linux.git/blob - bash-completion/fdformat
rev: be careful with close()
[thirdparty/util-linux.git] / bash-completion / fdformat
1 _fdformat_module()
2 {
3 local cur prev OPTS
4 COMPREPLY=()
5 cur="${COMP_WORDS[COMP_CWORD]}"
6 prev="${COMP_WORDS[COMP_CWORD-1]}"
7 case $prev in
8 '-f'|'--from'|'-t'|'--to'|'-r'|'--repair')
9 COMPREPLY=( $(compgen -W "track_num" -- $cur) )
10 return 0
11 ;;
12 '-h'|'--help'|'-V'|'--version')
13 return 0
14 ;;
15 esac
16 DEVS=$(for I in echo /dev/fd*; do if [ -e $I ]; then echo $I; fi; done)
17 OPTS="
18 --from
19 --to
20 --repair
21 --no-verify
22 --help
23 --version
24 $DEVS
25 "
26 COMPREPLY=( $(compgen -W "${OPTS[*]}" -- $cur) )
27 return 0
28 }
29 complete -F _fdformat_module fdformat