[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [Optional] versus <required|mandatory> parameters
From: |
Ralph Corderoy |
Subject: |
Re: [Optional] versus <required|mandatory> parameters |
Date: |
Thu, 23 Feb 2023 13:37:23 +0000 |
Hi John,
> this is something that's been eating away at me every time I've
> resorted to using square-brackets as a logical grouping mechanism;
> i.e., stuff like
>
> [[*upgrade* | *update*] *package*]
That's using [] to mean two different things so is clearly a bad idea.
:-)
> This could be interpreted in two different ways (expressed using BNF):
>
> <subcmd> := ("upgrade" | "update") <package>
> Or
> <subcmd> := ("upgrade" | "update" <package>)
I think you're answering it yourself. Use () to group. Those familiar
with grammars will understand it. The rest will probably guess. If it
gets too complex then be happy to repeat some parts rather than factor.
--
Cheers, Ralph.