You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
This repository was archived by the owner on Jan 2, 2021. It is now read-only.
Patrik edited this page Nov 15, 2017
·
9 revisions
This specification does not describe the current state of the library, but where we want it to go.
Example
Code
Definition
Execution
Help
Example
Code
publicabstractclassFooSettings{[CommandOption("-f|--foo [FOO]")][Description("Sets the foo.")]publicstringFoo{get;set;}}publicabstractclassBarSettings:FooSettings{[CommandOption("-b|--bar <BAR>")][Description("Resets the bar.")]publicstringBar{get;set;}}publicsealedclassQuxSettings:BarSettings{[CommandArgument(0,"<QUX>")][DefaultValue(1)][Description("The flux capacitor threshold.")]publicintQux{get;set;}}[Description("Quxxes the bar and foo")]publicsealedclassQuxCommand:Command<QuxSettings>{publicintExecute(QuxSettingssettings,ILookup<string,string>remaining){return0;}}
Definition
varapp=newCommandApp();app.AddProxy<FooSettings>("foo", foo =>{foo.SetDescription("Executes the foo.")
foo.AddProxy<BarSettings>("bar", bar =>{bar.SetDescription("Performs the bar.")
bar.AddCommand<QuxCommand>("qux");});});app.Run();
> example.exe
Usage: example.exe [command]
Commands:
foo Executes the foo.
> example.exe foo --help
Usage: example.exe foo [options] [command]
Options:
-f|--foo [FOO] Sets the foo.
Commands:
bar Performs the bar
> example.exe foo bar --help
Usage: example.exe foo bar [options] [command]
Options:
-b|--bar <BAR> Resets the bar (required).
Commands:
qux Quxxes the bar and foo
> example.exe foo bar qux --help
Usage: example.exe foo bar qux <QUX>
Arguments:
<QUX> The flux capacitor threshold (required).