projects
/
tools
/
createrepo.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
3116c34
)
Add modifyrepo option completion.
author
Ville Skyttä
<ville.skytta@iki.fi>
Tue, 2 Nov 2010 21:55:53 +0000
(23:55 +0200)
committer
Ville Skyttä
<ville.skytta@iki.fi>
Tue, 2 Nov 2010 21:55:53 +0000
(23:55 +0200)
createrepo.bash
patch
|
blob
|
history
diff --git
a/createrepo.bash
b/createrepo.bash
index ccda7b5ef30055c50405240d2d8c39579600c1d2..e29ce25ab05415df412f4b4db36b3a315f0b0b2e 100644
(file)
--- 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