Argu


ArgumentParser

Namespace: Argu

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 memberDescription
Accept(visitor)
Signature: visitor:IArgumentParserVisitor<'R> -> 'R
Modifiers: abstract
Type parameters: 'R

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

ErrorHandler
Signature: IExiter

Gets the default error handler used by the instance

CompiledName: get_ErrorHandler

GetArgumentCases()
Signature: unit -> ArgumentCaseInfo list

Gets metadata for all union cases used by parser

GetSubCommandParsers()
Signature: unit -> ArgumentParser list

Gets all subcommand parsers for given parser

HelpDescription
Signature: string

Gets the help description specified for the CLI parser

CompiledName: get_HelpDescription

HelpFlags
Signature: string list

Gets the help flags specified for the CLI parser

CompiledName: get_HelpFlags

HelpTextMessage
Signature: string option

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

CompiledName: get_HelpTextMessage

IsSubCommandParser
Signature: bool

Returns true if parser corresponds to a subcommand

CompiledName: get_IsSubCommandParser

ParentInfo
Signature: ArgumentCaseInfo option

If subcommand parser, gets parent argument metadata

CompiledName: get_ParentInfo

PrintCommandLineSyntax(...)
Signature: (programName:string option * usageStringCharacterWidth:int option) -> string

Prints command line syntax. Useful for generating documentation.

PrintUsage(...)
Signature: (message:string option * programName:string option * hideSyntax:bool option * usageStringCharacterWidth:int option) -> string

Formats a usage string for the argument parser.

Static members

Static memberDescription
Create(...)
Signature: (programName:string option * helpTextMessage:string option * usageStringCharacterWidth:int option * errorHandler:IExiter option) -> ArgumentParser<'Template>
Type parameters: 'Template

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

Fork me on GitHub