Users who know the short options can just hit the short option instead of tab, and it's not likely that it would be helpful to present a list of single character options to users who don't know them, doing so just unnecessarily trashes the list of suggestions. Signed-off-by: Ville Skyttä <ville.skytta@iki.fi>
21 lines
489 B
Text
21 lines
489 B
Text
_fsck.cramfs_module()
|
|
{
|
|
local cur prev OPTS
|
|
COMPREPLY=()
|
|
cur="${COMP_WORDS[COMP_CWORD]}"
|
|
prev="${COMP_WORDS[COMP_CWORD-1]}"
|
|
case $prev in
|
|
'-x'|'--destination')
|
|
compopt -o filenames
|
|
COMPREPLY=( $(compgen -o dirnames -- ${cur:-"/"}) )
|
|
return 0
|
|
;;
|
|
'-h'|'--help'|'-V'|'--version')
|
|
return 0
|
|
;;
|
|
esac
|
|
OPTS='--verbose --destination --help --version file'
|
|
COMPREPLY=( $(compgen -W "${OPTS[*]}" -S ' ' -- $cur) )
|
|
return 0
|
|
}
|
|
complete -F _fsck.cramfs_module fsck.cramfs
|