diff options
author | Nicolas Vigier <boklm@mageia.org> | 2013-04-14 13:46:12 +0000 |
---|---|---|
committer | Nicolas Vigier <boklm@mageia.org> | 2013-04-14 13:46:12 +0000 |
commit | 1be510f9529cb082f802408b472a77d074b394c0 (patch) | |
tree | b175f9d5fcb107576dabc768e7bd04d4a3e491a0 /zarb-ml/mageia-dev/attachments/20110713/f8807b02/attachment.obj | |
parent | fa5098cf210b23ab4f419913e28af7b1b07dafb2 (diff) | |
download | archives-master.tar archives-master.tar.gz archives-master.tar.bz2 archives-master.tar.xz archives-master.zip |
Diffstat (limited to 'zarb-ml/mageia-dev/attachments/20110713/f8807b02/attachment.obj')
-rw-r--r-- | zarb-ml/mageia-dev/attachments/20110713/f8807b02/attachment.obj | 78 |
1 files changed, 78 insertions, 0 deletions
diff --git a/zarb-ml/mageia-dev/attachments/20110713/f8807b02/attachment.obj b/zarb-ml/mageia-dev/attachments/20110713/f8807b02/attachment.obj new file mode 100644 index 000000000..3a0ac77e4 --- /dev/null +++ b/zarb-ml/mageia-dev/attachments/20110713/f8807b02/attachment.obj @@ -0,0 +1,78 @@ +# mgarepo(1) completion +# +#_cooker_packages() +#{ +# COMPREPLY=( $( compgen -W '$(svn ls \ +# svn+ssh://svn.mandriva.com/svn/packages/cooker \ +# | sed -e "s|/$||" )' -- $cur ) ) +#} + +_mgarepo_actions() +{ + COMPREPLY=( $( compgen -W 'co ci authoremail changed create del \ + getspec getsrpm import maintdb putsrpm rpmlog submit \ + switch sync upload \ + help' -- $cur ) ) +} + +_mgarepo() +{ + local cur prev command options i + + COMPREPLY=() + cur=${COMP_WORDS[COMP_CWORD]} + + if [[ $COMP_CWORD -eq 1 ]] ; then + _mgarepo_actions + else + prev=${COMP_WORDS[COMP_CWORD-1]} + + case "$prev" in + -@(c|-config)) + _filedir + return 0 + ;; + esac + + command=${COMP_WORDS[1]} + + if [[ "$cur" == -* ]]; then + # possible options for the command + case $command in + submit) + options="--define" + ;; + sync) + options="--dry-run -c --download" + ;; + esac + options="$options --help" + COMPREPLY=( $( compgen -W "$options" -- $cur ) ) + else + case $command in + help) + _mgarepo_actions + return 0 + ;; + import) + _filedir 'src.rpm' + return 0 + ;; + upload) + _filedir 'tar.gz|tar.bz2|tar.lzma|tar.xz|zip' + return 0 + ;; + del) + _filedir 'tar.gz|tar.bz2|tar.lzma|tar.xz|zip' + return 0 + ;; + @(sync|commit|ci)) + _filedir -d + return 0 + ;; + esac + fi + fi + +} +complete -F _mgarepo $filenames mgarepo
\ No newline at end of file |