* [PATCH 0/4] pull: couple bash-completion fixes
@ 2018-04-05 19:56 Sami Kerola
2018-04-05 19:56 ` [PATCH 1/4] bash-completion: fix few bash set -u issues Sami Kerola
` (4 more replies)
0 siblings, 5 replies; 6+ messages in thread
From: Sami Kerola @ 2018-04-05 19:56 UTC (permalink / raw)
To: util-linux; +Cc: Sami Kerola
Hello Karel and other,
It would have been better to get these in before relese v2.32 got out, so
sorry for missing that. I'm sure these fairly trivial corrections are
welcome to be part of the next releaese, so perhaps missing one is not great
misfortune at the end.
----------------------------------------------------------------
The following changes since commit 6963338ca586bef3370e189f13785b4b6b63bbdb:
dmesg: fix raw output (2018-04-05 15:59:59 +0200)
are available in the Git repository at:
git://github.com/kerolasa/lelux-utiliteetit.git bash-comp
for you to fetch changes up to 1ea4305b1c541333a2c9e4434dc7c3ca05cf188d:
bash-completion: fix typo in blockdev file (2018-04-05 20:49:27 +0100)
----------------------------------------------------------------
Sami Kerola (4):
bash-completion: fix few bash set -u issues
bash-completion: do not print eject --cdspeed error messages
bash-completion: setpriv --securebits argument can be comma separated list
bash-completion: fix typo in blockdev file
bash-completion/blockdev | 2 +-
bash-completion/chcpu | 4 ++--
bash-completion/eject | 2 +-
bash-completion/lsblk | 10 +++++-----
bash-completion/lscpu | 2 +-
bash-completion/lslogins | 2 +-
bash-completion/lsns | 2 +-
bash-completion/mount | 2 +-
bash-completion/setpriv | 23 ++++++++++++++++++-----
bash-completion/taskset | 2 +-
10 files changed, 32 insertions(+), 19 deletions(-)
--
2.17.0
^ permalink raw reply [flat|nested] 6+ messages in thread
* [PATCH 1/4] bash-completion: fix few bash set -u issues
2018-04-05 19:56 [PATCH 0/4] pull: couple bash-completion fixes Sami Kerola
@ 2018-04-05 19:56 ` Sami Kerola
2018-04-05 19:56 ` [PATCH 2/4] bash-completion: do not print eject --cdspeed error messages Sami Kerola
` (3 subsequent siblings)
4 siblings, 0 replies; 6+ messages in thread
From: Sami Kerola @ 2018-04-05 19:56 UTC (permalink / raw)
To: util-linux; +Cc: Sami Kerola
This is the same fix as in reference commit, and the same reason. Just
correct few files missed earlier.
Reference: abbcec4fc9c8d7fb835b4eafd1bc9d82acbf0056
Signed-off-by: Sami Kerola <kerolasa@iki.fi>
---
bash-completion/chcpu | 4 ++--
bash-completion/lsblk | 10 +++++-----
bash-completion/lscpu | 2 +-
bash-completion/lslogins | 2 +-
bash-completion/lsns | 2 +-
bash-completion/mount | 2 +-
bash-completion/setpriv | 2 +-
bash-completion/taskset | 2 +-
8 files changed, 13 insertions(+), 13 deletions(-)
diff --git a/bash-completion/chcpu b/bash-completion/chcpu
index 33991f4a8..0d96c2532 100644
--- a/bash-completion/chcpu
+++ b/bash-completion/chcpu
@@ -12,7 +12,7 @@ _chcpu_module()
CPULIST_ALL=$(sed 's/^/{/; s/-/../g; s/,/} {/g; s/$/}/' /sys/devices/system/cpu/offline)
for WORD in $(eval echo $CPULIST_ALL); do
if ! [[ $prefix == *"$WORD"* ]]; then
- CPULIST="$WORD $CPULIST"
+ CPULIST="$WORD ${CPULIST:-""}"
fi
done
compopt -o nospace
@@ -26,7 +26,7 @@ _chcpu_module()
CPULIST_ALL=$(sed 's/^/{/; s/-/../g; s/,/} {/g; s/$/}/' /sys/devices/system/cpu/online)
for WORD in $(eval echo $CPULIST_ALL); do
if ! [[ $prefix == *"$WORD"* ]]; then
- CPULIST="$WORD $CPULIST"
+ CPULIST="$WORD ${CPULIST:-""}"
fi
done
compopt -o nospace
diff --git a/bash-completion/lsblk b/bash-completion/lsblk
index 4fef8fc84..bd86f9f79 100644
--- a/bash-completion/lsblk
+++ b/bash-completion/lsblk
@@ -20,15 +20,15 @@ _lsblk_module()
prefix="${cur%$realcur}"
for I in /sys/dev/block/*; do
J=${I##*/}
- MAJOR_ALL="$MAJOR_ALL ${J%%:*}"
+ MAJOR_ALL="${MAJOR_ALL:-""} ${J%%:*}"
done
- for WORD in $MAJOR_ALL; do
+ for WORD in ${MAJOR_ALL:-""}; do
if ! [[ $prefix == *"$WORD"* ]]; then
- MAJOR="$WORD $MAJOR"
+ MAJOR="$WORD ${MAJOR:-""}"
fi
done
compopt -o nospace
- COMPREPLY=( $(compgen -P "$prefix" -W "$MAJOR" -S ',' -- $realcur) )
+ COMPREPLY=( $(compgen -P "$prefix" -W "${MAJOR:-""}" -S ',' -- $realcur) )
return 0
;;
'-o'|'--output')
@@ -37,7 +37,7 @@ _lsblk_module()
prefix="${cur%$realcur}"
for WORD in $LSBLK_COLS_ALL; do
if ! [[ $prefix == *"$WORD"* ]]; then
- LSBLK_COLS="$WORD $LSBLK_COLS"
+ LSBLK_COLS="$WORD ${LSBLK_COLS:-""}"
fi
done
compopt -o nospace
diff --git a/bash-completion/lscpu b/bash-completion/lscpu
index d16af350f..69337acef 100644
--- a/bash-completion/lscpu
+++ b/bash-completion/lscpu
@@ -15,7 +15,7 @@ _lscpu_module()
CONFIGURED ONLINE MAXMHZ MINMHZ"
for WORD in $OPTS_ALL; do
if ! [[ $prefix == *"$WORD"* ]]; then
- OPTS="$WORD $OPTS"
+ OPTS="$WORD ${OPTS:-""}"
fi
done
compopt -o nospace
diff --git a/bash-completion/lslogins b/bash-completion/lslogins
index 967b644ca..795b5d848 100755
--- a/bash-completion/lslogins
+++ b/bash-completion/lslogins
@@ -35,7 +35,7 @@ _lslogins_module()
prefix="${cur%$realcur}"
for WORD in $LSLOGINS_COLS_ALL; do
if ! [[ $prefix == *"$WORD"* ]]; then
- LSLOGINS_COLS="$WORD $LSLOGINS_COLS"
+ LSLOGINS_COLS="$WORD ${LSLOGINS_COLS:-""}"
fi
done
compopt -o nospace
diff --git a/bash-completion/lsns b/bash-completion/lsns
index 8cf0a31f9..035f43b2a 100644
--- a/bash-completion/lsns
+++ b/bash-completion/lsns
@@ -14,7 +14,7 @@ _lsns_module()
prefix="${cur%$realcur}"
for WORD in $LSNS_COLS_ALL; do
if ! [[ $prefix == *"$WORD"* ]]; then
- LSNS_COLS="$WORD $LSNS_COLS"
+ LSNS_COLS="$WORD ${LSNS_COLS:-""}"
fi
done
compopt -o nospace
diff --git a/bash-completion/mount b/bash-completion/mount
index 9a3391339..c7e4bead6 100644
--- a/bash-completion/mount
+++ b/bash-completion/mount
@@ -15,7 +15,7 @@ _mount_module()
prefix="${cur%$realcur}"
for WORD in $TYPES; do
if ! [[ $prefix == *"$WORD"* ]]; then
- TYPE_COLS="$WORD $TYPE_COLS"
+ TYPE_COLS="$WORD ${TYPE_COLS:-""}"
fi
done
compopt -o nospace
diff --git a/bash-completion/setpriv b/bash-completion/setpriv
index 8ab9e0722..bf4737a3a 100644
--- a/bash-completion/setpriv
+++ b/bash-completion/setpriv
@@ -38,7 +38,7 @@ _setpriv_module()
GIDS_ALL=$(getent group | awk -F: '{print $3}')
for WORD in $GIDS_ALL; do
if ! [[ $prefix == *"$WORD"* ]]; then
- GIDS="$WORD $GIDS"
+ GIDS="$WORD ${GIDS:-""}"
fi
done
compopt -o nospace
diff --git a/bash-completion/taskset b/bash-completion/taskset
index 453b17b4a..7c9a7bd54 100644
--- a/bash-completion/taskset
+++ b/bash-completion/taskset
@@ -12,7 +12,7 @@ _taskset_module()
CPULIST_ALL=$(sed 's/^/{/; s/-/../g; s/,/} {/g; s/$/}/' /sys/devices/system/cpu/online)
for WORD in $(eval echo $CPULIST_ALL); do
if ! [[ $prefix == *"$WORD"* ]]; then
- CPULIST="$WORD $CPULIST"
+ CPULIST="$WORD ${CPULIST:-""}"
fi
done
compopt -o nospace
--
2.17.0
^ permalink raw reply related [flat|nested] 6+ messages in thread
* [PATCH 2/4] bash-completion: do not print eject --cdspeed error messages
2018-04-05 19:56 [PATCH 0/4] pull: couple bash-completion fixes Sami Kerola
2018-04-05 19:56 ` [PATCH 1/4] bash-completion: fix few bash set -u issues Sami Kerola
@ 2018-04-05 19:56 ` Sami Kerola
2018-04-05 19:56 ` [PATCH 3/4] bash-completion: setpriv --securebits argument can be comma separated list Sami Kerola
` (2 subsequent siblings)
4 siblings, 0 replies; 6+ messages in thread
From: Sami Kerola @ 2018-04-05 19:56 UTC (permalink / raw)
To: util-linux; +Cc: Sami Kerola
Bash completion is proposing --cdspeed option argument from 'eject
--listspeed /dev/cdrom' output. Nowadays it is common not to have such
device, and this results to an unwanted error message to stderr merely
messing up command line. Lets stop that.
Signed-off-by: Sami Kerola <kerolasa@iki.fi>
---
bash-completion/eject | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/bash-completion/eject b/bash-completion/eject
index 123829ea2..327ef1b71 100644
--- a/bash-completion/eject
+++ b/bash-completion/eject
@@ -15,7 +15,7 @@ _eject_module()
return 0
;;
'-x'|'--cdspeed')
- COMPREPLY=( $(compgen -W "$($1 -X)" -- $cur) )
+ COMPREPLY=( $(compgen -W "$(eject --listspeed 2>/dev/null)" -- $cur) )
return 0
;;
'-h'|'--help'|'-V'|'--version')
--
2.17.0
^ permalink raw reply related [flat|nested] 6+ messages in thread
* [PATCH 3/4] bash-completion: setpriv --securebits argument can be comma separated list
2018-04-05 19:56 [PATCH 0/4] pull: couple bash-completion fixes Sami Kerola
2018-04-05 19:56 ` [PATCH 1/4] bash-completion: fix few bash set -u issues Sami Kerola
2018-04-05 19:56 ` [PATCH 2/4] bash-completion: do not print eject --cdspeed error messages Sami Kerola
@ 2018-04-05 19:56 ` Sami Kerola
2018-04-05 19:56 ` [PATCH 4/4] bash-completion: fix typo in blockdev file Sami Kerola
2018-04-06 11:04 ` [PATCH 0/4] pull: couple bash-completion fixes Karel Zak
4 siblings, 0 replies; 6+ messages in thread
From: Sami Kerola @ 2018-04-05 19:56 UTC (permalink / raw)
To: util-linux; +Cc: Sami Kerola
Make the option argument suggestion to match with what is allowed. In same
go tidy shell code a little bit.
Signed-off-by: Sami Kerola <kerolasa@iki.fi>
---
bash-completion/setpriv | 21 +++++++++++++++++----
1 file changed, 17 insertions(+), 4 deletions(-)
diff --git a/bash-completion/setpriv b/bash-completion/setpriv
index bf4737a3a..1c67f8288 100644
--- a/bash-completion/setpriv
+++ b/bash-completion/setpriv
@@ -46,10 +46,23 @@ _setpriv_module()
return 0
;;
'--securebits')
- local SBITS
- SBITS="noroot noroot_locked no_setuid_fixup no_setuid_fixup_locked keep_caps_locked
- -noroot -noroot_locked -no_setuid_fixup -no_setuid_fixup_locked -keep_caps_locked"
- COMPREPLY=( $(compgen -W "$SBITS" -- $cur) )
+ local prefix realcur SBITS_ALL SBITS WORD
+ realcur="${cur##*,}"
+ prefix="${cur%$realcur}"
+ SBITS_ALL="
+ {+,-}keep_caps_locked
+ {+,-}noroot
+ {+,-}noroot_locked
+ {+,-}no_setuid_fixup
+ {+,-}no_setuid_fixup_locked
+ "
+ for WORD in $SBITS_ALL; do
+ if ! [[ $prefix == *"$WORD"* ]]; then
+ SBITS="$WORD ${SBITS:-""}"
+ fi
+ done
+ compopt -o nospace
+ COMPREPLY=( $(compgen -P "$prefix" -W "$SBITS" -S ',' -- $realcur) )
return 0
;;
'--selinux-label')
--
2.17.0
^ permalink raw reply related [flat|nested] 6+ messages in thread
* [PATCH 4/4] bash-completion: fix typo in blockdev file
2018-04-05 19:56 [PATCH 0/4] pull: couple bash-completion fixes Sami Kerola
` (2 preceding siblings ...)
2018-04-05 19:56 ` [PATCH 3/4] bash-completion: setpriv --securebits argument can be comma separated list Sami Kerola
@ 2018-04-05 19:56 ` Sami Kerola
2018-04-06 11:04 ` [PATCH 0/4] pull: couple bash-completion fixes Karel Zak
4 siblings, 0 replies; 6+ messages in thread
From: Sami Kerola @ 2018-04-05 19:56 UTC (permalink / raw)
To: util-linux; +Cc: Sami Kerola
Signed-off-by: Sami Kerola <kerolasa@iki.fi>
---
bash-completion/blockdev | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/bash-completion/blockdev b/bash-completion/blockdev
index 8050c0f83..e7aca26de 100644
--- a/bash-completion/blockdev
+++ b/bash-completion/blockdev
@@ -33,7 +33,7 @@ _blockdev_module()
COMPREPLY=( $(compgen -W "bytes" -- $cur) )
return 0
;;
- '--setbsz'|'--setfra')
+ '--setra'|'--setfra')
COMPREPLY=( $(compgen -W "sectors" -- $cur) )
return 0
;;
--
2.17.0
^ permalink raw reply related [flat|nested] 6+ messages in thread
* Re: [PATCH 0/4] pull: couple bash-completion fixes
2018-04-05 19:56 [PATCH 0/4] pull: couple bash-completion fixes Sami Kerola
` (3 preceding siblings ...)
2018-04-05 19:56 ` [PATCH 4/4] bash-completion: fix typo in blockdev file Sami Kerola
@ 2018-04-06 11:04 ` Karel Zak
4 siblings, 0 replies; 6+ messages in thread
From: Karel Zak @ 2018-04-06 11:04 UTC (permalink / raw)
To: Sami Kerola; +Cc: util-linux
On Thu, Apr 05, 2018 at 08:56:52PM +0100, Sami Kerola wrote:
> bash-completion/blockdev | 2 +-
> bash-completion/chcpu | 4 ++--
> bash-completion/eject | 2 +-
> bash-completion/lsblk | 10 +++++-----
> bash-completion/lscpu | 2 +-
> bash-completion/lslogins | 2 +-
> bash-completion/lsns | 2 +-
> bash-completion/mount | 2 +-
> bash-completion/setpriv | 23 ++++++++++++++++++-----
> bash-completion/taskset | 2 +-
> 10 files changed, 32 insertions(+), 19 deletions(-)
Applied, thanks.
--
Karel Zak <kzak@redhat.com>
http://karelzak.blogspot.com
^ permalink raw reply [flat|nested] 6+ messages in thread
end of thread, other threads:[~2018-04-06 11:04 UTC | newest]
Thread overview: 6+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2018-04-05 19:56 [PATCH 0/4] pull: couple bash-completion fixes Sami Kerola
2018-04-05 19:56 ` [PATCH 1/4] bash-completion: fix few bash set -u issues Sami Kerola
2018-04-05 19:56 ` [PATCH 2/4] bash-completion: do not print eject --cdspeed error messages Sami Kerola
2018-04-05 19:56 ` [PATCH 3/4] bash-completion: setpriv --securebits argument can be comma separated list Sami Kerola
2018-04-05 19:56 ` [PATCH 4/4] bash-completion: fix typo in blockdev file Sami Kerola
2018-04-06 11:04 ` [PATCH 0/4] pull: couple bash-completion fixes Karel Zak
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).