]> git.ipfire.org Git - thirdparty/util-linux.git/blame - bash-completion/pivot_root
rev: be careful with close()
[thirdparty/util-linux.git] / bash-completion / pivot_root
CommitLineData
c6f8c3f5
SK
1_pivot_root_module()
2{
d4f9b8d7 3 local cur prev
c6f8c3f5
SK
4 COMPREPLY=()
5 cur="${COMP_WORDS[COMP_CWORD]}"
d4f9b8d7
VS
6 prev="${COMP_WORDS[COMP_CWORD-1]}"
7 case $prev in
8 '-h'|'--help'|'-V'|'--version')
9 return 0
10 ;;
11 esac
c6f8c3f5
SK
12 case $COMP_CWORD in
13 1|2)
ce3e6b15 14 local IFS=$'\n'
c6f8c3f5
SK
15 compopt -o filenames
16 COMPREPLY=( $(compgen -o dirnames -- ${cur:-"/"}) )
17 ;;
18 esac
19 return 0
20}
21complete -F _pivot_root_module pivot_root