Table of Contents

CliRunnableResult Class

Definition

Namespace
DotMake.CommandLine
Assembly
DotMake.CommandLine.dll

Describes the results of parsing a command line input based on a specific parser configuration and provides methods for binding the result to definition classes, and also for running the handler for the called command.

public class CliRunnableResult : CliResult
Inheritance
CliRunnableResult

Properties

HasArgs

Gets a value indicating whether called command is specified with any arguments or options.

Note that this may return false even if any arguments or options were specified for parent commands. because only arguments or options specified for the called 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.

(Inherited from CliResult)
HasTokens

Gets a value indicating whether root command is specified with 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.

(Inherited from CliResult)
ParseResult

Get the results of parsing a command line input based on a specific parser configuration.

(Inherited from CliResult)

Methods

BindAll()

Creates a new instance of the definition class for all contained commands (self and parents) and binds/populates the properties from the parse result.

Note that binding will be done only once per parse result and definition class, so calling this method consecutively for the same parse result and the same definition class will return the cached result.

(Inherited from CliResult)
BindCalled()

Creates a new instance of the definition class for called command and binds/populates the properties from the parse result.

Note that binding will be done only once per parse result and definition class, so calling this method consecutively for the same parse result and the same definition class will return the cached result.

(Inherited from CliResult)
Contains<TDefinition>()

Checks if the command line input contains the indicated definition class (as self or as a parent).

(Inherited from CliResult)
Create<TDefinition>()

Creates a new instance of the command definition class but without any binding. This is useful for example when you need to instantiate a definition class when using dependency injection.

(Inherited from CliResult)
IsCalled<TDefinition>()

Checks if the command line input is for the indicated definition class.

(Inherited from CliResult)
Run()

Runs the handler for the called command.

RunAsync(CancellationToken)

Runs the handler asynchronously for the called command.