Earlier completion suggested only options for the command, this changes
options to be proposed when first character of an argument is dash.
Signed-off-by: Sami Kerola <kerolasa@iki.fi>
return 0
;;
esac
- OPTS='--verbose --destination --help --version file'
- COMPREPLY=( $(compgen -W "${OPTS[*]}" -S ' ' -- $cur) )
+ case $cur in
+ -*)
+ COMPREPLY=( $(compgen -W "--verbose --blocksize --extract --help --version" -- $cur) )
+ return 0
+ ;;
+ esac
+ local IFS=$'\n'
+ compopt -o filenames
+ COMPREPLY=( $(compgen -f -- $cur) )
return 0
}
complete -F _fsck.cramfs_module fsck.cramfs
return 0
;;
esac
- OPTS='--divisor --sectors --help --version'
- COMPREPLY=( $(compgen -W "${OPTS[*]}" -- $cur) )
+ case $cur in
+ -*)
+ COMPREPLY=( $(compgen -W "--divisor --sectors --help --version" -- $cur) )
+ return 0
+ ;;
+ esac
+ local IFS=$'\n'
+ compopt -o filenames
+ COMPREPLY=( $(compgen -f -- $cur) )
return 0
}
complete -F _isosize_module isosize