<?xml version="1.0" encoding="utf-8"?>
<rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom"><channel><title>Recent changes to Default values</title><link>https://sourceforge.net/p/argument/wiki/Default%2520values/</link><description>Recent changes to Default values</description><atom:link href="https://sourceforge.net/p/argument/wiki/Default%20values/feed" rel="self"/><language>en</language><lastBuildDate>Thu, 05 Dec 2013 02:41:24 -0000</lastBuildDate><atom:link href="https://sourceforge.net/p/argument/wiki/Default%20values/feed" rel="self" type="application/rss+xml"/><item><title>Default values modified by Chris DeGreef</title><link>https://sourceforge.net/p/argument/wiki/Default%2520values/</link><description>&lt;div class="markdown_content"&gt;&lt;p&gt;The --default parameter will load up the argument when the user does not specify the argument on the command-line.&lt;/p&gt;
&lt;p&gt;This example will run &lt;code&gt;MyProgram &lt;/code&gt;with the value "IBM" for &lt;code&gt;--ticker&lt;/code&gt;.&lt;br /&gt;
&lt;pre class="java:html:nocontrols" name="code"&gt;CmdLine.create("--type string --key ticker --default IBM");&lt;/pre&gt;&lt;br /&gt;
&lt;pre class="html:nocontrols:nogutter" name="code"&gt;&amp;gt; MyProgram&lt;/pre&gt;&lt;/p&gt;
&lt;p&gt;Notice the short names used for most of the parameters.&lt;/p&gt;
&lt;p&gt;If you specify &lt;code&gt;--multiple&lt;/code&gt; as a parameter then the default can be more than one value.  This example would load the &lt;code&gt;--ticker&lt;/code&gt; argument with "IBM" and "GOOG".&lt;br /&gt;
&lt;pre class="java:html:nocontrols" name="code"&gt;CmdLine.create("-t string -k ticker -m 1 10 --default IBM GOOG");&lt;/pre&gt;&lt;br /&gt;
&lt;pre class="html:nocontrols:nogutter" name="code"&gt;&amp;gt; MyProgram&lt;/pre&gt;&lt;/p&gt;
&lt;p&gt;If the user enters a value for &lt;code&gt;--ticker&lt;/code&gt; then the defaults are not applied at all.  In this example the &lt;code&gt;--ticker&lt;/code&gt; argument would be loaded with "MSFT" only.&lt;br /&gt;
&lt;pre class="java:html:nocontrols" name="code"&gt;CmdLine.create("-t string -k ticker -m 1 10 --default IBM GOOG");&lt;/pre&gt;&lt;br /&gt;
&lt;pre class="html:nocontrols:nogutter" name="code"&gt;&amp;gt; MyProgram --ticker MSFT&lt;/pre&gt;&lt;/p&gt;&lt;/div&gt;</description><dc:creator xmlns:dc="http://purl.org/dc/elements/1.1/">Chris DeGreef</dc:creator><pubDate>Thu, 05 Dec 2013 02:41:24 -0000</pubDate><guid>https://sourceforge.net8e84f3dc01d22f3b43f5aeec816dc6a9f101a6f6</guid></item></channel></rss>