mirror of
https://github.com/Tyrrrz/CliFx.git
synced 2025-10-25 15:19:17 +00:00
Allow dashes to appear in parameter values
This commit is contained in:
@@ -138,7 +138,16 @@ namespace CliFx.Domain
|
|||||||
{
|
{
|
||||||
var argument = commandLineArguments[index];
|
var argument = commandLineArguments[index];
|
||||||
|
|
||||||
if (argument.StartsWith('-'))
|
var isOptionArgument =
|
||||||
|
argument.StartsWith("--", StringComparison.OrdinalIgnoreCase) &&
|
||||||
|
argument.Length > 2 &&
|
||||||
|
char.IsLetter(argument[2]) ||
|
||||||
|
argument.StartsWith('-') &&
|
||||||
|
argument.Length > 1 &&
|
||||||
|
char.IsLetter(argument[1]);
|
||||||
|
|
||||||
|
// Break on the first encountered option
|
||||||
|
if (isOptionArgument)
|
||||||
break;
|
break;
|
||||||
|
|
||||||
result.Add(new CommandParameterInput(argument));
|
result.Add(new CommandParameterInput(argument));
|
||||||
|
|||||||
Reference in New Issue
Block a user