# Slackware Linux pkgtool completion -*- shell-script -*- proc _pkgtool { var cur = '', prev = '', words = '', cword = '' _init_completion || return match $prev { with --source_dir|--target_dir _filedir -d return 0 with --sets # argument required but no completions available return 0 with --source_device setglobal COMPREPLY = '( '$( compgen -f -d -- "${cur:-/dev/}" ) ) return 0 with --tagfile _filedir return 0 } if [[ "$cur" == -* ]] { setglobal COMPREPLY = '( '$( compgen -W '--sets --ignore-tagfiles --tagfile --source-mounted --source_dir --target_dir --source_device' \ -- "$cur" ) ) return 0 } } && complete -F _pkgtool pkgtool # ex: ts=4 sw=4 et filetype=sh