0

I am seeking to use clap to derive the parsing for the following argument syntax:

program [arg1 [arg2]]

Here arg1 is optional but if present arg2 becomes possible but is optional. I am using clap for training purposes as well as to allow for growth in complexity.

George
  • 2,451
  • 27
  • 37
  • This might be a good use for [subcommands](https://docs.rs/clap/latest/clap/trait.Subcommand.html). Then it could be `program subcommand --arg $val` – MeetTitan Feb 09 '23 at 05:20

0 Answers0