tcsh_completion.sh

Thomas Arendsen Hein thomas at intevation.de
Tue Aug 30 01:34:39 CDT 2005


* TK Soh <teekaysoh at yahoo.com> [20050830 08:05]:
> I renamed it to tcsh_completion_build.sh, and updated both script and
> tcsh_completion with licence header in the attached patches. Please help check
> them in if you are okay with them.

They look better now, but on a last check before pushing it to the
real tree (running the script and using 'hg diff' to see the
differences) I found a small bug, which doesn't happen on Solaris,
but on Debian GNU/Linux (sarge):

The generated tcsh_completion shows an error:

complete hg \
  'n/--cwd/d/' 'n/-R/d/' 'n/--repository/d/' \
  'C/-/(-R --repository --cwd -y --noninteractive \
    -q --quiet -v --verbose --debug \
    --traceback --time --profile --version -h \
    Usage: /bin/echo [OPTION]... [STRING]... \
    Echo the STRING(s) to standard output. \
    ...

First problem: This obviously doesn't work.
Second problem: It didn't tell me that there was a problem.

> +hg_commands=`hg --debug help | \
> +        sed -e '1,/^list of commands:/d' \
> +            -e '/^global options:/,$d' \
> +            -e '/^ [^ ]/!d; s/[,:]//g;' | 
                                            ^ hidden trailing space
                                              oh, and no \? see below
> +        xargs -n5 | \
> +        sed -e '$!s/$/ \\\\/g; 2,$s/^ \{0,\}/    /g'`
> +
> +hg_global_options=`hg -v help | \
> +        sed -e '1,/global/d;/^ *-/!d; s/ [^- ].*//' | \
> +        xargs -n5 | \
> +        sed -e '$!s/$/ \\\\/g; 2,$s/^ \{0,\}/    /g'`

Another problem: The backslashes are included in $hg_command,
because they are not needed inside backticks. Maybe this is the
reason for above error?

> Now, if only there's a way to get yahoo attach the files as text, instead of
> octet-stream :-(

That's ok for me, but Matt likes patches directly in the text more.

Thomas

-- 
Email: thomas at intevation.de
http://intevation.de/~thomas/


More information about the Mercurial mailing list