-
manually parsing
-
system.commandline.dragonfruit
https://github.com/dotnet/command-line-api/wiki/DragonFruit-overview
this is now just system.commandline https://learn.microsoft.com/en-us/dotnet/standard/commandline/get-started-tutorial
- NuGet CommandLineParser https://github.com/commandlineparser/commandline Define verb commands similar to git commit -a
[Verb("add", HelpText = "Add file contents to the index.")]
class AddOptions {
//normal options here
}
[Verb("commit", HelpText = "Record changes to the repository.")]
class CommitOptions {
//commit options here
}
[Verb("clone", HelpText = "Clone a repository into a new directory.")]
class CloneOptions {
//clone options here
}
int Main(string[] args) {
return CommandLine.Parser.Default.ParseArguments<AddOptions, CommitOptions, CloneOptions>(args)
.MapResult(
(AddOptions opts) => RunAddAndReturnExitCode(opts),
(CommitOptions opts) => RunCommitAndReturnExitCode(opts),
(CloneOptions opts) => RunCloneAndReturnExitCode(opts),
errs => 1);
}