An extremly opinionated command line parser targeting .NET Standard 2.0.
Below is a short example of how to configure the command chain. By using some clever generic constraints, the framework guarantees that all settings associated with a command is inherited from the parent commands' settings.
usingSpectre.Cli;publicclassProgram{publicstaticintMain(string[]args){varapp=newCommandApp();app.Configure(config =>{config.AddBranch<EfSettings>("ef", ef =>{ef.SetDescription("Fake EF Core .NET Command Line Tools");ef.AddBranch<EfDatabaseSettings>("database", database =>{database.AddCommand<EfUpdateCommand>("update");database.AddCommand<EfDropCommand>("drop");});});});returnapp.Run(args);}}You can now execute the drop command like this:
./fakedotnet.exe ef --verbose database --no-color drop --startup-project "./../Foo/Foo.csproj" --dry-run
See the samples directory for more information.