]> git.ipfire.org Git - thirdparty/util-linux.git/commitdiff
bash-completion: update for new script tools
authorKarel Zak <kzak@redhat.com>
Mon, 25 Nov 2019 11:49:48 +0000 (12:49 +0100)
committerKarel Zak <kzak@redhat.com>
Mon, 25 Nov 2019 11:49:48 +0000 (12:49 +0100)
Signed-off-by: Karel Zak <kzak@redhat.com>
bash-completion/Makemodule.am
bash-completion/script
bash-completion/scriptlive [new file with mode: 0644]
bash-completion/scriptreplay

index 61f298a721ff14ee9aedf5e3d82691b92386443f..a1f8bd16f9cae1a492edb8a322cfcebf742b65cf 100644 (file)
@@ -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
index ef8afc69e1890424ad6284500627142ebd680c9f..d6add993514cab585a963fe353ae34018100c4be 100644 (file)
@@ -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 (file)
index 0000000..1dd0a63
--- /dev/null
@@ -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
index 9e1a790230f1af601d64ffa86d14c0a6ec64a0a1..6c1ed4ca008614db8238d4e2fdb9e46e1e0a9b8f 100644 (file)
@@ -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