[Note: this is a repost with corrections to message #74548 ]
Log:
* /svn/trunk/tools/client-side/bash_completion
Fixed issues with 'bash_completion' config and tester
o Fixed svn & svnadmin parameters for trunk programs.
o Also did some tidy-work on non-consistant coding and checking.
o 'svnadmin' checks never worked (see new scripts), now fixed.
o File now passes all 'svn' and 'svnadmin' tests sucessfully.
o (I don't know if a bug/issue was ever reported, but I fixed it. :)
Index: bash_completion
===================================================================
--- bash_completion (revision 10685)
+++ bash_completion (working copy)
@@ -10,19 +10,19 @@
_svn()
{
- local cur cmds cmdOpts pOpts mOpts rOpts qOpts nOpts optsParam opt
- local helpCmds optBase i
+ local cur cmds cmdOpts optsParam opt helpCmds optBase i
+ local aOpts fOpts pOpts mOpts rOpts qOpts nOpts vOpts
COMPREPLY=()
cur=${COMP_WORDS[COMP_CWORD]}
# Possible expansions, without unambiguous abbreviations such as "up".
cmds='add blame annotate praise cat checkout co cleanup commit ci \
- copy cp delete remove rm diff export help ? import info \
- list ls log merge mkdir move mv rename \
- propdel pdel propedit pedit propget pget \
- proplist plist propset pset resolved revert \
- status switch update version --version'
+ copy cp delete remove rm diff export help ? import info \
+ list ls log merge mkdir move mv rename \
+ propdel pdel propedit pedit propget pget \
+ proplist plist propset pset resolved revert \
+ status switch update --version'
if [[ $COMP_CWORD -eq 1 ]] ; then
COMPREPLY=( $( compgen -W "$cmds" -- $cur ) )
@@ -32,9 +32,9 @@
# options that require a parameter
# note: continued lines must end '|' continuing lines must start '|'
optsParam="-r|--revision|--username|--password|--targets|
- |-x|--extensions|-m|--message|-F|--file|--encoding|
- |--diff-cmd|--diff3-cmd|--editor-cmd|--old|--new|
- |--config-dir|--native-eol"
+ |-x|--extensions|-m|--message|-F|--file|--encoding|
+ |--diff-cmd|--diff3-cmd|--editor-cmd|--old|--new|
+ |--config-dir|--native-eol"
# if not typing an option, or if the previous option required a
# parameter, then fallback on ordinary filename expansion
@@ -45,24 +45,28 @@
return 0
fi
+ aOpts="--auto-props --no-auto-props"
+ fOpts="--force"
pOpts="--username --password --no-auth-cache --non-interactive"
mOpts="-m --message -F --file --encoding --force-log"
rOpts="-r --revision"
+ ROpts="-R --recursive"
qOpts="-q --quiet"
nOpts="-N --non-recursive"
+ vOpts="-v --verbose"
# possible options for the command
- cmdOpts=
+ cmdOpts=""
case ${COMP_WORDS[1]} in
--version)
cmdOpts="$qOpts"
;;
add)
- cmdOpts="--auto-props --no-auto-props --force --targets \
- $nOpts $qOpts"
+ cmdOpts="$aOpts --targets $fOpts $nOpts $qOpts"
;;
blame|annotate|ann|praise)
cmdOpts="$rOpts $pOpts -v --verbose"
+ cmdOpts="$rOpts $pOpts $vOpts"
;;
cat)
cmdOpts="$rOpts $pOpts"
@@ -81,68 +85,67 @@
;;
delete|del|remove|rm)
cmdOpts="--force $mOpts $qOpts --targets --editor-cmd $pOpts"
+ cmdOpts="$fOpts $mOpts $qOpts --targets --editor-cmd $pOpts"
;;
diff|di)
cmdOpts="$rOpts -x --extensions --diff-cmd --no-diff-deleted \
- $nOpts $pOpts --old --new --notice-ancestry"
+ $nOpts $pOpts --old --new --notice-ancestry"
;;
export)
- cmdOpts="$rOpts $qOpts $pOpts --force --native-eol"
+ cmdOpts="$rOpts $qOpts --native-eol $pOpts $fOpts"
;;
help|h|\?)
cmdOpts="$cmds $qOpts"
;;
import)
- cmdOpts="--auto-props --no-auto-props $mOpts $qOpts $nOpts \
- --editor-cmd $pOpts"
+ cmdOpts="$aOpts $mOpts $qOpts $nOpts --editor-cmd $pOpts "
;;
info)
- cmdOpts="--targets -R --recursive"
+ cmdOpts="--targets $ROpts"
;;
list|ls)
- cmdOpts="$rOpts -v --verbose -R --recursive $pOpts"
+ cmdOpts="$rOpts $vOpts $ROpts $pOpts"
;;
log)
- cmdOpts="$rOpts -v --verbose --targets $pOpts --stop-on-copy \
- --incremental --xml $qOpts"
+ cmdOpts="$rOpts $vOpts --targets $pOpts --stop-on-copy \
+ --incremental --xml $qOpts"
;;
merge)
- cmdOpts="$rOpts $nOpts $qOpts --force --dry-run --diff3-cmd \
- $pOpts --ignore-ancestry"
+ cmdOpts="$rOpts $nOpts $qOpts $fOpts --dry-run --diff3-cmd \
+ $pOpts --ignore-ancestry"
;;
mkdir)
cmdOpts="$mOpts $qOpts --editor-cmd $pOpts"
;;
move|mv|rename|ren)
- cmdOpts="$mOpts $rOpts $qOpts --force --editor-cmd $pOpts"
+ cmdOpts="$mOpts $rOpts $qOpts $fOpts --editor-cmd $pOpts"
;;
propdel|pdel|pd)
- cmdOpts="$qOpts -R --recursive $rOpts --revprop $pOpts"
+ cmdOpts="$qOpts $ROpts $rOpts --revprop $pOpts"
;;
propedit|pedit|pe)
cmdOpts="$rOpts --revprop --encoding --editor-cmd $pOpts \
- --force"
+ $fOpts"
;;
propget|pget|pg)
cmdOpts="-R --recursive $rOpts --revprop --strict $pOpts"
;;
proplist|plist|pl)
- cmdOpts="-v --verbose -R --recursive $rOpts --revprop $qOpts \
- $pOpts"
+ cmdOpts="$vOpts $ROpts $rOpts --revprop $qOpts $pOpts"
;;
propset|pset|ps)
- cmdOpts="-F --file $qOpts --targets -R --recursive --revprop \
- --encoding $pOpts $rOpts --force"
+ cmdOpts="-F --file $qOpts --targets $ROpts --revprop \
+ --encoding $pOpts $rOpts $fOpts"
;;
resolved)
- cmdOpts="--targets -R --recursive $qOpts"
+ cmdOpts="--targets $ROpts $qOpts"
;;
revert)
- cmdOpts="--targets -R --recursive $qOpts"
+ cmdOpts="--targets $ROpts $qOpts"
;;
status|stat|st)
- cmdOpts="-u --show-updates -v --verbose $nOpts $qOpts $pOpts \
- --no-ignore"
+ cmdOpts="-u --show-updates $vOpts $nOpts $qOpts $pOpts \
+ --no-ignore"
;;
switch|sw)
cmdOpts="--relocate $rOpts $nOpts $qOpts $pOpts --diff3-cmd"
@@ -153,11 +156,9 @@
version)
cmdOpts="$qOpts"
;;
- *)
- ;;
esac
- cmdOpts="$cmdOpts --help -h --config-dir"
+ cmdOpts="$cmdOpts --help -h --config-dir" # Every command has these.
# take out options already given
for (( i=2; i<=$COMP_CWORD-1; ++i )) ; do
@@ -190,12 +191,10 @@
--auto-props) cmdOpts=${cmdOpts/ --no-auto-props / } ;;
--no-auto-props) cmdOpts=${cmdOpts/ --auto-props / } ;;
- -m|--message|-F|--file)
- cmdOpts=${cmdOpts/ --message / }
- cmdOpts=${cmdOpts/ -m / }
- cmdOpts=${cmdOpts/ --file / }
- cmdOpts=${cmdOpts/ -F / }
- ;;
+ -m) cmdOpts=${cmdOpts/ --message / } ;;
+ --message) cmdOpts=${cmdOpts/ -m / } ;;
+ -F) cmdOpts=${cmdOpts/ --file / } ;;
+ --file) cmdOpts=${cmdOpts/ -F / } ;;
esac
# skip next option if this one requires a parameter
@@ -213,12 +212,14 @@
_svnadmin ()
{
local cur cmds cmdOpts optsParam opt helpCmds optBase i
+ local rOpts qOpts
COMPREPLY=()
cur=${COMP_WORDS[COMP_CWORD]}
- cmds='create deltify dump help h ? hotcopy load list-dblogs \
- list-unused-dblogs lstxns recover rmtxns setlog verify'
+ # Possible expansions, without unambiguous abbreviations such as "h".
+ cmds='create deltify dump help ? hotcopy load list-dblogs \
+ list-unused-dblogs lstxns recover rmtxns setlog verify --version'
if [[ $COMP_CWORD -eq 1 ]] ; then
COMPREPLY=( $( compgen -W "$cmds" -- $cur ) )
@@ -238,38 +239,49 @@
return 0
fi
- cmdOpts=
+ rOpts="-r --revision"
+ qOpts="-q --quiet"
+
+ cmdOpts=""
+
case ${COMP_WORDS[1]} in
create)
cmdOpts="--bdb-txn-nosync --bdb-log-keep --config-dir --fs-type"
;;
deltify)
- cmdOpts="-r --revision -q --quiet"
+ cmdOpts="$rOpts $qOpts"
;;
dump)
- cmdOpts="-r --revision --incremental -q --quiet --deltas"
+ cmdOpts="$rOpts --incremental $qOpts --deltas"
;;
help|h|\?)
- cmdOpts="$cmds $qOpts"
+ cmdOpts="$cmds"
;;
hotcopy)
cmdOpts="--clean-logs"
;;
- load)
- cmdOpts="--ignore-uuid --force-uuid --parent-dir -q --quiet"
- ;;
list-dblogs)
;;
list-unused-dblogs)
;;
+ load)
+ cmdOpts="--ignore-uuid --force-uuid --parent-dir $qOpts"
+ ;;
+ lstxns)
+ ;;
+ recover)
+ ;;
+ rmtxns)
+ cmdOpts="$qOpts"
+ ;;
setlog)
- cmdOpts="-r --revision"
+ cmdOpts="--bypass-hooks $rOpts"
;;
- *)
+ verify)
;;
esac
- cmdOpts="$cmdOpts --help -h"
+ cmdOpts="$cmdOpts --help -h" # Every command has these.
# take out options already given
for (( i=2; i<=$COMP_CWORD-1; ++i )) ; do
---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@subversion.tigris.org
For additional commands, e-mail: dev-help@subversion.tigris.org
Received on Thu Aug 19 06:47:53 2004