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