ProgramArgs

Parsed program/command arguments.

Note: All functions here work on flag/option/argument names, not short or long names. option -> options multi names commands

Members

Aliases

args
alias args = argAll

Gets all argument values.

flag
alias flag = hasFlag

Checks for flag value.

options
alias options = optionAll

Gets all option values.

Functions

arg
string arg(string name, string defaultValue = null)

Gets argument value.

argAll
string[] argAll(string name, string[] defaultValue = null)

Gets all argument values.

command
ProgramArgs command()

Gets subcommand arguments.

hasFlag
bool hasFlag(string name)

Checks for flag value.

occurencesOf
int occurencesOf(string name)

Gets number of flag occurences.

on
typeof(this) on(string command, scope void delegate(ProgramArgs args) handler)

Calls handler if user specified command subcommand.

option
string option(string name, string defaultValue = null)

Gets option value.

optionAll
string[] optionAll(string name, string[] defaultValue = null)

Gets all option values.

parent
ProgramArgs parent()

Gets parent ProgramArgs, if any.

Variables

name
string name;

Program or command name

Meta