Argu


ParseResults<'Template> Type

Namespace: Argu

Assembly: Argu.dll

Base Type: obj

All Interfaces: IComparable , IParseResult

Argument parsing result holder.

Instance members

Instance member Description

this.Catch(f, ?errorCode, ?showUsage)

Full Usage: this.Catch(f, ?errorCode, ?showUsage)

Parameters:
    f : unit -> 'T - The operation to be executed.
    ?errorCode : ErrorCode - The error code to be returned.
    ?showUsage : bool - Print usage together with error message.

Returns: 'T

Handles any raised exception through the argument parser's exiter mechanism. Display usage optionally.

f : unit -> 'T

The operation to be executed.

?errorCode : ErrorCode

The error code to be returned.

?showUsage : bool

Print usage together with error message.

Returns: 'T

this.Contains(expr, ?source)

Full Usage: this.Contains(expr, ?source)

Parameters:
    expr : Expr<('Fields -> 'Template)> - The name of the parameter, expressed as quotation of DU constructor.
    ?source : ParseSource - Optional source restriction: AppSettings or CommandLine.

Returns: bool

Checks if parameter of specific kind has been specified.

expr : Expr<('Fields -> 'Template)>

The name of the parameter, expressed as quotation of DU constructor.

?source : ParseSource

Optional source restriction: AppSettings or CommandLine.

Returns: bool

this.Contains(expr, ?source)

Full Usage: this.Contains(expr, ?source)

Parameters:
    expr : Expr<'Template> - The name of the parameter, expressed as quotation of DU constructor.
    ?source : ParseSource - Optional source restriction: AppSettings or CommandLine.

Returns: bool

Checks if parameter of specific kind has been specified.

expr : Expr<'Template>

The name of the parameter, expressed as quotation of DU constructor.

?source : ParseSource

Optional source restriction: AppSettings or CommandLine.

Returns: bool

this.ErrorHandler

Full Usage: this.ErrorHandler

Returns: IExiter

Returns: IExiter

this.GetAllResults(?source)

Full Usage: this.GetAllResults(?source)

Parameters:
    ?source : ParseSource - Optional source restriction: AppSettings or CommandLine.

Returns: 'Template list

Gets all parse results.

?source : ParseSource

Optional source restriction: AppSettings or CommandLine.

Returns: 'Template list

this.GetResult(expr, ?defaultValue, ?source)

Full Usage: this.GetResult(expr, ?defaultValue, ?source)

Parameters:
    expr : Expr<('Fields -> 'Template)> - The name of the parameter, expressed as quotation of DU constructor.
    ?defaultValue : 'Fields - Return this of no parameter of specific kind has been specified.
    ?source : ParseSource - Optional source restriction: AppSettings or CommandLine.

Returns: 'Fields

Returns the *last* specified parameter of given type. Command line parameters have precedence over AppSettings parameters.

expr : Expr<('Fields -> 'Template)>

The name of the parameter, expressed as quotation of DU constructor.

?defaultValue : 'Fields

Return this of no parameter of specific kind has been specified.

?source : ParseSource

Optional source restriction: AppSettings or CommandLine.

Returns: 'Fields

this.GetResult(expr, ?defaultValue, ?source)

Full Usage: this.GetResult(expr, ?defaultValue, ?source)

Parameters:
    expr : Expr<'Template> - The name of the parameter, expressed as quotation of DU constructor.
    ?defaultValue : 'Template - Return this of no parameter of specific kind has been specified.
    ?source : ParseSource - Optional source restriction: AppSettings or CommandLine.

Returns: 'Template

Returns the *last* specified parameter of given type. Command line parameters have precedence over AppSettings parameters.

expr : Expr<'Template>

The name of the parameter, expressed as quotation of DU constructor.

?defaultValue : 'Template

Return this of no parameter of specific kind has been specified.

?source : ParseSource

Optional source restriction: AppSettings or CommandLine.

Returns: 'Template

this.GetResults(expr, ?source)

Full Usage: this.GetResults(expr, ?source)

