public class CliContext
CliContext | Initializes a new instance of the CliContext class. |
CancellationToken | Gets the token to implement cancellation handling. Available for async command handlers. |
Error | Gets the standard error, to which error information should be written during the current invocation. By default, it's set to Error, it's changed via Error. |
Output | Gets the standard output, to which non-error information should be written during the current invocation. By default, it's set to Out, it's changed via Output. |
Result | Gets the result providing details about the parse operation and methods for binding. |
IsEmpty |
Gets a value indicating whether current command and all its parents are specified without any subcommands, directives, options or arguments.
Note that arguments and options should be optional, if they are required (no default values), then handler will not run and missing error message will be shown. |
IsEmptyCommand |
Gets a value indicating whether current command is specified without any arguments or options.
Note that this may return even if any arguments or options were specified for parent commands. because only arguments or options specified for the current command, are checked. Note that arguments and options should be optional, if they are required (no default values), then handler will not run and missing error message will be shown. |
ShowHelp | Shows help for current command. |
ShowHierarchy | Shows hierarchy for all commands. It will start from the root command and show a tree. Useful for testing a command. |
ShowValues | Shows parsed values for current command and its arguments and options. Useful for testing a command. |