[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
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[*]}
;;
'*::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
'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