Exemplo n.º 1
0
 public ValueTask <int> ShowHelp(
     [FromService] ICoconaHelpMessageBuilder helpBuilder,
     [FromService] ICoconaConsoleProvider console
     )
 {
     console.Output.Write(helpBuilder.BuildAndRenderForCurrentContext());
     return(new ValueTask <int>(129));
 }
Exemplo n.º 2
0
 public void Help([FromService] ICoconaHelpMessageBuilder helpMessageBuilder)
 {
     _console.Out.WriteLine(helpMessageBuilder.BuildAndRenderForCurrentContext());
 }
Exemplo n.º 3
0
 public void ForContext(bool optionA, [FromService] ICoconaHelpMessageBuilder helpMessageBuilder)
 {
     // Show commands help. (same as `./HelpOnDemand --help`)
     Console.WriteLine(helpMessageBuilder.BuildAndRenderForCurrentContext());
 }
Exemplo n.º 4
0
 public void ForCommand(bool optionA, [FromService] ICoconaHelpMessageBuilder helpMessageBuilder)
 {
     // Show a help for this command. (same as `./HelpOnDemand for-command --help`)
     Console.WriteLine(helpMessageBuilder.BuildAndRenderForCurrentCommand());
 }
Exemplo n.º 5
0
 public BuiltInPrimaryCommand(ICoconaConsoleProvider console, ICoconaHelpMessageBuilder helpBuilder)
 {
     _console     = console;
     _helpBuilder = helpBuilder;
 }