Command

Represents a command.

Commands contain basic information such as name, version summary as well as flags, options, arguments and sub-commands.

Program is a Command as well, thus all methods are available in Program.

Constructors

this
this(string name, string summary = null, string version_ = "1.0")

Creates new instance of Command.

Members

Functions

add
typeof(this) add(Option option)

Adds option

add
typeof(this) add(Flag flag)

Adds command flag

add
typeof(this) add(Argument argument)

Adds command argument

add
typeof(this) add(Command command)

Registers subcommand

arguments
Argument[] arguments()

Command arguments

chain
string[] chain()

Gets command chain.

commands
Command[string] commands()

Command sub-commands

defaultCommand
typeof(this) defaultCommand(string name)

Sets default command.

defaultCommand
string defaultCommand()

Gets default command

flags
Flag[] flags()

Command flags

name
typeof(this) name(string name)

Sets command name

name
string name()

Program name

options
Option[] options()

Command options

summary
typeof(this) summary(string summary)

Sets program summary (one-liner)

summary
string summary()

Program summary

version_
typeof(this) version_(string version_)

Sets command version

version_
string version_()

Program version

See Also

Program

Meta