From: Karel Zak Date: Mon, 25 Nov 2019 11:49:48 +0000 (+0100) Subject: bash-completion: update for new script tools X-Git-Tag: v2.35-rc1~41 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=0faa7eda0453464991169c394c01554dba8a948d;p=thirdparty%2Futil-linux.git bash-completion: update for new script tools Signed-off-by: Karel Zak --- diff --git a/bash-completion/Makemodule.am b/bash-completion/Makemodule.am index 61f298a721..a1f8bd16f9 100644 --- a/bash-completion/Makemodule.am +++ b/bash-completion/Makemodule.am @@ -90,6 +90,9 @@ endif if BUILD_SCRIPTREPLAY dist_bashcompletion_DATA += bash-completion/scriptreplay endif +if BUILD_SCRIPTLIVE +dist_bashcompletion_DATA += bash-completion/scriptlive +endif if BUILD_SETSID dist_bashcompletion_DATA += bash-completion/setsid endif diff --git a/bash-completion/script b/bash-completion/script index ef8afc69e1..d6add99351 100644 --- a/bash-completion/script +++ b/bash-completion/script @@ -25,6 +25,12 @@ _script_module() -*) OPTS="--append --command + --echo + --log-in + --log-out + --log-io + --log-timing + --logging-format --return --flush --force diff --git a/bash-completion/scriptlive b/bash-completion/scriptlive new file mode 100644 index 0000000000..1dd0a63650 --- /dev/null +++ b/bash-completion/scriptlive @@ -0,0 +1,36 @@ +_scriptlive_module() +{ + local cur prev OPTS + COMPREPLY=() + cur="${COMP_WORDS[COMP_CWORD]}" + prev="${COMP_WORDS[COMP_CWORD-1]}" + case $prev in + '-d'|'--divisor'|'-m'|'--maxdelay') + COMPREPLY=( $(compgen -W "digit" -- $cur) ) + return 0 + ;; + '-h'|'--help'|'-V'|'--version') + return 0 + ;; + esac + case $cur in + -*) + OPTS="--timing + --log-in + --log-io + --log-timing + --command + --divisor + --maxdelay + --version + --help" + COMPREPLY=( $(compgen -W "${OPTS[*]}" -- $cur) ) + return 0 + ;; + esac + local IFS=$'\n' + compopt -o filenames + COMPREPLY=( $(compgen -f -- $cur) ) + return 0 +} +complete -F _scriptlive_module scriptlive diff --git a/bash-completion/scriptreplay b/bash-completion/scriptreplay index 9e1a790230..6c1ed4ca00 100644 --- a/bash-completion/scriptreplay +++ b/bash-completion/scriptreplay @@ -16,6 +16,13 @@ _scriptreplay_module() case $cur in -*) OPTS="--timing + --log-in + --log-out + --log-io + --log-timing + --summary + --stream + --cr-mode --typescript --divisor --maxdelay