mirror of
https://github.com/systemd/systemd.git
synced 2024-12-22 17:35:35 +03:00
shell-completion: update for udevadm
This commit is contained in:
parent
e7e25c21c6
commit
d90dbba7ec
@ -65,9 +65,10 @@ _udevadm() {
|
||||
[TEST]='-a --action -N --resolve-names'
|
||||
[TEST_BUILTIN]='-a --action'
|
||||
[WAIT]='-t --timeout --initialized=no --removed --settle'
|
||||
[LOCK]='-t --timeout -d --device -b --backing -p --print'
|
||||
)
|
||||
|
||||
local verbs=(info trigger settle control monitor test-builtin test wait)
|
||||
local verbs=(info trigger settle control monitor test-builtin test wait lock)
|
||||
local builtins=(blkid btrfs hwdb input_id keyboard kmod net_id net_setup_link path_id usb_id uaccess)
|
||||
|
||||
for ((i=0; i < COMP_CWORD; i++)); do
|
||||
@ -265,6 +266,24 @@ _udevadm() {
|
||||
fi
|
||||
;;
|
||||
|
||||
'lock')
|
||||
if __contains_word "$prev" ${OPTS[LOCK]}; then
|
||||
case $prev in
|
||||
*)
|
||||
comps=''
|
||||
;;
|
||||
esac
|
||||
COMPREPLY=( $(compgen -W '$comps' -- "$cur") )
|
||||
return 0
|
||||
fi
|
||||
|
||||
if [[ $cur = -* ]]; then
|
||||
comps="${OPTS[COMMON]} ${OPTS[LOCK]}"
|
||||
else
|
||||
comps=''
|
||||
fi
|
||||
;;
|
||||
|
||||
*)
|
||||
comps=${VERBS[*]}
|
||||
;;
|
||||
|
@ -115,6 +115,16 @@ _udevadm_wait(){
|
||||
'*::devpath:_files -P /dev/ -W /dev'
|
||||
}
|
||||
|
||||
(( $+functions[_udevadm_lock] )) ||
|
||||
_udevadm_lock(){
|
||||
_arguments \
|
||||
'--timeout=[Maximum number of seconds to wait for the devices being locked.]' \
|
||||
'--device=[Block device to lock.]' \
|
||||
'--backing=[File whose backing block device to lock.]' \
|
||||
'--print[Only show which block device the lock would be taken on.]' \
|
||||
'--help[Print help text.]'
|
||||
}
|
||||
|
||||
(( $+functions[_udevadm_mounts] )) ||
|
||||
_udevadm_mounts(){
|
||||
local dev_tmp dpath_tmp mp_tmp mline
|
||||
@ -144,6 +154,8 @@ _udevadm_commands(){
|
||||
'monitor:listen to kernel and udev events'
|
||||
'test:test an event run'
|
||||
'test-builtin:test a built-in command'
|
||||
'wait:wait for devices or device symlinks being created'
|
||||
'lock:lock a block device and run a comand'
|
||||
)
|
||||
|
||||
if ((CURRENT == 1)); then
|
||||
|
Loading…
Reference in New Issue
Block a user