Argu icon indicating copy to clipboard operation
Argu copied to clipboard

Make a main command optional in subcommand

Open UnoSD opened this issue 2 years ago • 0 comments

Description

type ShowArgs =
    // Can't make this non-mandatory
    | [<First;Unique;MainCommand>]Args of filter : string
with interface IArgParserTemplate with member this.Usage = ""

type XPasswdArgs =
    | [<First;ExactlyOnce;MainCommand>]Database of database : string
    | [<CliPrefix(CliPrefix.None)>]    Show     of ParseResults<ShowArgs>

Repro steps

  1. xpasswd database show filter (works)

  2. xpasswd database show (missing argument "filter", despite not being mandatory)

Expected behavior

Please provide a description of the behavior you expect.

Actual behavior

Non-mandatory subcommand main command should be optional

Known workarounds

None

Related information

  • Operating system Linux
  • Branch Latest NuGet
  • .NET Runtime, CoreCLR or Mono Version .NET Core 7

UnoSD avatar May 11 '23 21:05 UnoSD