Parameters:
    expr : Expr<('Fields -> 'Template)> - The name of the parameter, expressed as quotation of DU constructor.
    ?source : ParseSource - Optional source restriction: AppSettings or CommandLine.

Returns: 'Fields list

Query parse results for argument with parameters.

expr : Expr<('Fields -> 'Template)>

The name of the parameter, expressed as quotation of DU constructor.

?source : ParseSource

Optional source restriction: AppSettings or CommandLine.

Returns: 'Fields list

this.GetResults(expr, ?source)

Full Usage: this.GetResults(expr, ?source)

Parameters:
    expr : Expr<'Template> - The name of the parameter, expressed as quotation of DU constructor.
    ?source : ParseSource - Optional source restriction: AppSettings or CommandLine.

Returns: 'Template list

Query parse results for parameterless argument.

expr : Expr<'Template>

The name of the parameter, expressed as quotation of DU constructor.

?source : ParseSource

Optional source restriction: AppSettings or CommandLine.

Returns: 'Template list

this.GetSubCommand()

Full Usage: this.GetSubCommand()

Returns: 'Template

Attempts to recover the subcommand parameter from the results, if one has been specified.

Returns: 'Template

this.IsUsageRequested

Full Usage: this.IsUsageRequested

Returns: bool

Returns true if '--help' parameter has been specified in the command line.

Returns: bool

this.IterResult(expr, iterator, ?source)

Full Usage: this.IterResult(expr, iterator, ?source)

Parameters:
    expr : Expr<('Field -> 'Template)> - The name of the parameter, expressed as quotation of DU constructor.
    iterator : 'Field -> unit - The iterator body.
    ?source : ParseSource - Option source restriction: AppSettings or CommandLine.

Iterates through the *last* parse result for a given argument kind. Command line parameters have precedence over AppSettings parameters. Results are passed to an iterator function that is error handled by the parser.

expr : Expr<('Field -> 'Template)>

The name of the parameter, expressed as quotation of DU constructor.

iterator : 'Field -> unit

The iterator body.

?source : ParseSource

Option source restriction: AppSettings or CommandLine.

this.IterResults(expr, iterator, ?source)

Full Usage: this.IterResults(expr, iterator, ?source)

Parameters:
    expr : Expr<('Field -> 'Template)> - The name of the parameter, expressed as quotation of DU constructor.
    iterator : 'Field -> unit - The iterator body.
    ?source : ParseSource - Option source restriction: AppSettings or CommandLine.

Iterates through *all* parse results for a given argument kind. Command line parameters have precedence over AppSettings parameters. Results are passed to an iterator function that is error handled by the parser.

expr : Expr<('Field -> 'Template)>

The name of the parameter, expressed as quotation of DU constructor.

iterator : 'Field -> unit

The iterator body.

?source : ParseSource

Option source restriction: AppSettings or CommandLine.

this.PostProcessResult(expr, parser, ?source)

Full Usage: this.PostProcessResult(expr, parser, ?source)

Parameters:
    expr : Expr<('Field -> 'Template)> - The name of the parameter, expressed as quotation of DU constructor.
    parser : 'Field -> 'R - The post-processing parser.
    ?source : ParseSource - Optional source restriction: AppSettings or CommandLine.

Returns: 'R

Returns the *last* specified parameter of given type. Command line parameters have precedence over AppSettings parameters. Results are passed to a post-processing function that is error handled by the parser.

expr : Expr<('Field -> 'Template)>

The name of the parameter, expressed as quotation of DU constructor.

parser : 'Field -> 'R

The post-processing parser.

?source : ParseSource

Optional source restriction: AppSettings or CommandLine.

Returns: 'R

this.PostProcessResults(expr, parser, ?source)

Full Usage: this.PostProcessResults(expr, parser, ?source)

Parameters:
    expr : Expr<('Field -> 'Template)> - The name of the parameter, expressed as quotation of DU constructor.
    parser : 'Field -> 'R - The post-processing parser.
    ?source : ParseSource - Optional source restriction: AppSettings or CommandLine.

Returns: 'R list

Query parse results for given argument kind. Command line parameters have precedence over AppSettings parameters. Results are passed to a post-processing function that is error handled by the parser.

