Skip to content

Make a main command optional in subcommand #183

@UnoSD

Description

@UnoSD

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

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions