Open
Description
In my use case, both the following invocations are expected.
$ myprog --load checkpoint.json
$ myprog process --file test.json
where the root command myprog
with the subcommand process
can be called without specifying a subcommand. Is this use-case currently supported in System.CommandLine
?
Using a code similar to the following, I get Required command was not provided
error when making the first invocation above.
using System.CommandLine;
var loadOpt = new Option<FileInfo?>("--load");
var rootCmd = new RootCommand() { loadOpt };
var fileOpt = new Option<FileInfo?>("--file");
var subCmd = new Command(name: "process") { fileOpt };
rootCmd.AddCommand(subCmd);