bash-completion: update uuidgen, wipefs, tunelp, setpriv, and hwclock
uuidgen: Add hash-based UUIDs to bash-completion. These were added in commitc6f1ec68a8
. wipefs: Command started to use libsmartcols, and it got some new options. Commitd9921b2a12
. rename: New option was added in commitfabb90676a
. tunelp: The --trust-irq was removed it being years broken. Commitd52eb4bd90
. setpriv: Add --ambient-caps option from commit0c92194eee
. In same go fix 'bash set -u' issue, that is the same as mentioned commitabbcec4fc9
. hwclock: For some reason --get has always been missing from this file. Signed-off-by: Sami Kerola <kerolasa@iki.fi>
This commit is contained in:
parent
6627bc79e4
commit
37a6cc7a14
|
@ -27,6 +27,7 @@ _hwclock_module()
|
|||
-*)
|
||||
OPTS="--help
|
||||
--show
|
||||
--get
|
||||
--set
|
||||
--hctosys
|
||||
--systohc
|
||||
|
|
|
@ -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
|
||||
;;
|
||||
|
|
|
@ -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
|
||||
|
|
|
@ -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
|
||||
|
|
|
@ -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
|
||||
;;
|
||||
|
|
|
@ -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) )
|
||||
|
|
Loading…
Reference in New Issue