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

Re: [PATCH] Completion batch #2: Misc. trivial fixes



dana wrote:
> 2. I updated `expand` and `unexpand` completion to account for numeric options
>    as in `expand -4` (instead of `expand -t4`); most variants support this. I

> +# Most (un)expand variants, excluding BusyBox, allow e.g. -4 instead of -t4
> +[[ $_cmd_variant[$service] == *busybox* ]] ||

Digging around in $_cmd_variant is essentially looking into the
internals of _pick_variant. The documented interface is to use the -r
option to _pick_variant. Also, it is not saving the full output of
expand --version, it will either have the value "gnu" or "unix". This
needs to do something like:
  local variant
  _pick_variant -r variant gnu="Free Soft" busybox=busybox unix --version

> +args+=( '!(-0 -1 -2 -3 -4 -5 -6 -7 -8 -9 -t --tabs)-'{0..9} )

Given that these are hidden options, excluding other numeric options is
pointless. It is also arguably wrong because the tab width can be more
than 9 characters wide: e.g. expand -20 is valid.

I've applied the patch in full because it is probably easier that way.



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