CommandParser.parse

Parses the given arguments into your command instance.

Description: This performs the full value parsing as described in CommandLineInterface.

Notes: If the argument parsing fails, your command instance and parser can be in a half-parsed state.

  1. Result!void parse(string[] args, CommandT commandInstance)
  2. Result!void parse(ArgPullParser parser, CommandT commandInstance)
    struct CommandParser(alias CommandT, alias ArgBinderInstance = ArgBinder!())
    Result!void
    parse

Parameters

parser ArgPullParser

The parser containing the argument tokens.

commandInstance CommandT

The instance of your CommandT to populate.

Return Value

Type: Result!void

A successful result (Result.isSuccess) if argument parsing and binding succeeded, otherwise a failure result with an error (Result.asFailure.error) describing what happened. This error is user-friendly.

See Also

jaster.cli.core.CommandLineInterface as it goes over everything in detail.

This project's README also goes into detail about how commands are parsed.

Meta