]>
Commit | Line | Data |
---|---|---|
76dceb10 SK |
1 | _rename_module() |
2 | { | |
3 | local cur prev OPTS | |
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 | |
76dceb10 SK |
12 | case $cur in |
13 | -*) | |
1325de17 | 14 | OPTS="--verbose --symlink --help --version --no-act --all --last --no-overwrite --interactive" |
76dceb10 SK |
15 | COMPREPLY=( $(compgen -W "${OPTS[*]}" -- $cur) ) |
16 | return 0 | |
17 | ;; | |
18 | esac | |
19 | case $COMP_CWORD in | |
20 | 1) | |
21 | COMPREPLY=( $(compgen -W "expression" -- $cur) ) | |
22 | ;; | |
23 | 2) | |
24 | COMPREPLY=( $(compgen -W "replacement" -- $cur) ) | |
25 | ;; | |
26 | *) | |
ce3e6b15 | 27 | local IFS=$'\n' |
76dceb10 SK |
28 | compopt -o filenames |
29 | COMPREPLY=( $(compgen -f -- $cur) ) | |
30 | ;; | |
31 | esac | |
32 | return 0 | |
33 | } | |
34 | complete -F _rename_module rename |