]> git.ipfire.org Git - thirdparty/util-linux.git/commitdiff
bash-completion: update uuidgen, wipefs, tunelp, setpriv, and hwclock
authorSami Kerola <kerolasa@iki.fi>
Sun, 17 Sep 2017 18:49:02 +0000 (19:49 +0100)
committerKarel Zak <kzak@redhat.com>
Mon, 18 Sep 2017 09:04:52 +0000 (11:04 +0200)
uuidgen: Add hash-based UUIDs to bash-completion.  These were added in
commit c6f1ec68a8b38863efff2a18e30b7272db4fb273.

wipefs: Command started to use libsmartcols, and it got some new options.
Commit d9921b2a128f17aa9a9a110444d5faa43e1b371c.

rename: New option was added in commit fabb90676af89bcb5f429793746f141c0.

tunelp: The --trust-irq was removed it being years broken.  Commit
d52eb4bd9062081c8420b22c029c694f29d036c7.

setpriv: Add --ambient-caps option from commit 0c92194eeee9c1fd58580ef852.
In same go fix 'bash set -u' issue, that is the same as mentioned commit
abbcec4fc9c8d7fb835b4eafd1bc9d82acbf0056.

hwclock: For some reason --get has always been missing from this file.

Signed-off-by: Sami Kerola <kerolasa@iki.fi>
bash-completion/hwclock
bash-completion/rename
bash-completion/setpriv
bash-completion/tunelp
bash-completion/uuidgen
bash-completion/wipefs

index b90f00c0cc5ccca72482114d20ab5508626e0149..4bd87e42ea9f3eccce3c8ecf2c9eb4bd94b518d3 100644 (file)
@@ -27,6 +27,7 @@ _hwclock_module()
                -*)
                        OPTS="--help
                                --show
+                               --get
                                --set
                                --hctosys
                                --systohc
index 06a7dcd4d55303447a7cd47d471d04c3ee026455..143121976a43cf4ee71ff9994831042844a0d500 100644 (file)
@@ -11,7 +11,7 @@ _rename_module()
        esac
        case $cur in
                -*)
-                       OPTS="--verbose --symlink --help --version --no-act"
+                       OPTS="--verbose --symlink --help --version --no-act --no-override"
                        COMPREPLY=( $(compgen -W "${OPTS[*]}" -- $cur) )
                        return 0
                        ;;
index bdd3b7dabe2fab1ad09df67e66871d7e3c86e0e0..8ab9e072251bc1bf50afb50c84f6b4d5aad9924d 100644 (file)
@@ -5,14 +5,14 @@ _setpriv_module()
        cur="${COMP_WORDS[COMP_CWORD]}"
        prev="${COMP_WORDS[COMP_CWORD-1]}"
        case $prev in
-               '--inh-caps'|'--bounding-set')
+               '--ambient-caps'|'--inh-caps'|'--bounding-set')
                        local prefix realcur INHERIT_ALL INHERIT
                        realcur="${cur##*,}"
                        prefix="${cur%$realcur}"
                        INHERIT_ALL=$($1 --list-caps| awk '{print $1, "-" $1}')
                        for WORD in $INHERIT_ALL; do
                                if ! [[ $prefix == *"$WORD"* ]]; then
-                                       INHERIT="$WORD $INHERIT"
+                                       INHERIT="$WORD ${INHERIT:-""}"
                                fi
                        done
                        compopt -o nospace
@@ -70,6 +70,7 @@ _setpriv_module()
                -*)
                        OPTS="--dump
                                --no-new-privs
+                               --ambient-caps
                                --inh-caps
                                --bounding-set
                                --ruid
index bd2cce2aa2705d056c5b4772c7e6036d4ede2347..2be3d544dade6f6410d38863d93c90ad939f5b09 100644 (file)
@@ -17,7 +17,7 @@ _tunelp_module()
                        COMPREPLY=( $(compgen -W "microseconds" -- $cur) )
                        return 0
                        ;;
-               '-a'|'--abort'|'-o'|'--check-status'|'-C'|'--careful'|'-T'|'--trust-irq'|'-q'|'--print-irq')
+               '-a'|'--abort'|'-o'|'--check-status'|'-C'|'--careful'|'-q'|'--print-irq')
                        COMPREPLY=( $(compgen -W "off on" -- $cur) )
                        return 0
                        ;;
@@ -35,7 +35,6 @@ _tunelp_module()
                                --check-status
                                --careful
                                --status
-                               --trust-irq
                                --reset
                                --print-irq
                                --help
index 42d95d42ff15a1050cf7fb6463f0e6d47644e54a..8e64015c07a98f34dc281429b5807d1d8e6b5eb6 100644 (file)
@@ -5,13 +5,31 @@ _uuidgen_module()
        cur="${COMP_WORDS[COMP_CWORD]}"
        prev="${COMP_WORDS[COMP_CWORD-1]}"
        case $prev in
+               '-n'|'--namespace')
+                       COMPREPLY=( $(compgen -W "@dns @url @oid @x500 @x.500" -- "$cur") )
+                       return 0
+                       ;;
+               '-N'|'--name')
+                       COMPREPLY=( $(compgen -W "name" -- "$cur") )
+                       return 0
+                       ;;
                '-h'|'--help'|'-V'|'--version')
                        return 0
                        ;;
        esac
        case $cur in
                -*)
-                       OPTS="--random --time --version --help"
+                       OPTS="
+                               --random
+                               --time
+                               --namespace
+                               --name
+                               --md5
+                               --sha1
+                               --hex
+                               --help
+                               --version
+                       "
                        COMPREPLY=( $(compgen -W "${OPTS[*]}" -- $cur) )
                        return 0
                        ;;
index 577819182038150fa51664a8af9884c1f94eb78b..13568ca325cc3647159b5ede7fc3ae1679a199ec 100644 (file)
@@ -5,6 +5,20 @@ _wipefs_module()
        cur="${COMP_WORDS[COMP_CWORD]}"
        prev="${COMP_WORDS[COMP_CWORD-1]}"
        case $prev in
+               '-O'|'--output')
+                       local prefix realcur OUTPUT_ALL OUTPUT
+                       realcur="${cur##*,}"
+                       prefix="${cur%$realcur}"
+                       OUTPUT_ALL="UUID LABEL LENGTH TYPE OFFSET USAGE DEVICE"
+                       for WORD in $OUTPUT_ALL; do
+                               if ! [[ $prefix == *"$WORD"* ]]; then
+                                       OUTPUT="$WORD ${OUTPUT:-""}"
+                               fi
+                       done
+                       compopt -o nospace
+                       COMPREPLY=( $(compgen -P "$prefix" -W "$OUTPUT" -S ',' -- $realcur) )
+                       return 0
+                       ;;
                '-o'|'--offset')
                        COMPREPLY=( $(compgen -W "offset" -- $cur) )
                        return 0
@@ -25,12 +39,15 @@ _wipefs_module()
                                --all
                                --backup
                                --force
-                               --help
+                               --noheadings
+                               --json
                                --no-act
                                --offset
+                               --output
                                --parsable
                                --quiet
                                --types
+                               --help
                                --version
                        "
                        COMPREPLY=( $(compgen -W "${OPTS[*]}" -- $cur) )