This is a first step towards using argparse as the main parser, and it was pretty trivial to implement. The only change to existing code is moving a few generic blocks of the KVLoader to the parent class, so they could be reused in the new sibling. Other than that, simply changing the import in config.application was all it took.
We probably want a better implementation, but this appears to solve the immediate problem of not being able to do things like:
ipython --pylab qt and ipcluster start -n 4. anything argparse did not recognize (e.g. full --Class.trait=value simply get passed to the stricter KV loader.
ipython --pylab qt
ipcluster start -n 4
Note that this does not use argparse's tools for handling types, etc. It's strictly for mapping names to be eval'd.
I don't expect this to be merged as-is, but it's a placeholder for discussion or something better.
use argparse to parse aliases & flags
Great, thanks for this!
The fact that we're not using argparse has caused me a great deal of frustration in trying to pass arguments to the kernel launch script, particularly on Windows. I'm glad this will be resolved.
An ideal situation would be to use argparse for everything, since we could do pretty clever things with types, nargs, etc. building a parser from traitlets. But since we must generate the parser at launch, the construction would probably add a great deal to the startup time, which would be pretty rough.
With this as it is, I think the only thing we get is allowing spaces between name and value :)
But that's actually what's important to me: I can pass extra_args=['--c', 'some code'] to the kernel launch function and let Popen escape the code argument. Currently, I have to do extra_args=['--c="my code"'] and worry about everything being escaped properly. Painful, especially on Windows.
extra_args=['--c', 'some code']
add single '-' prefix for length 1 aliases and flags to help output
use cfg._merge instead of update in loader
update clobbers existing config sections
IPython.config tests are passing again
Remove no-longer-accurate argument syntax note in options message
update docs to reflect relaxed syntax of argparse