argparse documentation Help

Param / RawParam

Parsing customization API works with Param/RawParam struct under the hood which is publicly available for usage.

Param is a template struct parametrized by VALUE_TYPE (see below) which is usually a string[] or a type of destination data member.

Param struct has the following fields:

  • const(Config)* config - The content is almost the same as the Config object that was passed into CLI API. The only difference is in Config.stylingMode - it is either Config.StylingMode.on or Config.StylingMode.off based on auto-detection results.

  • string name – For named argument, it contains a name that is specified in command line exactly including prefix(es) (Config.namedArgPrefix). For positional arguments, it contains placeholder value.

  • VALUE_TYPE value – Argument values that are provided in command line.

Last modified: 07 August 2024