You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@subversion.apache.org by ju...@apache.org on 2017/12/08 11:31:27 UTC
svn commit: r1817487 -
/subversion/trunk/tools/client-side/bash_completion_test
Author: julianfoad
Date: Fri Dec 8 11:31:27 2017
New Revision: 1817487
URL: http://svn.apache.org/viewvc?rev=1817487&view=rev
Log:
* tools/client-side/bash_completion_test: Find the completion script in the
same directory, if not specified.
Modified:
subversion/trunk/tools/client-side/bash_completion_test
Modified: subversion/trunk/tools/client-side/bash_completion_test
URL: http://svn.apache.org/viewvc/subversion/trunk/tools/client-side/bash_completion_test?rev=1817487&r1=1817486&r2=1817487&view=diff
==============================================================================
--- subversion/trunk/tools/client-side/bash_completion_test (original)
+++ subversion/trunk/tools/client-side/bash_completion_test Fri Dec 8 11:31:27 2017
@@ -20,9 +20,16 @@
# script produces appropriate lists of completions for various incomplete svn
# command lines.
-if [ ! -f "$1" ] || [ "$2" ]; then
- echo "Usage: bash_completion_test BASH_COMPLETION_PATHNAME"
+THIS_DIR=`dirname "$0"`
+SCRIPT="$1"
+if [ -z "$SCRIPT" ]; then
+ SCRIPT="$THIS_DIR/bash_completion"
+fi
+
+if [ ! -r "$SCRIPT" ] || [ "$2" ]; then
+ echo "Usage: bash_completion_test [BASH_COMPLETION_PATHNAME]"
echo "Tests the specified \"bash_completion\" script,"
+ echo "defaulting to the one in the same directory as this test,"
echo "including checking it against the \"svn\" program found in the current PATH."
exit 1
fi
@@ -32,7 +39,7 @@ shopt -s extglob
export LC_ALL=C
# Execute the script which is to be tested.
-. "$1"
+. "$SCRIPT"
# From the given incomplete svn command, print a space-separated list of
# possible completions of the last argument (or of an empty first argument