CommandLineBuilder.AppendSwitchUnquotedIfNotNull Method

Definition

Appends the command line with a switch, without attempting to encapsulate the switch parameters with quotation marks.

Overloads

AppendSwitchUnquotedIfNotNull(String, ITaskItem)

Appends the literal parameter without trying to quote. This method appends a space to the command line (if it's not currently empty) before the switch.

AppendSwitchUnquotedIfNotNull(String, String)

Appends the literal parameter without trying to quote. This method appends a space to the command line (if it's not currently empty) before the switch.

AppendSwitchUnquotedIfNotNull(String, ITaskItem[], String)

Appends a command-line switch that takes a ITaskItem[] parameter, not quoting the individual parameters This method appends a space to the command line (if it's not currently empty) before the switch.

AppendSwitchUnquotedIfNotNull(String, String[], String)

Appends a command-line switch that takes a string[] parameter, not quoting the individual parameters This method appends a space to the command line (if it's not currently empty) before the switch.

AppendSwitchUnquotedIfNotNull(String, ITaskItem)

Appends the literal parameter without trying to quote. This method appends a space to the command line (if it's not currently empty) before the switch.

public:
 void AppendSwitchUnquotedIfNotNull(System::String ^ switchName, Microsoft::Build::Framework::ITaskItem ^ parameter);
public void AppendSwitchUnquotedIfNotNull (string switchName, Microsoft.Build.Framework.ITaskItem parameter);
member this.AppendSwitchUnquotedIfNotNull : string * Microsoft.Build.Framework.ITaskItem -> unit
Public Sub AppendSwitchUnquotedIfNotNull (switchName As String, parameter As ITaskItem)

Parameters

switchName
String

The switch to append to the command line, may not be null

parameter
ITaskItem

Switch parameter to append, not quoted. If null, this method has no effect.

Examples

See example in AppendSwitchUnquotedIfNotNull.

See the string overload version

Remarks

If the command line is not empty, then this method also appends the command line with a space, before the switch.

Applies to

AppendSwitchUnquotedIfNotNull(String, String)

Appends the literal parameter without trying to quote. This method appends a space to the command line (if it's not currently empty) before the switch.

public:
 void AppendSwitchUnquotedIfNotNull(System::String ^ switchName, System::String ^ parameter);
public void AppendSwitchUnquotedIfNotNull (string switchName, string parameter);
member this.AppendSwitchUnquotedIfNotNull : string * string -> unit
Public Sub AppendSwitchUnquotedIfNotNull (switchName As String, parameter As String)

Parameters

switchName
String

The switch to append to the command line, may not be null

parameter
String

Switch parameter to append, not quoted. If null, this method has no effect.

Examples

AppendSwitchUnquotedIfNotNull("/source:", "File Name.cs") yields /source:File Name.cs.

AppendSwitchUnquotedIfNotNull("/source:", "File Name.cs") => "/source:File Name.cs"

Remarks

If the command line is not empty, then this method also appends the command line with a space, before the switch.

Applies to

AppendSwitchUnquotedIfNotNull(String, ITaskItem[], String)

Appends a command-line switch that takes a ITaskItem[] parameter, not quoting the individual parameters This method appends a space to the command line (if it's not currently empty) before the switch.

public:
 void AppendSwitchUnquotedIfNotNull(System::String ^ switchName, cli::array <Microsoft::Build::Framework::ITaskItem ^> ^ parameters, System::String ^ delimiter);
public void AppendSwitchUnquotedIfNotNull (string switchName, Microsoft.Build.Framework.ITaskItem[] parameters, string delimiter);
member this.AppendSwitchUnquotedIfNotNull : string * Microsoft.Build.Framework.ITaskItem[] * string -> unit
Public Sub AppendSwitchUnquotedIfNotNull (switchName As String, parameters As ITaskItem(), delimiter As String)

Parameters

switchName
String

The switch to append to the command line, may not be null

parameters
ITaskItem[]

Switch parameters to append, not quoted. If null, this method has no effect.

delimiter
String

Delimiter to put between individual parameters, may not be null (may be empty)

Examples

See example in AppendSwitchUnquotedIfNotNull.

See the string[] overload version

Remarks

If the command line is not empty, then this method also appends the command line with a space, before the switch.

Applies to

AppendSwitchUnquotedIfNotNull(String, String[], String)

Appends a command-line switch that takes a string[] parameter, not quoting the individual parameters This method appends a space to the command line (if it's not currently empty) before the switch.

public:
 void AppendSwitchUnquotedIfNotNull(System::String ^ switchName, cli::array <System::String ^> ^ parameters, System::String ^ delimiter);
public void AppendSwitchUnquotedIfNotNull (string switchName, string[] parameters, string delimiter);
member this.AppendSwitchUnquotedIfNotNull : string * string[] * string -> unit
Public Sub AppendSwitchUnquotedIfNotNull (switchName As String, parameters As String(), delimiter As String)

Parameters

switchName
String

The switch to append to the command line, may not be null

parameters
String[]

Switch parameters to append, not quoted. If null, this method has no effect.

delimiter
String

Delimiter to put between individual parameters, may not be null (may be empty)

Examples

AppendSwitchUnquotedIfNotNull("/sources:", new string[] {"Alpha.cs", "Be ta.cs"}, ";") yields /sources:Alpha.cs;Be ta.cs.

AppendSwitchUnquotedIfNotNull("/sources:", new string[] {"Alpha.cs", "Be ta.cs"}, ";") => "/sources:Alpha.cs;Be ta.cs"

Remarks

If the command line is not empty, then this method also appends the command line with a space, before the switch.

Applies to