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

Re: PATCH: list units in brackets at the end of completion group descriptions



On 8/27/21, Oliver Kiddle <opk@xxxxxxx> wrote:
> Continuing with the bulk completion fixups for single issues, this
> applies the convention of units in round brackets at the end of the
> per-group descriptions just before the defaults I was adding in 49156
> in square brackets. There aren't so many here because this is harder to
> grep for and we mostly already do this consistently. For anyone writing
> completions (or --help output), I'd recommend always considering units
> and defaults because it's not always obvious.
>
> There might be some more useful way we might indicate where suffixes can
> be appended to a value to denote units. Completing them after a number
> doesn't really make the options clear before a number has been entered.
> Perhaps an initial slash, e.g. 'timeout (seconds) [5] /ms /us /ns'
>
> As I've alluded to before, with consistent forms, _description could
> parse these and allow formatting for these components to be configured.
> But how often do we put random comments in brackets in descriptions or
> other things that would break this? Yet more backslashes will be ugly.
>
> Oliver
>
> diff --git Completion/Debian/Command/_dak Completion/Debian/Command/_dak
> index 8ecfd84b3..9976c7371 100644
> --- Completion/Debian/Command/_dak
> +++ Completion/Debian/Command/_dak
> @@ -207,7 +207,7 @@ case $cmd in
>
>  (poolize)
>      args+=(
> -  '(-l --limit)'{-l,--limit=}'[only migrate amount of packages]:amount in
> kb:'
> +  '(-l --limit)'{-l,--limit=}'[only migrate amount of packages]:amount
> (kb)'
>    '(-n --no-action)'{-n,--no-action}'[do not do anything]'
>    '(-v --verbose)'{-v,--verbose}'[explain what is being done]'
>      )
> diff --git Completion/Mandriva/Command/_urpmi
> Completion/Mandriva/Command/_urpmi
> index 9ab9e45b7..be6350129 100644
> --- Completion/Mandriva/Command/_urpmi
> +++ Completion/Mandriva/Command/_urpmi
> @@ -73,7 +73,7 @@ _urpmi() {
>
>    opts_net=(
>      "($help --wget)--curl[use curl to retrieve distant files]"
> -    "($help)--limit-rate[limit the download speed (b/s)]:download speed in
> b/s: "
> +    "($help)--limit-rate[limit the download speed]:download speed (b/s)"
>      "($help)--proxy:proxy host:_hosts"
>      "($help)--proxy-user:proxy user:_users"
>      "($help --curl)--wget[use wget to retrieve distant files]"
> diff --git Completion/Unix/Command/_dropbox
> Completion/Unix/Command/_dropbox
> index 115f9eb45..45c77ae09 100644
> --- Completion/Unix/Command/_dropbox
> +++ Completion/Unix/Command/_dropbox
> @@ -55,8 +55,8 @@ else
>
>      (throttle)
>      _arguments \
> -      '2:download limit in KB/s:(unlimited)' \
> -      '3:upload limit in KB/s:(unlimited)'
> +      '2:download limit (KB/s):(unlimited)' \
> +      '3:upload limit (KB/s):(unlimited)'
>      ;;
>
>      (*)

some inconsistencies here with kilos and bytes, it should always be kB
although I doubt anyone would ever think kilobits or kelvinbytes are
refered to in these contexts. The urpmi one should probably be spelled
out as bytes/s or B/s though (somehow it feels less clear to me
without the kilo). Perhaps worth a separate batch cleanup.

-- 
Mikael Magnusson




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