Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Make a main command optional in subcommand #183

Open
UnoSD opened this issue May 11, 2023 · 0 comments
Open

Make a main command optional in subcommand #183

UnoSD opened this issue May 11, 2023 · 0 comments

Comments

@UnoSD
Copy link

UnoSD commented May 11, 2023

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
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants