<?xml version="1.0" encoding="utf-8"?>
<rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom"><channel><title>Recent changes to Parsing</title><link>https://sourceforge.net/p/cmdconfig/wiki/Parsing/</link><description>Recent changes to Parsing</description><atom:link href="https://sourceforge.net/p/cmdconfig/wiki/Parsing/feed" rel="self"/><language>en</language><lastBuildDate>Tue, 23 Sep 2014 14:56:53 -0000</lastBuildDate><atom:link href="https://sourceforge.net/p/cmdconfig/wiki/Parsing/feed" rel="self" type="application/rss+xml"/><item><title>Parsing modified by Ray</title><link>https://sourceforge.net/p/cmdconfig/wiki/Parsing/</link><description>&lt;div class="markdown_content"&gt;&lt;pre&gt;--- v1
+++ v2
@@ -9,10 +9,10 @@

 **Parsing In Detail**
 Options on the command line can be grouped, but the parsing process differs slightly but significantly for the three types of options. As a consequence, one must be aware of the following:
-* When a group of options is scanned, the first argument-requiring option ends the scan; the rest of the group is considered its argument value.
-* Any string not beginning with a minus (-) following a boolean option is collected as non-option argument
-* In a group of options, if a argument-optional is encountered, it is only switched on, but considered argumentless. By consequence, the scanning of the group continues until the end or until an argument-mandatory option is found.
-* As a consequence, argument-optional options to remain argumentless must be specified either in a group followed by at least one more option, or at the end (after any non-option arguments). Whenever an argument-optional option is encountered before a string not beginning with a minus sign, that string is collected as the option's value.
+- When a group of options is scanned, the first argument-requiring option ends the scan; the rest of the group is considered its argument value.
+- Any string not beginning with a minus (-) following a boolean option is collected as non-option argument
+- In a group of options, if a argument-optional is encountered, it is only switched on, but considered argumentless. By consequence, the scanning of the group continues until the end or until an argument-mandatory option is found.
+- As a consequence, argument-optional options to remain argumentless must be specified either in a group followed by at least one more option, or at the end (after any non-option arguments). Whenever an argument-optional option is encountered before a string not beginning with a minus sign, that string is collected as the option's value.

 **Note** that a sole minus sign (-) is considered an argument value or non-option argument. This allows to keep the habit of specifying standard input or output by a minus, e.g. *-f -*.
 Moreover, a double minus (--) ends the option recognition. After this argument is encountered the parser considers all the remaining strings to be non-option arguments regardless of whether the start by a minus sign.
&lt;/pre&gt;
&lt;/div&gt;</description><dc:creator xmlns:dc="http://purl.org/dc/elements/1.1/">Ray</dc:creator><pubDate>Tue, 23 Sep 2014 14:56:53 -0000</pubDate><guid>https://sourceforge.netab4a43b878a3ec8dc6998724cb2191b844287740</guid></item><item><title>Parsing modified by Ray</title><link>https://sourceforge.net/p/cmdconfig/wiki/Parsing/</link><description>&lt;div class="markdown_content"&gt;&lt;h2 id="config-argument-parsing"&gt;Config Argument Parsing&lt;/h2&gt;
&lt;p&gt;Once a &lt;em&gt;Config&lt;/em&gt; is instantiated (see &lt;a class="" href="/p/cmdconfig/wiki/Usage_Phases"&gt;Instantiation&lt;/a&gt;), it is ready to parse a command-line arguments array, most typically the one passed to the method &lt;em&gt;main()&lt;/em&gt; as its argument. To achieve that, one calls the &lt;a class="" href="http://www.phalanx.cz/cmd-config-doc/cz/phalanx/config/Config.html#parseArguments(java.lang.String...)" rel="nofollow"&gt;parseArguments()&lt;/a&gt; method:&lt;/p&gt;
&lt;div class="codehilite"&gt;&lt;pre&gt;&lt;span class="n"&gt;config&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="n"&gt;parseArguments&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="s"&gt;"-a"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="s"&gt;"-bonce"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="s"&gt;"-cd"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="s"&gt;"d_arg"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="s"&gt;"non-opt"&lt;/span&gt;&lt;span class="p"&gt;);&lt;/span&gt;
&lt;/pre&gt;&lt;/div&gt;
&lt;p&gt;The method returns &lt;em&gt;true&lt;/em&gt; if all argument-requiring options have been specified with at least one argument value, &lt;em&gt;false&lt;/em&gt; otherwise. The side effect of this is that if this method returned &lt;em&gt;true&lt;/em&gt; and for an argument-requiring option &lt;em&gt;opt&lt;/em&gt; the &lt;em&gt;config.isOn(opt)&lt;/em&gt; returns &lt;em&gt;true&lt;/em&gt;, you can be sure that config.getOptionArgs(opt) &lt;strong&gt;is not empty&lt;/strong&gt;.&lt;/p&gt;
&lt;p&gt;&lt;strong&gt;Parsing In Detail&lt;/strong&gt;&lt;br /&gt;
Options on the command line can be grouped, but the parsing process differs slightly but significantly for the three types of options. As a consequence, one must be aware of the following:&lt;br /&gt;
&lt;em&gt; When a group of options is scanned, the first argument-requiring option ends the scan; the rest of the group is considered its argument value.&lt;br /&gt;
&lt;/em&gt; Any string not beginning with a minus (-) following a boolean option is collected as non-option argument&lt;br /&gt;
&lt;em&gt; In a group of options, if a argument-optional is encountered, it is only switched on, but considered argumentless. By consequence, the scanning of the group continues until the end or until an argument-mandatory option is found.&lt;br /&gt;
&lt;/em&gt; As a consequence, argument-optional options to remain argumentless must be specified either in a group followed by at least one more option, or at the end (after any non-option arguments). Whenever an argument-optional option is encountered before a string not beginning with a minus sign, that string is collected as the option's value.&lt;/p&gt;
&lt;p&gt;&lt;strong&gt;Note&lt;/strong&gt; that a sole minus sign (-) is considered an argument value or non-option argument. This allows to keep the habit of specifying standard input or output by a minus, e.g. &lt;em&gt;-f -&lt;/em&gt;.&lt;br /&gt;
Moreover, a double minus (--) ends the option recognition. After this argument is encountered the parser considers all the remaining strings to be non-option arguments regardless of whether the start by a minus sign.&lt;/p&gt;&lt;/div&gt;</description><dc:creator xmlns:dc="http://purl.org/dc/elements/1.1/">Ray</dc:creator><pubDate>Tue, 23 Sep 2014 14:56:12 -0000</pubDate><guid>https://sourceforge.net2ef790a1c78762f67d152ecf6a3bd85d569bde22</guid></item></channel></rss>