Subject: bug#66358: Some options are really subcommands + ignore arguments

From: Maxim Cournoyer <[email-masked]>
Date: Tue, 24 Oct 2023 10:48:18 -0400

Hi Simon,

Simon Tournier <[email-masked]> writes:

> Hi,
>
> On Mon, 09 Oct 2023 at 14:25, Tobias Geerinckx-Rice via Bug reports
> for GNU Guix <[email-masked]> wrote:
>
>> I think it would be less surprising if these ‘single, mutually exclusive 
>> actions’ should always be (sub)subcommands, e.g., ‘guix archive import’, 
>> ‘guix archive authorize’, …
>
> I am proposing to error for ambiguous cases as,
>
>     $ ./pre-inst-env guix archive --import --authorize hello < /tmp/hello.nar
>     guix archive: error: ambiguous options: "authorize" with "import"
>
> See attached patch.  WDYT?
>
> Please note that it errors when at least 2 options are ambiguous.  So if
> there is 3, you get the “two first ones“.

It seems a reasonable improvement to me, but I think *all* the
incompatible errors should be accumulated and printed in one go.

-- 
Thanks,
Maxim