File tree Expand file tree Collapse file tree 2 files changed +13
-1
lines changed
Utility.CommandLine.Arguments
Utility.CommandLine.Arguments.Tests Expand file tree Collapse file tree 2 files changed +13
-1
lines changed Original file line number Diff line number Diff line change @@ -309,6 +309,18 @@ public void ParseOperands()
309
309
Assert . Equal ( "four" , test . OperandList [ 2 ] ) ;
310
310
}
311
311
312
+ /// <summary>
313
+ /// Tests the <see cref="Utility.CommandLine.Arguments.Parse(string)"/> method with a string coning a single operand
314
+ /// which contains a dash.
315
+ /// </summary>
316
+ [ Fact ]
317
+ public void ParseDashedOperand ( )
318
+ {
319
+ CommandLine . Arguments test = CommandLine . Arguments . Parse ( "hello-world" ) ;
320
+
321
+ Assert . Equal ( "hello-world" , test . OperandList [ 0 ] ) ;
322
+ }
323
+
312
324
/// <summary>
313
325
/// Tests the <see cref="Utility.CommandLine.Arguments.Parse(string)"/> method with an explicit command line string
314
326
/// containing only short parameters.
Original file line number Diff line number Diff line change @@ -130,7 +130,7 @@ public class Arguments
130
130
/// <summary>
131
131
/// The regular expression with which to parse the command line string.
132
132
/// </summary>
133
- private const string ArgumentRegEx = "(?:[-]{1,2}|\\ /)([\\ w-]+)[=|:| ]?(\\ w\\ S*|\\ \" [^\" ]*\\ \" |\\ \' [^']*\\ \' )?|([^- ([^'\\ \" ]+|\" [^\\ \" ]+\" |\\ \' [^']+\\ \' )" ;
133
+ private const string ArgumentRegEx = "(?:[-]{1,2}|\\ /)([\\ w-]+)[=|:| ]?(\\ w\\ S*|\\ \" [^\" ]*\\ \" |\\ \' [^']*\\ \' )?|([^ ([^'\\ \" ]+|\" [^\\ \" ]+\" |\\ \' [^']+\\ \' )" ;
134
134
135
135
/// <summary>
136
136
/// The regular expression with which to parse argument-value groups.
You can’t perform that action at this time.
0 commit comments