Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -173,7 +173,17 @@ internal void AddToArgumentList(CommandParameterInternal parameter, string argum
{
if (argument != parameter.ParameterText)
{
_argumentList.Add(parameter.ParameterText + argument);
// Only combine the text and argument if there was no space after the parameter,
// otherwise, add the parameter and arguments as separate elements.
if (parameter.SpaceAfterParameter)
{
_argumentList.Add(parameter.ParameterText);
_argumentList.Add(argument);
}
else
{
_argumentList.Add(parameter.ParameterText + argument);
}
}
}
else
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -239,6 +239,14 @@ foreach ( $argumentListValue in "Standard","Legacy","Windows" ) {
$lines[1] | Should -BeExactly "Arg 1 is <com:port=\\devbox\pipe\debug,pipe,resets=0,reconnect>"
}

It "Should handle when the ':' is the parameter value" {
$lines = testexe -echoargs awk -F: '{print $1}'
$lines.Count | Should -Be 3
$lines[0] | Should -BeExactly 'Arg 0 is <awk>'
$lines[1] | Should -BeExactly 'Arg 1 is <-F:>'
$lines[2] | Should -BeExactly 'Arg 2 is <{print $1}>'
}

It "Should handle DOS style arguments" {
$lines = testexe -echoargs /arg1 /c:"a string"
$lines.Count | Should -Be 2
Expand Down