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

Re: PATCH _uscan update options



Christopher Bock wrote:
> > After 20 years some things are bound to change :P
> and of course i only see the problems after i send it /ö\

Thanks for this.

>    '(--pasv --no-pasv)--no-pasv[do not use passive mode for ftp]' \
>    '(--symlink --no-symlink)--symlink[make orig.tar.gz symlinks]' \

I'm commenting on an unchanged lines of context here so this is not
something you're introducing. However, there's no need for an option
to exclude itself. That happens by default and you need a * prefix for
repeatable options.

    '(--symlink --no-symlink)--symlink[make orig.tar.gz symlinks]'

Such explicit self-exclusions are harmless other than making the line
longer and do often occur as a side-effect of using brace expansion
where options have alternative names.

> +  '--timeout[specify request timeout (default 20)]:timeout:_numbers -u seconds' \

Where there's a default, pass it to _numbers with the -d option and
don't include it in the option description, e.g.

  '--timeout[specify request timeout]:timeout:_numbers -u seconds -d 20'

This puts the default in the match heading and applies whatever
formatting and attributes/colours have been configured.

> +  '(--download -d)'{--download,-d}'[download new upstream release(default)]' \
> +  '(--signature --no-signature --skip-signature)--signature[download signature and verify (default)]' \
> +  '(--dehs --no-dehs)--no-dehs[use traditional output (default)]' \

It requires a certain amount of judgement about the particular case but
usually, where options only assert the defaults, I avoid having them
bloat out the completion option lists. It is still good to include them
so that we know the option was not forgotten. Prefixing with ! does
this. And you can even include the exclusion list, e.g:

  '!(--no-signature --skip-signature)--signature'

Sometimes a command lets you can configure the defaults and if you think
this is likely to be common you might choose not to do this.

Oliver




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