Skip to content

ICommandLineParser Interface

Provides the command-line arguments.

MethodDescription
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.
PropertyDescription
ErrorArgumentGets 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.

public string GetArgumentAsFilePathOrError(
string argument,
string fileType
)
ParameterTypeDescription
argumentstringCurrent argument used in the error message if necessary.
fileTypestringType of file displayed in the error message if necessary.

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.

public string GetNextArgumentAsDirectoryOrError(
string argument
)
ParameterTypeDescription
argumentstringCurrent argument used in the error message if necessary.

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.

public string GetNextArgumentAsFilePathOrError(
string argument,
string filePurpose
)
ParameterTypeDescription
argumentstringCurrent argument used in the error message if necessary.
filePurposestringPurpose of the required file.

string The fully expanded path if the argument is a file path, otherwise null.

Gets the next argument or displays error if no argument is available.

public string GetNextArgumentOrError(
string argument
)
ParameterTypeDescription
argumentstringCurrent argument used in the error message if necessary.

string The next argument if present or null

Validates that a valid switch (starts with ”/” or ”-”), and returns a bool indicating its validity

public bool IsSwitch(
string argument
)
ParameterTypeDescription
argumentstringThe string check.

bool True if a valid switch, otherwise false.

Looks ahead to the next argument without moving to the next argument.

public string PeekNextArgument()

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.

public void ReportErrorArgument(
string argument,
WixToolset.Data.Message message
)
ParameterTypeDescription
argumentstringArgument that caused the error.
messageWixToolset.Data.MessageMessage to report.

Gets the argument that caused the error.

public string ErrorArgument { get; set; }