<div dir="ltr">Hi,<div class="gmail_extra"><br><div class="gmail_quote">On Mon, Aug 5, 2013 at 7:06 PM, Anders Gärdenäs <span dir="ltr">&lt;<a href="mailto:anders.gardenas@gmail.com" target="_blank">anders.gardenas@gmail.com</a>&gt;</span> wrote:<br>
<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div dir="ltr"><p style="margin-bottom:0.0001pt"><span style="font-family:&#39;Times New Roman&#39;,serif;font-size:12pt">The problem is that I want &quot;all&quot; to be default
options and I don’t know how to implement it. </span><br></p>

<p style="margin-bottom:0.0001pt"><span lang="EN-US" style="font-size:12pt;font-family:&#39;Times New Roman&#39;,serif">.defaultValue</span><span lang="EN-US" style="font-size:12pt;font-family:&#39;Times New Roman&#39;,serif">(all).  
Won’t work (the input need to be of type </span><span lang="EN-US" style="font-size:12pt;font-family:&#39;Times New Roman&#39;,serif">gmx::selection</span><span lang="EN-US" style="font-size:12pt;font-family:&#39;Times New Roman&#39;,serif">);</span><span lang="EN-US" style="font-size:12pt;font-family:&#39;Times New Roman&#39;,serif"> </span><span lang="EN-US" style="font-size:12pt;font-family:&#39;Times New Roman&#39;,serif">where running the program and type “–select all” will
work.</span><span lang="EN-US" style="font-size:12pt;font-family:&#39;Times New Roman&#39;,serif"></span></p>

<p style="margin-bottom:0.0001pt"><span lang="EN-US" style="font-size:12pt;font-family:&#39;Times New Roman&#39;,serif">So in sort how do you use </span><span lang="EN-US" style="font-size:12pt;font-family:&#39;Times New Roman&#39;,serif">SelectionOption to select “all” by default?</span></p>
</div></blockquote><div><br></div><div style>This is not possible to achieve with the current implementation. But it should be relatively straightforward to add such a mechanism (e.g., that you can use .defaultSelectionText(&quot;all&quot;) for SelectionOption, and get that string parsed behind the scenes if the user doesn&#39;t provide anything else). Let me know if you want to implement such a thing and contribute it back; I&#39;m happy to review the change in gerrit. I can also do that at some point, but don&#39;t expect immediate progress.</div>
<div style><br></div><div style>It will work somewhat differently from defaultValue(), though, since it is not possible to construct the default gmx::Selection object at the time the option is declared. So you can&#39;t immediately access the default selection, like you can with &quot;normal&quot; values. And it may interact in surprising ways with .required() (or its absence). I&#39;d be happy to hear how you would expect it to behave in the different cases (with or without required(), and with only the option -select provided on the command line without any value, which normally triggers an interactive prompt for that selection).</div>
<div style><br></div><div style>Best regards,</div><div style>Teemu</div></div></div></div>