expr : Expr<('Field -> 'Template)>

The name of the parameter, expressed as quotation of DU constructor.

parser : 'Field -> 'R

The post-processing parser.

?source : ParseSource

Optional source restriction: AppSettings or CommandLine.

Returns: 'R list

this.Raise(error, ?errorCode, ?showUsage)

Full Usage: this.Raise(error, ?errorCode, ?showUsage)

Parameters:
    error : exn - The error to be displayed.
    ?errorCode : ErrorCode - The error code to be returned.
    ?showUsage : bool - Print usage together with error message.

Returns: 'T

Raise an error through the argument parser's exiter mechanism. Display usage optionally.

error : exn

The error to be displayed.

?errorCode : ErrorCode

The error code to be returned.

?showUsage : bool

Print usage together with error message.

Returns: 'T

this.Raise(msg, ?errorCode, ?showUsage)

Full Usage: this.Raise(msg, ?errorCode, ?showUsage)

Parameters:
    msg : string - The error message to be displayed.
    ?errorCode : ErrorCode - The error code to be returned.
    ?showUsage : bool - Print usage together with error message.

Returns: 'T

Raise an error through the argument parser's exiter mechanism. Display usage optionally.

msg : string

The error message to be displayed.

?errorCode : ErrorCode

The error code to be returned.

?showUsage : bool

Print usage together with error message.

Returns: 'T

this.TryGetResult(expr, ?source)

Full Usage: this.TryGetResult(expr, ?source)

Parameters:
    expr : Expr<('Fields -> 'Template)> - The name of the parameter, expressed as quotation of DU constructor.
    ?source : ParseSource - Optional source restriction: AppSettings or CommandLine.

Returns: 'Fields option

Returns the *last* specified parameter of given type, if it exists. Command line parameters have precedence over AppSettings parameters.

expr : Expr<('Fields -> 'Template)>

The name of the parameter, expressed as quotation of DU constructor.

?source : ParseSource

Optional source restriction: AppSettings or CommandLine.

Returns: 'Fields option

this.TryGetResult(expr, ?source)

Full Usage: this.TryGetResult(expr, ?source)

Parameters:
    expr : Expr<'Template> - The name of the parameter, expressed as quotation of DU constructor.
    ?source : ParseSource - Optional source restriction: AppSettings or CommandLine.

Returns: 'Template option

Returns the *last* specified parameter of given type, if it exists. Command line parameters have precedence over AppSettings parameters.

expr : Expr<'Template>

The name of the parameter, expressed as quotation of DU constructor.

?source : ParseSource

Optional source restriction: AppSettings or CommandLine.

Returns: 'Template option

this.TryGetSubCommand()

Full Usage: this.TryGetSubCommand()

Returns: 'Template option

Attempts to recover the subcommand parameter from the results, if one has been specified.

Returns: 'Template option

this.TryPostProcessResult(expr, parser, ?source)

Full Usage: this.TryPostProcessResult(expr, parser, ?source)

Parameters:
    expr : Expr<('Field -> 'Template)> - The name of the parameter, expressed as quotation of DU constructor.
    parser : 'Field -> 'R - The post-processing parser.
    ?source : ParseSource - Optional source restriction: AppSettings or CommandLine.

Returns: 'R option

Returns the *last* specified parameter of given type. Command line parameters have precedence over AppSettings parameters. Results are passed to a post-processing function that is error handled by the parser.

expr : Expr<('Field -> 'Template)>

The name of the parameter, expressed as quotation of DU constructor.

parser : 'Field -> 'R

The post-processing parser.

?source : ParseSource

Optional source restriction: AppSettings or CommandLine.

Returns: 'R option

this.UnrecognizedCliParams

Full Usage: this.UnrecognizedCliParams

Returns: string list

Gets all unrecognized CLI parameters which accumulates if parsed with 'ignoreUnrecognized = true'

Returns: string list

this.UnrecognizedCliParseResults

Full Usage: this.UnrecognizedCliParseResults

Returns: obj list

Gets all parse results that are not part of the current parsing context This is only applicable to subcommand parsing operations

Returns: obj list