bash-completion: update misc-utils

fincore:

	Add RES column to --output completions.

	Commit: e4e8b57be2

findfs:

	Commit: 940817b736

logger:

	Add --socket-errors [1] and --tcp [2] options.

	Commit [1]: d77dc29e6e
	Commit [2]: 68265d070d

lsblk:

	Add HOTPLUG [1], SERIAL [2], and SUBSYSTEMS [3] output fields.  Add
	--json [4], --output-all [5], and --paths [6] options.

	Commit [1]: 483987c275
	Commit [2]: 460c7afb79
	Commit [3]: 7f14ee1b55
	Commit [4]: 4a102a4871
	Commit [5]: 1b4d2a4a4a
	Commit [6]: c7e76cd145

lslocks:

	Add --noinaccessible option.  Remove file argument completion, this
	command does not use that sort of command line input.

	Commit: f29bc6e1cc

mcookie:

	Add --max-size option.

	Commit: f7bac5731b

wipefs:

	Add --backup option.

	Commit: 7e658c15a2

Signed-off-by: Sami Kerola <kerolasa@iki.fi>
This commit is contained in:
Sami Kerola 2017-04-11 11:02:25 +01:00
parent f4e8fd91d6
commit c6b1d511d2
No known key found for this signature in database
GPG Key ID: A9553245FDE9B739
8 changed files with 85 additions and 29 deletions

View File

@ -21,6 +21,9 @@ endif
if BUILD_FINCORE
dist_bashcompletion_DATA += bash-completion/fincore
endif
if BUILD_FINDFS
dist_bashcompletion_DATA += bash-completion/findfs
endif
if BUILD_FINDMNT
dist_bashcompletion_DATA += bash-completion/findmnt
endif

View File

@ -9,7 +9,7 @@ _fincore_module()
local prefix realcur OUTPUT_ALL OUTPUT
realcur="${cur##*,}"
prefix="${cur%$realcur}"
OUTPUT_ALL='PAGES SIZE FILE'
OUTPUT_ALL='PAGES SIZE FILE RES'
for WORD in $OUTPUT_ALL; do
if ! [[ $prefix == *"$WORD"* ]]; then
OUTPUT="$WORD $OUTPUT"

34
bash-completion/findfs Normal file
View File

@ -0,0 +1,34 @@
_findfs_module()
{
local cur prev OPTS findable
COMPREPLY=()
cur="${COMP_WORDS[COMP_CWORD]}"
prev="${COMP_WORDS[COMP_CWORD-1]}"
case $prev in
'-h'|'--help'|'-V'|'--version')
return 0
;;
esac
case $cur in
-*)
OPTS="--version --help"
COMPREPLY=( $(compgen -W "${OPTS[*]}" -- $cur) )
return 0
;;
esac
for i in $(lsblk -rpno label); do
findable+=" LABEL=$i"
done
for i in $(lsblk -rpno uuid); do
findable+=" UUID=$i"
done
for i in $(lsblk -rpno partlabel); do
findable+=" PARTLABEL=$i"
done
for i in $(lsblk -rpno partuuid); do
findable+=" PARTUUID=$i"
done
COMPREPLY=( $(compgen -W "$findable" -- $cur) )
return 0
}
complete -F _findfs_module findfs

View File

@ -31,6 +31,10 @@ _logger_module()
COMPREPLY=( $(compgen -W "$(awk '$NF ~ /^\// {print $NF}' /proc/net/unix)" -- $cur) )
return 0
;;
'--socket-errors')
COMPREPLY=( $(compgen -W "on off auto" -- $cur) )
return 0
;;
'--msgid')
COMPREPLY=( $(compgen -W "msgid" -- $cur) )
return 0
@ -58,8 +62,10 @@ _logger_module()
--size
--skip-empty
--socket
--socket-errors
--stderr
--tag
--tcp
--udp
--version
"

View File

@ -1,18 +1,17 @@
_lsblk_module()
{
local cur prev OPTS
local cur prev OPTS LSBLK_COLS_ALL
COMPREPLY=()
cur="${COMP_WORDS[COMP_CWORD]}"
prev="${COMP_WORDS[COMP_CWORD-1]}"
LSBLK_COLS_ALL="NAME KNAME MAJ:MIN FSTYPE MOUNTPOINT
LABEL UUID PARTTYPE PARTLABEL PARTUUID PARTFLAGS
RA RO RM
MODEL SIZE STATE OWNER GROUP MODE
ALIGNMENT MIN-IO OPT-IO PHY-SEC LOG-SEC
ROTA SCHED RQ-SIZE TYPE DISC-ALN
DISC-GRAN DISC-MAX DISC-ZERO WSAME WWN
RAND PKNAME HCTL TRAN REV VENDOR"
LSBLK_COLS_ALL="
NAME KNAME MAJ:MIN FSTYPE MOUNTPOINT LABEL UUID PARTTYPE
PARTLABEL PARTUUID PARTFLAGS RA RO RM HOTPLUG MODEL SERIAL SIZE
STATE OWNER GROUP MODE ALIGNMENT MIN-IO OPT-IO PHY-SEC LOG-SEC
ROTA SCHED RQ-SIZE TYPE DISC-ALN DISC-GRAN DISC-MAX DISC-ZERO
WSAME WWN RAND PKNAME HCTL TRAN SUBSYSTEMS REV VENDOR
"
case $prev in
'-e'|'--exclude'|'-I'|'--include')
@ -64,11 +63,14 @@ _lsblk_module()
--fs
--help
--include
--json
--ascii
--list
--perms
--noheadings
--output
--output-all
--paths
--pairs
--raw
--inverse

View File

@ -31,23 +31,19 @@ _lslocks_module()
return 0
;;
esac
case $cur in
-*)
OPTS="--pid
--json
--output
--noheadings
--raw
--notruncate
--help
--version"
COMPREPLY=( $(compgen -W "${OPTS[*]}" -- $cur) )
return 0
;;
esac
local IFS=$'\n'
compopt -o filenames
COMPREPLY=( $(compgen -f -- $cur) )
OPTS="
--json
--noinaccessible
--noheadings
--output
--pid
--raw
--notruncate
--help
--version
"
COMPREPLY=( $(compgen -W "${OPTS[*]}" -- $cur) )
return 0
}
complete -F _lslocks_module lslocks

View File

@ -11,13 +11,17 @@ _mcookie_module()
COMPREPLY=( $(compgen -f -- $cur) )
return 0
;;
'-m'|'--max-size')
COMPREPLY=( $(compgen -W "bytes" -- $cur) )
return 0
;;
'-h'|'--help'|'-V'|'--version')
return 0
;;
esac
case $cur in
-*)
OPTS="--file --verbose --version --help"
OPTS="--file --max-size --verbose --version --help"
COMPREPLY=( $(compgen -W "${OPTS[*]}" -- $cur) )
return 0
;;

View File

@ -21,7 +21,18 @@ _wipefs_module()
esac
case $cur in
-*)
OPTS="--all --force --help --no-act --offset --parsable --quiet --types --version"
OPTS="
--all
--backup
--force
--help
--no-act
--offset
--parsable
--quiet
--types
--version
"
COMPREPLY=( $(compgen -W "${OPTS[*]}" -- $cur) )
return 0
;;