[svn.haxx.se] · SVN Dev · SVN Users · SVN Org · TSVN Dev · TSVN Users · Subclipse Dev · Subclipse Users · this month's index

[PATCH] 1.1.x: Fixed issues with 'bash_completion' config and tester

From: FRuG FoREST <svn-dev_at_dystopia.org>
Date: 2004-08-13 10:26:01 CEST

[PATCH File below]
  /svn/branches/1.1.x/tools/client-side/bash_completion

Note:
o Fixed SVN/SVNADMIN parameters for 1.1.X branch.
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. :)

- FRuG FoREST -

Index: svn/branches/1.1.x/tools/client-side/bash_completion
===================================================================
--- svn/branches/1.1.x/tools/client-side/bash_completion (revision 10614)
+++ svn/branches/1.1.x/tools/client-side/bash_completion (working copy)
@@ -10,8 +10,8 @@

 _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]}
@@ -45,23 +45,27 @@
                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 --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"
@@ -79,68 +83,67 @@
                cmdOpts="$mOpts $rOpts $qOpts --editor-cmd $pOpts"
                ;;
        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"
                ;;
        export)
- cmdOpts="$rOpts $qOpts $pOpts --force"
+ 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 \
+ cmdOpts="$rOpts $vOpts --targets $pOpts --stop-on-copy \
                         --incremental --xml $qOpts"
                ;;
        merge)
- cmdOpts="$rOpts $nOpts $qOpts --force --dry-run --diff3-cmd \
+ 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"
+ cmdOpts="$ROpts $rOpts --revprop --strict $pOpts"
                ;;
        proplist|plist|pl)
- cmdOpts="-v --verbose -R --recursive $rOpts --revprop $qOpts \
+ 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 \
+ cmdOpts="-u --show-updates $vOpts $nOpts $qOpts $pOpts \
                         --no-ignore"
                ;;
        switch|sw)
@@ -149,11 +152,9 @@
        update|up)
                cmdOpts="$rOpts $nOpts $qOpts $pOpts --diff3-cmd"
                ;;
- *)
- ;;
        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
@@ -185,13 +186,10 @@
                --revision) cmdOpts=${cmdOpts/ -r / } ;;
                --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
@@ -209,12 +207,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 ) )
@@ -234,38 +234,48 @@
                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

--
Ask-backwards, confirmation mail checker, http://www.paganini.net
---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@subversion.tigris.org
For additional commands, e-mail: dev-help@subversion.tigris.org
Received on Fri Aug 13 11:01:18 2004

This is an archived mail posted to the Subversion Dev mailing list.

This site is subject to the Apache Privacy Policy and the Apache Public Forum Archive Policy.