# youri-check completion # $Id$ _youri-check() { local cur prev config COMPREPLY=() cur=${COMP_WORDS[COMP_CWORD]} prev=${COMP_WORDS[COMP_CWORD-1]} case "$prev" in --config) _filedir return 0 ;; --list) COMPREPLY=( $( compgen -W 'medias' -- $cur ) ) return 0 ;; --skip-media) _find_config COMPREPLY=( $( compgen -W '$( youri-check $config --list medias )' -- $cur ) ) return 0 ;; esac if [[ "$cur" == -* ]]; then COMPREPLY=( $( compgen -W '--config --skip-test --skip-report \ --skip-media -h --help -t --test -v --verbose -p --parallel \ --timestamps' -- $cur ) ) else _count_args case $args in 1) COMPREPLY=( $( compgen -W 'test report' -- $cur ) ) ;; esac fi } complete -F _youri-check youri-check _find_config() { for (( i=1; i < COMP_CWORD; i++ )); do if [[ "${COMP_WORDS[i]}" == --config ]]; then config="--config ${COMP_WORDS[i+1]}" break fi done }