| 1 |
_fsck_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 |
'-b') |
| 9 |
COMPREPLY=( $(compgen -W "superblock" -- $cur) ) |
| 10 |
return 0 |
| 11 |
;; |
| 12 |
'-B') |
| 13 |
COMPREPLY=( $(compgen -W "blocksize" -- $cur) ) |
| 14 |
return 0 |
| 15 |
;; |
| 16 |
'-j') |
| 17 |
COMPREPLY=( $(compgen -W "external_journal" -- $cur) ) |
| 18 |
return 0 |
| 19 |
;; |
| 20 |
'-l'|'-L') |
| 21 |
COMPREPLY=( $(compgen -W "bad_blocks_file" -- $cur) ) |
| 22 |
return 0 |
| 23 |
;; |
| 24 |
'-?') |
| 25 |
return 0 |
| 26 |
;; |
| 27 |
esac |
| 28 |
case $cur in |
| 29 |
-*) |
| 30 |
OPTS="-p -n -y -c -f -v -b -B -j -l -L --help --version" |
| 31 |
COMPREPLY=( $(compgen -W "${OPTS[*]}" -- $cur) ) |
| 32 |
return 0 |
| 33 |
;; |
| 34 |
esac |
| 35 |
compopt -o bashdefault -o default |
| 36 |
COMPREPLY=( $(compgen -W "$(command lsblk -pnro name)" -- $cur) ) |
| 37 |
return 0 |
| 38 |
} |
| 39 |
complete -F _fsck_module fsck |