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