# appdata-validate(1) completion -*- shell-script -*- proc _appdata_validate { local cur prev words cword split _init_completion -s || return match $prev { with -h|--help|--version return with --output-format setglobal COMPREPLY = ''( $( compgen -W "$( $1 --help | sed -ne 's/--output-format.*\[\(.*\)\]/\1/' -e 's/|/ /gp' )" \ -- "$cur" ) ) return } $split && return 0 if [[ $cur == -* ]] { setglobal COMPREPLY = ''( $( compgen -W '$( _parse_help "$1" )' -- "$cur" ) ) [[ $COMPREPLY == *= ]] && compopt -o nospace return } _filedir appdata.xml } && complete -F _appdata_validate appdata-validate # ex: ts=4 sw=4 et filetype=sh