Interface ArgsParserInterface

Interface for an argument parser.

interface ArgsParserInterface {
    config: ArgParserConfig;
    help: string;
    addAction(config: ActionConfig): ArgsParserInterface;
    addArgument(config: ArgConfig): ArgsParserInterface;
    addHelpAction(name?: string, alias?: string): ArgsParserInterface;
    addVersionAction(name?: string, alias?: string): ArgsParserInterface;
    parse(argv: string[]): ParsedArgumentsCollectionInterface;
}

Implemented by

Properties

The configuration of the argument parser.

help: string

The help message for the arguments.

Methods

  • Adds a help action to the parser.

    Parameters

    • Optionalname: string

      The name of the help action.

    • Optionalalias: string

      The alias of the help action.

    Returns ArgsParserInterface

    The updated parser.

  • Adds a version action to the parser.

    Parameters

    • Optionalname: string

      The name of the version action.

    • Optionalalias: string

      The alias of the version action.

    Returns ArgsParserInterface

    The updated parser.