2013-03-25 16:37:36 -05:00
|
|
|
_script_module()
|
|
|
|
{
|
|
|
|
local cur prev OPTS
|
|
|
|
COMPREPLY=()
|
|
|
|
cur="${COMP_WORDS[COMP_CWORD]}"
|
|
|
|
prev="${COMP_WORDS[COMP_CWORD-1]}"
|
|
|
|
case $prev in
|
|
|
|
'-c'|'--command')
|
|
|
|
compopt -o bashdefault
|
|
|
|
COMPREPLY=( $(compgen -c -- $cur) )
|
|
|
|
return 0
|
|
|
|
;;
|
2019-12-11 13:19:21 -06:00
|
|
|
'-E'|'--echo')
|
|
|
|
COMPREPLY=( $(compgen -W "auto always never" -- $cur) )
|
|
|
|
return 0
|
|
|
|
;;
|
2018-10-04 15:36:22 -05:00
|
|
|
'-o'|'--output-limit')
|
|
|
|
COMPREPLY=( $(compgen -W "size" -- $cur) )
|
|
|
|
return 0
|
|
|
|
;;
|
2019-12-11 13:19:21 -06:00
|
|
|
'-m'|'--logging-format')
|
|
|
|
COMPREPLY=( $(compgen -W "classic advanced" -- $cur) )
|
|
|
|
return 0
|
|
|
|
;;
|
2013-04-07 03:12:04 -05:00
|
|
|
'-h'|'--help'|'-V'|'--version')
|
|
|
|
return 0
|
|
|
|
;;
|
2013-03-25 16:37:36 -05:00
|
|
|
esac
|
|
|
|
case $cur in
|
|
|
|
'=')
|
|
|
|
cur=${cur#=}
|
|
|
|
;;
|
|
|
|
-*)
|
2013-04-07 03:12:08 -05:00
|
|
|
OPTS="--append
|
|
|
|
--command
|
2019-11-25 05:49:48 -06:00
|
|
|
--echo
|
|
|
|
--log-in
|
|
|
|
--log-out
|
|
|
|
--log-io
|
|
|
|
--log-timing
|
|
|
|
--logging-format
|
2013-04-07 03:12:08 -05:00
|
|
|
--return
|
|
|
|
--flush
|
|
|
|
--force
|
|
|
|
--quiet
|
2018-05-14 04:20:06 -05:00
|
|
|
--output-limit
|
2013-04-07 03:12:08 -05:00
|
|
|
--timing=
|
|
|
|
--version
|
|
|
|
--help"
|
2013-03-25 16:37:36 -05:00
|
|
|
COMPREPLY=( $(compgen -W "${OPTS[*]}" -- $cur) )
|
|
|
|
return 0
|
|
|
|
;;
|
|
|
|
esac
|
2013-09-30 08:49:00 -05:00
|
|
|
local IFS=$'\n'
|
2013-03-25 16:37:36 -05:00
|
|
|
compopt -o filenames
|
|
|
|
COMPREPLY=( $(compgen -f -- $cur) )
|
|
|
|
return 0
|
|
|
|
}
|
|
|
|
complete -F _script_module script
|