Discussion:
2 commits - createrepo.bash
Ville SkyttÀ
2010-11-02 21:59:09 UTC
Permalink
createrepo.bash | 25 ++++++++++++++++++++++---
1 file changed, 22 insertions(+), 3 deletions(-)

New commits:
commit 340eb829f04a9e65aba586f341bc0efaa4ed9778
Author: Ville SkyttÀ <***@iki.fi>
Date: Tue Nov 2 23:58:27 2010 +0200

Add createrepo --workers (non)completion.

diff --git a/createrepo.bash b/createrepo.bash
index e29ce25..54ac8b2 100644
--- a/createrepo.bash
+++ b/createrepo.bash
@@ -5,7 +5,7 @@ _cr_createrepo()
COMPREPLY=()

case $3 in
- --version|-h|--help|-u|--baseurl|--distro|--content|--repo|\
+ --version|-h|--help|-u|--baseurl|--distro|--content|--repo|--workers|\
--revision|-x|--excludes|--changelog-limit|--max-delta-rpm-size)
return 0
;;
@@ -44,7 +44,7 @@ _cr_createrepo()
--skip-symlinks --changelog-limit --unique-md-filenames
--simple-md-filenames --distro --content --repo --revision --deltas
--oldpackagedirs --num-deltas --read-pkgs-list
- --max-delta-rpm-size' -- "$2" ) )
+ --max-delta-rpm-size --workers' -- "$2" ) )
else
COMPREPLY=( $( compgen -d -- "$2" ) )
fi
commit f63fa568738c90606434de8e454ecf72685c029a
Author: Ville SkyttÀ <***@iki.fi>
Date: Tue Nov 2 23:55:53 2010 +0200

Add modifyrepo option completion.

diff --git a/createrepo.bash b/createrepo.bash
index ccda7b5..e29ce25 100644
--- a/createrepo.bash
+++ b/createrepo.bash
@@ -74,7 +74,26 @@ _cr_modifyrepo()
{
COMPREPLY=()

- case $COMP_CWORD in
+ case $3 in
+ --version|-h|--help|--mdtype)
+ return 0
+ ;;
+ esac
+
+ if [[ $2 == -* ]] ; then
+ COMPREPLY=( $( compgen -W '--version --help --mdtype' -- "$2" ) )
+ return 0
+ fi
+
+ local i argnum=1
+ for (( i=1; i < ${#COMP_WORDS[@]}-1; i++ )) ; do
+ if [[ ${COMP_WORDS[i]} != -* &&
+ ${COMP_WORDS[i-1]} != @(=|--mdtype) ]]; then
+ argnum=$(( argnum+1 ))
+ fi
+ done
+
+ case $argnum in
1)
COMPREPLY=( $( compgen -f -o plusdirs -- "$2" ) )
return 0

Loading...