argparse feature request

N

Neal Becker

I use arparse all the time and find it serves my needs well. One thing I'd like
to see. In the help message, I'd like to automatically add the default values.

For example, here's one of my programs:

python3 test_freq3.py --help
usage: test_freq3.py [-h] [--size SIZE] [--esnodB ESNODB] [--tau TAU] [--trials
TRIALS]
[--training TRAINING] [--sps SPS] [--si SI] [--alpha ALPHA]
[--range RANGE] [--dfunc {gradient,delay}]
[--mod
{gaussian,qpsk,8psk,16apsk,32apsk,32dlr,64apsk,256apsk}]
[--sym-freq-err SYM_FREQ_ERR] [--calibrate [CALIBRATE]]

optional arguments:
-h, --help show this help message and exit
--size SIZE
--esnodB ESNODB, -e ESNODB
--tau TAU, -t TAU
--trials TRIALS
--training TRAINING
--sps SPS
--si SI
--alpha ALPHA
--range RANGE
--dfunc {gradient,delay}
--mod {gaussian,qpsk,8psk,16apsk,32apsk,32dlr,64apsk,256apsk}
--sym-freq-err SYM_FREQ_ERR
--calibrate [CALIBRATE], --with-calibrate [CALIBRATE], --enable-calibrate
[CALIBRATE], --no-calibrate [CALIBRATE], --without-calibrate [CALIBRATE], --
disable-calibrate [CALIBRATE]

What I'd like to see is:

--size SIZE [2000] <<< the default value is displayed
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

Forum statistics

Threads
473,774
Messages
2,569,596
Members
45,128
Latest member
ElwoodPhil
Top