diff options
author | Pascal Rigaux <pixel@mandriva.com> | 2007-06-29 13:30:24 +0000 |
---|---|---|
committer | Pascal Rigaux <pixel@mandriva.com> | 2007-06-29 13:30:24 +0000 |
commit | 6cbb51a6bf5f4ccfc3388ce39a3bbd5b14a91217 (patch) | |
tree | 7e5723a41d828799e9759547bfd72c0133ba297f /etc/youri-submit | |
download | mga-youri-submit-6cbb51a6bf5f4ccfc3388ce39a3bbd5b14a91217.tar mga-youri-submit-6cbb51a6bf5f4ccfc3388ce39a3bbd5b14a91217.tar.gz mga-youri-submit-6cbb51a6bf5f4ccfc3388ce39a3bbd5b14a91217.tar.bz2 mga-youri-submit-6cbb51a6bf5f4ccfc3388ce39a3bbd5b14a91217.tar.xz mga-youri-submit-6cbb51a6bf5f4ccfc3388ce39a3bbd5b14a91217.zip |
prepare mergeupstream
Diffstat (limited to 'etc/youri-submit')
-rw-r--r-- | etc/youri-submit | 60 |
1 files changed, 60 insertions, 0 deletions
diff --git a/etc/youri-submit b/etc/youri-submit new file mode 100644 index 0000000..6feb2c7 --- /dev/null +++ b/etc/youri-submit @@ -0,0 +1,60 @@ +# youri-submit completion +# $Id$ + +_youri-submit() +{ + + 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 'targets steps' -- $cur ) ) + return 0 + ;; + --help) + COMPREPLY=( $( compgen -W 'repository steps' -- $cur ) ) + return 0 + ;; + esac + + if [[ "$cur" == -* ]]; then + COMPREPLY=( $( compgen -W '--define --clean -l --list -h --help -t \ + --test -v --verbose' -- $cur ) ) + # add dangereous option for main command + if [[ ${COMP_WORDS[0]} == youri-submit ]]; then + COMPREPLY=( $( compgen -W '${COMPREPLY[@]} --config --skip-step' \ + -- $cur ) ) + fi + else + _count_args + case $args in + 1) + _find_config + COMPREPLY=( $( compgen -W '$( youri-submit $config --list targets )' -- $cur ) ) + ;; + *) + _filedir + ;; + esac + fi + +} +complete -F _youri-submit youri-submit youri-submit-restricted youri-submit-proxy + +_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 +} |