On 01/05/2012 01:24 PM, Andrea Crotti wrote:
There's one thing I don't understand about argparse, why doesn't
--help show what is the default value??
I mean if I add an option that can be customized it would be good for the user
to know what is the current value in my opinion.

Is there a way to make it show it?

Looking at the code I found it already
    parser = argparse.ArgumentParser(description=description,
formatter_class=argparse.ArgumentDefaultsHelpFormatter)

the only thing is that it displays also "default: None" which isn't probably very useful, but it would easy to write my own formatter and pass it if I don't like this..
--
http://mail.python.org/mailman/listinfo/python-list

Reply via email to