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>
56 lines
918 B
Text
56 lines
918 B
Text
_hwclock_module()
|
|
{
|
|
local cur prev OPTS
|
|
COMPREPLY=()
|
|
cur="${COMP_WORDS[COMP_CWORD]}"
|
|
prev="${COMP_WORDS[COMP_CWORD-1]}"
|
|
case $prev in
|
|
'-f'|'--rtc'|'--adjfile')
|
|
compopt -o filenames
|
|
COMPREPLY=( $(compgen -f -- $cur) )
|
|
return 0
|
|
;;
|
|
'--date')
|
|
COMPREPLY=( $(compgen -W "date" -- $cur) )
|
|
return 0
|
|
;;
|
|
'--epoch')
|
|
COMPREPLY=( $(compgen -W "year" -- $cur) )
|
|
return 0
|
|
;;
|
|
'-h'|'-?'|'--help'|'-v'|'-V'|'--version')
|
|
return 0
|
|
;;
|
|
esac
|
|
case $cur in
|
|
-*)
|
|
OPTS="--help
|
|
--show
|
|
--set
|
|
--hctosys
|
|
--systohc
|
|
--systz
|
|
--adjust
|
|
--compare
|
|
--getepoch
|
|
--setepoch
|
|
--predict
|
|
--version
|
|
--utc
|
|
--localtime
|
|
--rtc
|
|
--directisa
|
|
--badyear
|
|
--date
|
|
--epoch
|
|
--noadjfile
|
|
--adjfile
|
|
--test
|
|
--debug"
|
|
COMPREPLY=( $(compgen -W "${OPTS[*]}" -- $cur) )
|
|
return 0
|
|
;;
|
|
esac
|
|
return 0
|
|
}
|
|
complete -F _hwclock_module hwclock
|