On Wed, Sep 1, 2010 at 12:56 PM, Matthew Knepley <span dir="ltr"><<a href="mailto:knepley@gmail.com">knepley@gmail.com</a>></span> wrote:<br><div class="gmail_quote"><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex;">
<div class="im">On Wed, Sep 1, 2010 at 12:55 PM, Jed Brown <span dir="ltr"><<a href="mailto:jed@59a2.org" target="_blank">jed@59a2.org</a>></span> wrote:<br></div><div class="gmail_quote"><div class="im"><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
Two thoughts:<br>
<br>
1. Systematic deprecation system:<br>
<br>
--with-shared doesn't give any errors today, but the option goes<br>
unused (because it's now spelled --with-shared-libraries). I'd like<br>
to see either (a) recognize the old spelling but warn of deprecation,<br>
or (b) error giving the new spelling. This seems easy to do by<br>
updating help.addArgument.<br></blockquote><div><br></div></div><div>Good idea. Will do it.</div></div></blockquote><div><br></div><div>Okay, our options system is sufficiently broken, that this is not easy. I wish we could</div>
<div>use Python options, but it does not seem customizable enough to fit our dynamic outlook</div><div>and help system. Pyre would be nice, but it is being rewritten and has too much cruft</div><div>right now.</div><div><br>
</div><div>The problem is that clArgs are processed before initial options are set. This should be</div><div>disentangled, because they have to be processed again sometime since they override</div><div>defaults.</div><div>
<br></div><div>We should completely rewrite the system to do tracking of input, multistage selection,</div><div>help output in other formats, unused options, misspelling detection, etc. I can't do it</div><div>right now.</div>
<div><br></div><div> Matt</div><div><br></div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex;"><div class="gmail_quote"><div class="im"><div> </div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
2. It's common to misspell options, difflib is part of the standard library<br>
(from 2.3)<br>
<br>
<a href="http://docs.python.org/library/difflib.html#difflib.get_close_matches" target="_blank">http://docs.python.org/library/difflib.html#difflib.get_close_matches</a><br>
<br>
and would enable a warning like<br>
<br>
The option "--with-shard-libaries" was not used, maybe you meant "--with-shared-libraries".<br>
<br>
Configure is imperative (as opposed to declarative, or with all<br>
options identified and available very early) so I don't think it's<br>
feasible to provide comprehensive misspelled options help immediately,<br>
but at least the unused options could be listed at the end. This<br>
ought to just be a matter of having argDB log accesses, then at the<br>
end, take all entries that were never accessed and compute Levenshtein<br>
distance to the options that were accessed used to give suggestions.<br></blockquote><div><br></div></div><div>The first part, putting in access logging, has been on the list for a long time.</div><div>We need to do it, but its a bit of programming.</div>
<div class="im">
<div> </div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
I'm not sure what to do if configure errors out early, it might be<br>
hitting an error _because_ of an unused option, but there may be lots<br>
of unused options at this stage (that are valid and really will be<br>
used later).</blockquote><div><br></div></div><div>This is not really soluble now I think.</div><div><br></div><div> Matt</div><div> </div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
<font color="#888888"><br>
Jed<br>
</font></blockquote></div><div><div></div><div class="h5"><br><br clear="all"><br>-- <br>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<br>
</div></div></blockquote></div><br><br clear="all"><br>-- <br>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<br>