Re: [hackers] [ubase][PATCH] hwclock: [-rsw] => (-r | -s | -w) and fix flag check

From: Mattias Andrée <maandree_AT_kth.se>
Date: Fri, 22 Apr 2016 11:54:46 +0200

On Fri, 22 Apr 2016 10:15:38 +0100
Dimitris Papastamos <sin_AT_2f30.org> wrote:

> Ok, so when you have (-a | -b) it means that flag choice
> is not optional.
>
> Can we avoid trying to express valid flag combos in a
> single line and instead use multiple usage lines? In
> some cases, like in hwclock it is not a major issue and
> this can be left as is.
>
> If people are in doubt they can refer to the manpage.
>
> My only concern is that this () pattern is not as
> wide-spread and confuses people.
>
> If others agree, we should sweep core existing core tools
> that use () and rework them.

I believe that () shall be used when and only when it is
easier to express it syntax (). For example

  (-a | -b | -c) (-A | -B | -C)

rather than

  -a -A
  -a -B
  -a -C
  -b -A
  -b -B
  -b -C
  -c -A
  -c -B
  -c -C

But

  -a [-xyz]
  -b [-XYZ]
  -c [-ABC]

rather than

  (-a [-xyz]) | (-b [-XYZ]) | (-c [-ABC])


Received on Fri Apr 22 2016 - 11:54:46 CEST

This archive was generated by hypermail 2.3.0 : Fri Apr 22 2016 - 12:00:20 CEST