<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"><<a href="mailto:anders.gardenas@gmail.com" target="_blank">anders.gardenas@gmail.com</a>></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:'Times New Roman',serif;font-size:12pt">The problem is that I want "all" 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:'Times New Roman',serif">.defaultValue</span><span lang="EN-US" style="font-size:12pt;font-family:'Times New Roman',serif">(all).
Won’t work (the input need to be of type </span><span lang="EN-US" style="font-size:12pt;font-family:'Times New Roman',serif">gmx::selection</span><span lang="EN-US" style="font-size:12pt;font-family:'Times New Roman',serif">);</span><span lang="EN-US" style="font-size:12pt;font-family:'Times New Roman',serif"> </span><span lang="EN-US" style="font-size:12pt;font-family:'Times New Roman',serif">where running the program and type “–select all” will
work.</span><span lang="EN-US" style="font-size:12pt;font-family:'Times New Roman',serif"></span></p>
<p style="margin-bottom:0.0001pt"><span lang="EN-US" style="font-size:12pt;font-family:'Times New Roman',serif">So in sort how do you use </span><span lang="EN-US" style="font-size:12pt;font-family:'Times New Roman',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("all") for SelectionOption, and get that string parsed behind the scenes if the user doesn't provide anything else). Let me know if you want to implement such a thing and contribute it back; I'm happy to review the change in gerrit. I can also do that at some point, but don'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't immediately access the default selection, like you can with "normal" values. And it may interact in surprising ways with .required() (or its absence). I'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>