Zsh Mailing List Archive
Messages sorted by: Reverse Date, Date, Thread, Author

Re: _rsync duplicated options in completion

On Thu, 16 May 2002, Bart Schaefer wrote:
> The problem is that the `--' argument to _arguments is causing the
> output from `rsync --help' to be merged with the long list of options
> provided in the completion function itself.  Instead of recognizing
> that there are overlaps, every option is being presented twice.

I've discovered that the problem stems from the rsync options containing
"--foo=BAR" items (such as --ignore=FILE and --include=PATTERN) while
the options in the _rsync file only say "--foo=".  If I add a sed
command to the end of the command that invokes --help, the end of the
line looks like this:

    ... --help 2>&1|sed 's/\(--[-A-Za-z_]*=\)[-A-Za-z_]*/\1/')//\[--/

This makes the duplicated-option bug goes away.  Someone may want to
translate that into a zsh expansion pattern to avoid the call to sed.
OR, we may want to add the ability to specify an option like
"--include=PATTERN" in the _rsync file and have the PATTERN part only
show up as part of the help text, but not be included when completing
the option name.


Messages sorted by: Reverse Date, Date, Thread, Author