Header menu logo Argu

ArgumentParser Type

The Argu type generates an argument parser given a type argument that is an F# discriminated union. It can then be used to parse command line arguments or XML configuration.

Instance members

Instance member Description

this.Accept

Full Usage: this.Accept

Parameters:
Returns: 'R
Modifiers: abstract
Type parameters: 'R

Enables access to the typed API of an ArgumentParser when template type is unknown.

visitor : IArgumentParserVisitor<'R>

Visitor used to access the parser.

Returns: 'R

this.ErrorHandler

Full Usage: this.ErrorHandler

Returns: IExiter

Gets the default error handler used by the instance

Returns: IExiter

this.GetArgumentCases

Full Usage: this.GetArgumentCases

Returns: ArgumentCaseInfo list

Gets metadata for all union cases used by parser

Returns: ArgumentCaseInfo list

this.GetSubCommandParsers

Full Usage: this.GetSubCommandParsers

Returns: ArgumentParser list

Gets all subcommand parsers for given parser

Returns: ArgumentParser list

this.HelpDescription

Full Usage: this.HelpDescription

Returns: string

Gets the help description specified for the CLI parser

Returns: string

this.HelpFlags

Full Usage: this.HelpFlags

Returns: string list

Gets the help flags specified for the CLI parser

Returns: string list

this.HelpTextMessage

Full Usage: this.HelpTextMessage

Returns: string option

Gets the message that will be displayed at the top of the help text

Returns: string option

this.IsSubCommandParser

Full Usage: this.IsSubCommandParser

Returns: bool

Returns true if parser corresponds to a subcommand

Returns: bool

this.ParentInfo

Full Usage: this.ParentInfo

Returns: ArgumentCaseInfo option

If subcommand parser, gets parent argument metadata

Returns: ArgumentCaseInfo option

this.PrintCommandLineSyntax

Full Usage: this.PrintCommandLineSyntax

Parameters:
    ?programName : string - Program name identifier placed at start of syntax string
    ?usageStringCharacterWidth : int - Text width used when formatting the usage string.

Returns: string

Prints command line syntax. Useful for generating documentation.

?programName : string

Program name identifier placed at start of syntax string

?usageStringCharacterWidth : int

Text width used when formatting the usage string.

Returns: string

this.PrintUsage

Full Usage: this.PrintUsage

Parameters:
    ?message : string - The message to be displayed on top of the usage string.
    ?programName : string - Override the default program name settings.
    ?hideSyntax : bool - Do not display 'USAGE: [syntax]' at top of usage string. Defaults to false.
    ?usageStringCharacterWidth : int - Text width used when formatting the usage string.

Returns: string

Formats a usage string for the argument parser.

?message : string

The message to be displayed on top of the usage string.

?programName : string

Override the default program name settings.

?hideSyntax : bool

Do not display 'USAGE: [syntax]' at top of usage string. Defaults to false.

?usageStringCharacterWidth : int

Text width used when formatting the usage string.

Returns: string

Static members

Static member Description

ArgumentParser.Create(?programName, ?helpTextMessage, ?usageStringCharacterWidth, ?errorHandler, ?checkStructure)

Full Usage: ArgumentParser.Create(?programName, ?helpTextMessage, ?usageStringCharacterWidth, ?errorHandler, ?checkStructure)

Parameters:
    ?programName : string - Program identifier, e.g. 'cat'. Defaults to the current executable name.
    ?helpTextMessage : string - Message that will be displayed at the top of the help text.
    ?usageStringCharacterWidth : int - Text width used when formatting the usage string. Defaults to 80 chars.
    ?errorHandler : IExiter - The implementation of IExiter used for error handling. Exception is default.
    ?checkStructure : bool - Indicate if the structure of the arguments discriminated union should be checked for errors.

Returns: ArgumentParser<'Template>

Create a new argument parsing scheme using given 'Template type which must be an F# Discriminated Union.

?programName : string

Program identifier, e.g. 'cat'. Defaults to the current executable name.

?helpTextMessage : string

Message that will be displayed at the top of the help text.

?usageStringCharacterWidth : int

Text width used when formatting the usage string. Defaults to 80 chars.

?errorHandler : IExiter

The implementation of IExiter used for error handling. Exception is default.

?checkStructure : bool

Indicate if the structure of the arguments discriminated union should be checked for errors.

Returns: ArgumentParser<'Template>

Type something to start searching.