diff options
author | Guillaume Rousse <guillomovitch@mandriva.org> | 2004-11-28 22:34:35 +0000 |
---|---|---|
committer | Guillaume Rousse <guillomovitch@mandriva.org> | 2004-11-28 22:34:35 +0000 |
commit | 74f3ed5b811c52e8034f8da5e667c5c917fcc05a (patch) | |
tree | f2244cde500c59fc3a08cb8810a95b4d5e3e9f01 /rpmbuildupdate.bash-completion | |
parent | 3ee9fe4dfe5b6f35273886ee3fff24bade8cd736 (diff) | |
download | bootsplash-74f3ed5b811c52e8034f8da5e667c5c917fcc05a.tar bootsplash-74f3ed5b811c52e8034f8da5e667c5c917fcc05a.tar.gz bootsplash-74f3ed5b811c52e8034f8da5e667c5c917fcc05a.tar.bz2 bootsplash-74f3ed5b811c52e8034f8da5e667c5c917fcc05a.tar.xz bootsplash-74f3ed5b811c52e8034f8da5e667c5c917fcc05a.zip |
new options
complete on rpm name
Diffstat (limited to 'rpmbuildupdate.bash-completion')
-rw-r--r-- | rpmbuildupdate.bash-completion | 27 |
1 files changed, 24 insertions, 3 deletions
diff --git a/rpmbuildupdate.bash-completion b/rpmbuildupdate.bash-completion index a5b8320..7ac2ab2 100644 --- a/rpmbuildupdate.bash-completion +++ b/rpmbuildupdate.bash-completion @@ -3,14 +3,14 @@ _rpmbuildupdate() { - local cur prev + local cur prev rpmpath file COMPREPLY=() cur=${COMP_WORDS[COMP_CWORD]} prev=${COMP_WORDS[COMP_CWORD-1]} case $prev in - --@(rpmmon|src)) + --@(rpmmon|src|spec)) _filedir return 0 ;; @@ -20,8 +20,29 @@ _rpmbuildupdate() ;; esac + if [[ "$cur" == -* ]]; then - COMPREPLY=( $( compgen -W '--rpmmon --srpms --src --release --deps --log --nosource ---top --nobuild -c' -- $cur ) ) + COMPREPLY=( $( compgen -W '--rpmmon --srpms --src --spec --rpmoption \ + --release --changelog --deps --log --nosource --noupdate --top \ + --nobuild -c' -- $cur ) ) + else + # get source rpm path + for file in /etc/rpmbuildupdate $HOME/.rpmbuildupdaterc; do + if [ -f $file ]; then + rpmpath=`awk -F" *= *" '/srpms/ {print $2}' $file` + fi + done + for (( i=1; i < COMP_CWORD; i++ )); do + if [[ "${COMP_WORDS[i]}" == --srpms ]]; then + rpmpath=${COMP_WORDS[i+1]} + break + fi + done + if [ -n "$rpmpath" ]; then + rpmpath=${rpmpath//,/ } + COMPREPLY=( $( eval command ls "$rpmpath" 2>/dev/null | \ + sed -ne 's|^\('$cur'.*\)-[0-9a-zA-Z._]\+-[0-9a-z.@]\+\.src\.rpm$|\1|p' ) ) + fi fi } complete -F _rpmbuildupdate $filenames rpmbuildupdate |