commandr.program

Program data model

This module along with commandr.option contains all types needed to build your program model - program options, flags, arguments and all subcommands.

After creating your program model, you can use it to: - parse the arguments with parse or parseArgs - print help with printHelp or just the usage with printUsage - create completion script with createBashCompletionScript

Members

Classes

Command
class Command

Represents a command.

InvalidProgramException
class InvalidProgramException

Thrown when program definition contains error.

Program
class Program

Represents program.

Examples

1 auto program = new Program("grit")
2        .add(new Flag("v", "verbose", "verbosity"))
3        .add(new Command("branch", "branch management")
4            .add(new Command("add", "adds branch")
5                .add(new Argument("name"))
6            )
7            .add(new Command("rm", "removes branch")
8                .add(new Argument("name"))
9            )
10        )
11     ;

See Also

Command, Program, parse

Meta