# udevadm(8) completion -*- shell-script -*- # Use of this file is deprecated. Upstream completion is available in # systemd >= 196, use that instead. proc _udevadm { var cur = '', prev = '', words = '', cword = '', split = '' _init_completion -s || return var i = '', udevcmd = '' for (( i=1; i < cword; i++ )); do if [[ ${words[i]} != -* ]]; then udevcmd=${words[i]} break fi done match $prev { with --help|--version|--property|--children-max|--timeout|--seq-start|\ --seq-end|--attr-match|--attr-nomatch|--parent-match|--property-match|\ --tag-match|--subsystem-match|--subsystem-nomatch|--sysname-match|\ --path return with --log-priority setglobal COMPREPLY = '( '$( compgen -W 'err info debug' -- "$cur" ) ) return with --query setglobal COMPREPLY = '( '$( compgen -W 'name symlink path property all' \ -- "$cur" ) ) return with --name set cur = $(cur:=/dev/) _filedir return with --device-id-of-file|--exit-if-exists _filedir return with --action setglobal COMPREPLY = '( '$( compgen -W 'add change remove' -- "$cur" ) ) return with --type setglobal COMPREPLY = '( '$( compgen -W 'devices subsystems failed' -- "$cur" ) ) return } $split && return if [[ -z $udevcmd ]] { match $cur { with -* setglobal COMPREPLY = '( '$( compgen -W '--help --version --debug' -- \ "$cur" ) ) with * setglobal COMPREPLY = '( '$( compgen -W "$( "$1" --help 2>/dev/null | awk '/^[[:space:]]+/ { print $1 }' )" -- "$cur" ) ) } return } if [[ $cur == -* ]] { setglobal COMPREPLY = '( '$( compgen -W \ '$( "$1" $udevcmd --help 2>/dev/null | _parse_help - )' \ -- "$cur" ) ) [[ $COMPREPLY == *= ]] && compopt -o nospace } } && complete -F _udevadm udevadm # ex: ts=4 sw=4 et filetype=sh