<?xml version="1.0" encoding="utf-8"?>
<feed xml:lang="en" xmlns="http://www.w3.org/2005/Atom"><title>Recent changes to bugs</title><link href="https://sourceforge.net/p/cmdlineparser/bugs/" rel="alternate"/><link href="https://sourceforge.net/p/cmdlineparser/bugs/feed.atom" rel="self"/><id>https://sourceforge.net/p/cmdlineparser/bugs/</id><updated>2007-12-04T07:20:22Z</updated><subtitle>Recent changes to bugs</subtitle><entry><title>Incorrect parsing of integer and enum switches</title><link href="https://sourceforge.net/p/cmdlineparser/bugs/5/" rel="alternate"/><published>2007-12-04T07:20:22Z</published><updated>2007-12-04T07:20:22Z</updated><author><name>Anonymous</name><uri>https://sourceforge.net/u/userid-None/</uri></author><id>https://sourceforge.netbc991142592304bb0a1ac3e8df8890b9144efd82</id><summary type="html">&lt;div class="markdown_content"&gt;&lt;p&gt;Parsing&lt;/p&gt;
&lt;p&gt;program.exe -n 1 -m 2&lt;/p&gt;
&lt;p&gt;where n and m are integer switches fails. To solve this replace the line&lt;/p&gt;
&lt;p&gt;this.valuePattern = @")((?&amp;lt;value&amp;gt;.+))";&lt;/p&gt;
&lt;p&gt;with&lt;/p&gt;
&lt;p&gt;this.valuePattern = @")((?&amp;lt;value&amp;gt;\S+))";&lt;/p&gt;
&lt;p&gt;in IntSwitch.initialise()&lt;/p&gt;
&lt;p&gt;The same goes for enum switches. The solution here is to replace&lt;/p&gt;
&lt;p&gt;this.valuePattern = @")((?:"")(?&amp;lt;value&amp;gt;.+)(?:"")|(?&amp;lt;value&amp;gt;\S+))";&lt;/p&gt;
&lt;p&gt;with&lt;/p&gt;
&lt;p&gt;this.valuePattern = @")((?:"")(?&amp;lt;value&amp;gt;[^""]+)(?:"")|(?&amp;lt;value&amp;gt;\S+))";&lt;/p&gt;
&lt;p&gt;in EnumSwitch.initialise()&lt;/p&gt;&lt;/div&gt;</summary></entry><entry><title>Incorrect parsing of multiple string switches</title><link href="https://sourceforge.net/p/cmdlineparser/bugs/4/" rel="alternate"/><published>2007-12-01T12:01:39Z</published><updated>2007-12-01T12:01:39Z</updated><author><name>Anonymous</name><uri>https://sourceforge.net/u/userid-None/</uri></author><id>https://sourceforge.net797981e8802df55574a52eaef03dd96ca45429ae</id><summary type="html">&lt;div class="markdown_content"&gt;&lt;p&gt;When trying to parse&lt;/p&gt;
&lt;p&gt;app.exe -a "aaa" -b "bbb"&lt;/p&gt;
&lt;p&gt;the value of switch a becomes&lt;/p&gt;
&lt;p&gt;aaa" -b "bbb&lt;/p&gt;
&lt;p&gt;This is caused by an incorrect regex in the function initialise in class StringSwitch. The line&lt;/p&gt;
&lt;p&gt;this.valuePattern = @")((?:"")(?&amp;lt;value&amp;gt;.+)(?:"")|(?&amp;lt;value&amp;gt;\S+))";&lt;/p&gt;
&lt;p&gt;should be replaced with&lt;/p&gt;
&lt;p&gt;this.valuePattern = @")((?:"")(?&amp;lt;value&amp;gt;[^""]+)(?:"")|(?&amp;lt;value&amp;gt;\S+))";&lt;/p&gt;
&lt;p&gt;EJ&lt;/p&gt;&lt;/div&gt;</summary></entry><entry><title>Suggestions for .NET 2.0 version</title><link href="https://sourceforge.net/p/cmdlineparser/bugs/3/" rel="alternate"/><published>2007-10-08T12:36:34Z</published><updated>2007-10-08T12:36:34Z</updated><author><name>Anonymous</name><uri>https://sourceforge.net/u/userid-None/</uri></author><id>https://sourceforge.net962f2192d43933745c155ef6e7115d37b6874ca5</id><summary type="html">&lt;div class="markdown_content"&gt;&lt;p&gt;Some suggestions for the a .NET 2.0 version:&lt;/p&gt;
&lt;p&gt;public static T GetOptions&amp;lt;T&amp;gt;() where T : new()&lt;br /&gt;
{&lt;br /&gt;
return GetOptions&amp;lt;T&amp;gt;(System.Environment.CommandLine);&lt;br /&gt;
}&lt;/p&gt;
&lt;p&gt;public static T GetOptions&amp;lt;T&amp;gt;(string commandLine) where T : new()&lt;br /&gt;
{&lt;br /&gt;
return GetOptions&amp;lt;T&amp;gt;(commandLine, true);&lt;br /&gt;
}&lt;/p&gt;
&lt;p&gt;public static T GetOptions&amp;lt;T&amp;gt;(string commandLine, bool includesProgramName) where T : new()&lt;br /&gt;
{&lt;br /&gt;
T result = new T();&lt;/p&gt;
&lt;p&gt;CommandLineParser parser = new CommandLineParser(result);&lt;br /&gt;
parser.Parse(commandLine, includesProgramName);&lt;/p&gt;
&lt;p&gt;return result;&lt;br /&gt;
}&lt;/p&gt;
&lt;p&gt;public static string GetCommandLine()&lt;br /&gt;
{&lt;br /&gt;
return System.Environment.CommandLine;&lt;br /&gt;
}&lt;/p&gt;
&lt;p&gt;public static string GetUsage&amp;lt;T&amp;gt;() where T : new()&lt;br /&gt;
{&lt;br /&gt;
T result = new T();&lt;/p&gt;
&lt;p&gt;CommandLineParser parser = new CommandLineParser(result);&lt;br /&gt;
parser.Parse(System.Environment.CommandLine, true);&lt;/p&gt;
&lt;p&gt;return parser.Usage;&lt;br /&gt;
}&lt;/p&gt;
&lt;p&gt;public static string GetExplicitOptions&amp;lt;T&amp;gt;() where T : new()&lt;br /&gt;
{&lt;br /&gt;
T result = new T();&lt;/p&gt;
&lt;p&gt;CommandLineParser parser = new CommandLineParser(result);&lt;br /&gt;
parser.Parse(System.Environment.CommandLine, true);&lt;/p&gt;
&lt;p&gt;return parser.ExplicitOptions;&lt;br /&gt;
}&lt;/p&gt;&lt;/div&gt;</summary></entry><entry><title>Incorrect constructor Parse</title><link href="https://sourceforge.net/p/cmdlineparser/bugs/2/" rel="alternate"/><published>2007-10-08T12:35:49Z</published><updated>2007-10-08T12:35:49Z</updated><author><name>Anonymous</name><uri>https://sourceforge.net/u/userid-None/</uri></author><id>https://sourceforge.netf000f936d60f85216b8a9458d7d2fcc5d02045f9</id><summary type="html">&lt;div class="markdown_content"&gt;&lt;p&gt;The constructor public void Parse(string[] args) does not take into account arguments containing spaces. A more correct solution is:&lt;/p&gt;
&lt;p&gt;public void Parse(string[] args)&lt;br /&gt;
{&lt;br /&gt;
string commandLine = "";&lt;br /&gt;
foreach (string arg in args)&lt;br /&gt;
{&lt;br /&gt;
if (commandLine.Length &amp;gt; 0)&lt;br /&gt;
{&lt;br /&gt;
commandLine += " ";&lt;br /&gt;
}&lt;br /&gt;
if (!String.IsNullOrEmpty(arg) &amp;amp;&amp;amp; arg.Contains(" "))&lt;br /&gt;
{&lt;br /&gt;
commandLine += "\"" + arg + "\"";&lt;br /&gt;
}&lt;br /&gt;
else&lt;br /&gt;
{&lt;br /&gt;
commandLine += arg;&lt;br /&gt;
}&lt;br /&gt;
}&lt;/p&gt;
&lt;p&gt;Probably this leads to problems&lt;/p&gt;&lt;/div&gt;</summary></entry><entry><title>Incorrect parsing of commandline</title><link href="https://sourceforge.net/p/cmdlineparser/bugs/1/" rel="alternate"/><published>2007-10-08T12:30:29Z</published><updated>2007-10-08T12:30:29Z</updated><author><name>Anonymous</name><uri>https://sourceforge.net/u/userid-None/</uri></author><id>https://sourceforge.nete4c6d5f33c7512eb9a8f54f403448d22f9601557</id><summary type="html">&lt;div class="markdown_content"&gt;&lt;p&gt;Commandlines like&lt;/p&gt;
&lt;p&gt;"C:\path with space\program.exe" -k "text with space"&lt;/p&gt;
&lt;p&gt;are parsed incorrectly.&lt;/p&gt;
&lt;p&gt;The crulpit is in CommandLineParser.trimOffApplicationName. Changing the regex from&lt;/p&gt;
&lt;p&gt;@"^(?&amp;lt;commandLine&amp;gt;("".+""|(\S)+))(?&amp;lt;remainder&amp;gt;.+)"&lt;/p&gt;
&lt;p&gt;to&lt;/p&gt;
&lt;p&gt;@"^(?&amp;lt;commandLine&amp;gt;(""(^"")+""|(\S)+))(?&amp;lt;remainder&amp;gt;.+)"&lt;/p&gt;
&lt;p&gt;solves this problem.&lt;/p&gt;&lt;/div&gt;</summary></entry></feed>