Table of Contents

Class ParseError

Namespace
Invex.Atom.Build.Args
Assembly
Invex.Atom.Build.dll

Represents a single error encountered while parsing command-line arguments.

public sealed record ParseError
Inheritance
object
ParseError

Examples

For the command atom Bild (a typo of a target named Build), a ParseError is created with Message = "Unknown argument 'Bild'" and SimilarCommands containing "Build".

Remarks

Instances of this record are created by the Invex.Atom.Build.Args.CommandLineArgsParser and stored on Errors. Parsing never throws or logs; errors are reported after the application host is fully constructed, so that all output can be masked for secrets.

Constructors

ParseError(string)

Represents a single error encountered while parsing command-line arguments.

public ParseError(string Message)

Parameters

Message string

A human-readable description of the parse error.

Examples

For the command atom Bild (a typo of a target named Build), a ParseError is created with Message = "Unknown argument 'Bild'" and SimilarCommands containing "Build".

Remarks

Instances of this record are created by the Invex.Atom.Build.Args.CommandLineArgsParser and stored on Errors. Parsing never throws or logs; errors are reported after the application host is fully constructed, so that all output can be masked for secrets.

Properties

ArgumentName

Gets the name of the command-line argument that caused the error, if applicable.

public string? ArgumentName { get; init; }

Property Value

string

Remarks

For example, if the --project option is missing its value, this property is set to "project". For unknown arguments, this is the raw argument as provided on the command line.

Message

A human-readable description of the parse error.

public string Message { get; init; }

Property Value

string

SimilarCommands

Gets a list of defined command (target) names that closely match the unrecognized argument.

public IReadOnlyList<string> SimilarCommands { get; init; }

Property Value

IReadOnlyList<string>

Remarks

Populated for unknown-argument errors to help users correct typos; empty for other error kinds.

SimilarParams

Gets a list of defined parameter argument names that closely match the unrecognized argument.

public IReadOnlyList<string> SimilarParams { get; init; }

Property Value

IReadOnlyList<string>

Remarks

Populated for unknown-argument errors to help users correct typos; empty for other error kinds. The names are listed without the leading -- prefix.