CompletionCommand

Command to generate shell completion scripts and to provide dynamic suggestions to them.

class CompletionCommand : Command {}

Constructors

this
this(string description)

Constructs a new CompletionCommand instance.

Inherited Members

From Command

chain
Command[] chain;

Chain of commands leading to this command.

name
string name()

Gets the name of the command.

description
Command description(string description)

Sets the description of the command

description
string description()

Gets the description of the command

findCommand
const(Command) findCommand(string name, const(Command) root)

Searches for a subcommand with the specified name.

add
Command add(Command cmd)

Adds a subcommand.

command
Command command(Command cmd)

Adds a subcommand.

add
Command add(Option option)

Adds an option.

add
Command add(Flag flag)

Adds a flag.

option
Command option(string format, string description, string defaultValue)

Adds an option or flag from formatted string.

option
Command option(string format, string description, string[] delegate(string prefix) completer)

Adds an option from formatted string with a function that provides the suggestions for its value.

option
Command option(string format, string description, string defaultValue, string[] delegate(string prefix) completer)

Adds an option from formatted string with a default value and a function that provides the suggestions for its value.

add
Command add(Argument arg)

Adds an argument.

argument
Command argument(string format, string description, string defaultValue)

Adds an argument from formatted string.

argument
Command argument(string format, string description, string[] delegate(string prefix) completer)

Adds an argument from formatted string with a function that provides the suggestions for its value.

argument
Command argument(string format, string description, string defaultValue, string[] delegate(string prefix) completer)

Adds an argument from formatted string with a default value and a function that provides the suggestions for its value.

action
Command action(int delegate(ParsedArgs) action)

Sets the action delegate to be executed for this command. The default action is to print help for the command.

usage
string usage(bool colors)

Gets the usage string for this command.

printHelp
int printHelp()

Prints help for the command.

error
void error(string description)

Prints an error message to stderr.

error
noreturn error(string description, int status)

Prints an error message to stderr and exits with status.