mirror of
https://github.com/chylex/TweetDuck.git
synced 2025-05-01 17:34:10 +02:00
Fix new lines not being recognized in CEF argument parser
This commit is contained in:
parent
27e2372097
commit
fba734fd5a
@ -3,7 +3,7 @@
|
|||||||
|
|
||||||
namespace TweetDuck.Core.Utils{
|
namespace TweetDuck.Core.Utils{
|
||||||
static class CommandLineArgsParser{
|
static class CommandLineArgsParser{
|
||||||
private static readonly Lazy<Regex> SplitRegex = new Lazy<Regex>(() => new Regex(@"([^=\s]+(?:=(?:[^ ]*""[^""]*?""[^ ]*|[^ ]*))?)", RegexOptions.Compiled), false);
|
private static readonly Lazy<Regex> SplitRegex = new Lazy<Regex>(() => new Regex(@"([^=\s]+(?:=(?:\S*""[^""]*?""\S*|\S*))?)", RegexOptions.Compiled), false);
|
||||||
|
|
||||||
public static CommandLineArgs ReadCefArguments(string argumentString){
|
public static CommandLineArgs ReadCefArguments(string argumentString){
|
||||||
CommandLineArgs args = new CommandLineArgs();
|
CommandLineArgs args = new CommandLineArgs();
|
||||||
|
@ -12,7 +12,7 @@ public void TestEmptyString(){
|
|||||||
|
|
||||||
[TestMethod]
|
[TestMethod]
|
||||||
public void TestValidString(){
|
public void TestValidString(){
|
||||||
CommandLineArgs args = CommandLineArgsParser.ReadCefArguments("--aaa --bbb --first-value=123 --SECOND-VALUE=\"a b c d e\" --ccc");
|
CommandLineArgs args = CommandLineArgsParser.ReadCefArguments("--aaa --bbb --first-value=123 --SECOND-VALUE=\"a b c d e\"\r\n--ccc");
|
||||||
// cef has no flags, flag arguments have a value of 1
|
// cef has no flags, flag arguments have a value of 1
|
||||||
// the processing removes all dashes in front of each key
|
// the processing removes all dashes in front of each key
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user