<div dir="ltr"><div class="gmail_extra"><div class="gmail_quote">On Fri, Mar 2, 2018 at 11:55 PM, Jed Brown <span dir="ltr"><<a href="mailto:jed@jedbrown.org" target="_blank">jed@jedbrown.org</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">Matthew Knepley <<a href="mailto:knepley@gmail.com">knepley@gmail.com</a>> writes:<br>
<br>
> On Fri, Mar 2, 2018 at 6:17 PM, Scott Kruger <<a href="mailto:kruger@txcorp.com">kruger@txcorp.com</a>> wrote:<br>
><br>
>> On 3/2/18 12:44 PM, Matthew Knepley wrote:<br>
>><br>
>>> On Fri, Mar 2, 2018 at 2:39 PM, Jed Brown <<a href="mailto:jed@jedbrown.org">jed@jedbrown.org</a> <mailto:<br>
>>> <a href="mailto:jed@jedbrown.org">jed@jedbrown.org</a>>> wrote:<br>
>>><br>
>>> Matthew Knepley <<a href="mailto:knepley@gmail.com">knepley@gmail.com</a> <mailto:<a href="mailto:knepley@gmail.com">knepley@gmail.com</a>>><br>
>>> writes:<br>
>>><br>
>>> > That is not the same as printing unused arguments. Michael's Pythia<br>
>>> > does this correctly, but it is even less simple.<br>
>>><br>
>>> You want it to accept the unused arguments and just print them without<br>
>>> error, or some more subtle relationship among dependent options?<br>
>>><br>
>>><br>
>>> Yes, I do. I consider PETSc to have the correct functionality. The open<br>
>>> world<br>
>>> assumption is a good one, as long as you report that no one accepted that<br>
>>> option.<br>
>>><br>
>><br>
>> <a href="https://docs.python.org/3/library/argparse.html#partial-parsing" rel="noreferrer" target="_blank">https://docs.python.org/3/<wbr>library/argparse.html#partial-<wbr>parsing</a><br>
>><br>
>> Requires Python > 2.7<br>
><br>
><br>
> Good catch!<br>
<br>
I'm not sure it's quite what Matt is after. Argparse is in the standard<br>
library since 2.7, but is available for earlier versions of Python.<br>
<br>
<a href="https://pypi.python.org/pypi/argparse" rel="noreferrer" target="_blank">https://pypi.python.org/pypi/<wbr>argparse</a><br>
<br>
> The other thing I remember argparse not doing last time I checked, was<br>
> that it could group options into sections like we want for our help.<br>
<br>
That has always been in argparse. Maybe you're thinking of some earlier<br>
options parsing library.<br>
<br>
<a href="https://docs.python.org/3/library/argparse.html#sub-commands" rel="noreferrer" target="_blank">https://docs.python.org/3/<wbr>library/argparse.html#sub-<wbr>commands</a><br>
<a href="https://docs.python.org/3/library/argparse.html#argument-groups" rel="noreferrer" target="_blank">https://docs.python.org/3/<wbr>library/argparse.html#<wbr>argument-groups</a><br>
</blockquote></div><br>I knew and used subcommands, but I had not seen argument groups.</div><div class="gmail_extra"><br></div><div class="gmail_extra"> Matt</div><div class="gmail_extra"><div><br></div>-- <br><div class="gmail_signature" data-smartmail="gmail_signature"><div dir="ltr"><div><div dir="ltr"><div>What most experimenters take for granted before they begin their experiments is infinitely more interesting than any results to which their experiments lead.<br>-- Norbert Wiener</div><div><br></div><div><a href="http://www.caam.rice.edu/~mk51/" target="_blank">https://www.cse.buffalo.edu/~knepley/</a><br></div></div></div></div></div>
</div></div>