ICommandLineParser Interface
Provides the command-line arguments.
Methods
Section titled “Methods”| Method | Description |
|---|---|
| GetArgumentAsFilePathOrError(argument, fileType) | Gets the current argument as a file or displays an error. |
| GetNextArgumentAsDirectoryOrError(argument) | Gets the next argument as a directory or displays an error. |
| GetNextArgumentAsFilePathOrError(argument, filePurpose) | Gets the next argument as a file or displays an error. |
| GetNextArgumentOrError(argument) | Gets the next argument or displays error if no argument is available. |
| IsSwitch(argument) | Validates that a valid switch (starts with ”/” or ”-”), and returns a bool indicating its validity |
| PeekNextArgument() | Looks ahead to the next argument without moving to the next argument. |
| ReportErrorArgument(argument, message) | Reports a command line error for the provided argument. |
Properties
Section titled “Properties”| Property | Description |
|---|---|
| ErrorArgument | Gets the argument that caused the error. |
WixToolset.Extensibility.dll version 5.0.0+41e11442b2ca93e444b60213b5ae99dcbab787d8 |
GetArgumentAsFilePathOrError(argument, fileType) Method
Section titled “GetArgumentAsFilePathOrError(argument, fileType) Method”Gets the current argument as a file or displays an error.
Declaration
Section titled “Declaration”public string GetArgumentAsFilePathOrError( string argument, string fileType)Parameters
Section titled “Parameters”| Parameter | Type | Description |
|---|---|---|
| argument | string | Current argument used in the error message if necessary. |
| fileType | string | Type of file displayed in the error message if necessary. |
Return value
Section titled “Return value”string The fully expanded path if the argument is a file path, otherwise null.
GetNextArgumentAsDirectoryOrError(argument) Method
Section titled “GetNextArgumentAsDirectoryOrError(argument) Method”Gets the next argument as a directory or displays an error.
Declaration
Section titled “Declaration”public string GetNextArgumentAsDirectoryOrError( string argument)Parameters
Section titled “Parameters”| Parameter | Type | Description |
|---|---|---|
| argument | string | Current argument used in the error message if necessary. |
Return value
Section titled “Return value”string The fully expanded path if the argument is a directory, otherwise null.
GetNextArgumentAsFilePathOrError(argument, filePurpose) Method
Section titled “GetNextArgumentAsFilePathOrError(argument, filePurpose) Method”Gets the next argument as a file or displays an error.
Declaration
Section titled “Declaration”public string GetNextArgumentAsFilePathOrError( string argument, string filePurpose)Parameters
Section titled “Parameters”| Parameter | Type | Description |
|---|---|---|
| argument | string | Current argument used in the error message if necessary. |
| filePurpose | string | Purpose of the required file. |
Return value
Section titled “Return value”string The fully expanded path if the argument is a file path, otherwise null.
GetNextArgumentOrError(argument) Method
Section titled “GetNextArgumentOrError(argument) Method”Gets the next argument or displays error if no argument is available.
Declaration
Section titled “Declaration”public string GetNextArgumentOrError( string argument)Parameters
Section titled “Parameters”| Parameter | Type | Description |
|---|---|---|
| argument | string | Current argument used in the error message if necessary. |
Return value
Section titled “Return value”string The next argument if present or null
IsSwitch(argument) Method
Section titled “IsSwitch(argument) Method”Validates that a valid switch (starts with ”/” or ”-”), and returns a bool indicating its validity
Declaration
Section titled “Declaration”public bool IsSwitch( string argument)Parameters
Section titled “Parameters”| Parameter | Type | Description |
|---|---|---|
| argument | string | The string check. |
Return value
Section titled “Return value”bool True if a valid switch, otherwise false.
PeekNextArgument() Method
Section titled “PeekNextArgument() Method”Looks ahead to the next argument without moving to the next argument.
Declaration
Section titled “Declaration”public string PeekNextArgument()Return value
Section titled “Return value”string Next argument if available, otherwise null.
ReportErrorArgument(argument, message) Method
Section titled “ReportErrorArgument(argument, message) Method”Reports a command line error for the provided argument.
Declaration
Section titled “Declaration”public void ReportErrorArgument( string argument, WixToolset.Data.Message message)Parameters
Section titled “Parameters”| Parameter | Type | Description |
|---|---|---|
| argument | string | Argument that caused the error. |
| message | WixToolset.Data.Message | Message to report. |
ErrorArgument Property
Section titled “ErrorArgument Property”Gets the argument that caused the error.
Declaration
Section titled “Declaration”public string ErrorArgument { get; set; }