bash_completion: 'fucntion' keyword' not supported

TK Soh teekaysoh at yahoo.com
Wed Mar 1 02:24:14 UTC 2006


--- "Alexis S. L. Carvalho" <alexis at cecm.usp.br> wrote:
> # HG changeset patch
> # User Alexis S. L. Carvalho <alexis at cecm.usp.br>
> # Node ID 4e0068f859c4016d29a97866fdc68c95fcf672f2
> # Parent  414e81ae971f1751995b71cf082e2f98256f677a
> Fix bash_completion on Solaris

Looks like there are more unsupported features that just 'function'. I had to use the following
patch to make it work. Please verify.

--- a/contrib/bash_completion   Tue Feb 28 12:25:26 2006 -0600
+++ b/contrib/bash_completion   Wed Mar 01 10:12:49 2006 +0800
@@ -4,11 +4,9 @@ _hg_command_list()
 {
     "$hg" --debug help 2>/dev/null | \
        awk -F', ' '/^list of commands:/ {commands=1}
-           commands && /^ [^ ]/ {
-               sub(/ /, "")
-               sub(/:.*/, "")
+           commands == 1 && /^ [^ ]/ {
                command = $1
-               if (index(command, "debug") == 1) {
+               if (index(command, " debug") == 1) {
                    for (i=1; i<=NF; i++)
                        debug[j++] = $i
                    next
@@ -19,7 +17,8 @@ _hg_command_list()
                        print $i
            }
            /^global options:/ {exit 0}
-           END {for (i in debug) print debug[i]}'
+           END {for (i in debug) print debug[i]}' | \
+        sed -e 's/:.*//; s/^ //'
 }
 
 _hg_option_list()


__________________________________________________
Do You Yahoo!?
Tired of spam?  Yahoo! Mail has the best spam protection around 
http://mail.yahoo.com 



More information about the Mercurial mailing list