From: Sami Kerola <kerolasa@iki.fi>
To: util-linux@vger.kernel.org
Cc: Sami Kerola <kerolasa@iki.fi>
Subject: [PATCH 3/3] bash-completion: update uuidgen, wipefs, tunelp, setpriv, and hwclock
Date: Sun, 17 Sep 2017 19:49:02 +0100 [thread overview]
Message-ID: <20170917184902.1218-3-kerolasa@iki.fi> (raw)
In-Reply-To: <20170917184902.1218-1-kerolasa@iki.fi>
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 | 1 +
bash-completion/rename | 2 +-
bash-completion/setpriv | 5 +++--
bash-completion/tunelp | 3 +--
bash-completion/uuidgen | 20 +++++++++++++++++++-
bash-completion/wipefs | 19 ++++++++++++++++++-
6 files changed, 43 insertions(+), 7 deletions(-)
diff --git a/bash-completion/hwclock b/bash-completion/hwclock
index b90f00c0c..4bd87e42e 100644
--- a/bash-completion/hwclock
+++ b/bash-completion/hwclock
@@ -27,6 +27,7 @@ _hwclock_module()
-*)
OPTS="--help
--show
+ --get
--set
--hctosys
--systohc
diff --git a/bash-completion/rename b/bash-completion/rename
index 06a7dcd4d..143121976 100644
--- a/bash-completion/rename
+++ b/bash-completion/rename
@@ -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
;;
diff --git a/bash-completion/setpriv b/bash-completion/setpriv
index bdd3b7dab..8ab9e0722 100644
--- a/bash-completion/setpriv
+++ b/bash-completion/setpriv
@@ -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
diff --git a/bash-completion/tunelp b/bash-completion/tunelp
index bd2cce2aa..2be3d544d 100644
--- a/bash-completion/tunelp
+++ b/bash-completion/tunelp
@@ -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
diff --git a/bash-completion/uuidgen b/bash-completion/uuidgen
index 42d95d42f..8e64015c0 100644
--- a/bash-completion/uuidgen
+++ b/bash-completion/uuidgen
@@ -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
;;
diff --git a/bash-completion/wipefs b/bash-completion/wipefs
index 577819182..13568ca32 100644
--- a/bash-completion/wipefs
+++ b/bash-completion/wipefs
@@ -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) )
--
2.14.1
next prev parent reply other threads:[~2017-09-17 18:49 UTC|newest]
Thread overview: 8+ messages / expand[flat|nested] mbox.gz Atom feed top
2017-09-17 18:49 [PATCH 1/3] docs: remove repeated word from mount(8) man page Sami Kerola
2017-09-17 18:49 ` [PATCH 2/3] tools: update git-version-gen from gnulib Sami Kerola
2017-09-18 9:07 ` Karel Zak
2017-09-18 13:36 ` Rüdiger Meier
2017-09-20 11:56 ` Sami Kerola
2017-09-17 18:49 ` Sami Kerola [this message]
2017-09-18 9:08 ` [PATCH 3/3] bash-completion: update uuidgen, wipefs, tunelp, setpriv, and hwclock Karel Zak
2017-09-18 9:05 ` [PATCH 1/3] docs: remove repeated word from mount(8) man page Karel Zak
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20170917184902.1218-3-kerolasa@iki.fi \
--to=kerolasa@iki.fi \
--cc=util-linux@vger.kernel.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).