Re:Python argparse has a limitation on argument groups that ...
by Neywiny on Saturday June 14, 2025 @04:04PM
(#44278481)
I think this is doable but as an X vs Y problem. You can either not have a default and check if it's in the namespace later, or make the default value be the previously highest priority value as a run-time defined default. Do either of those work?
[ Parent
| on HN ]
Re:Python argparse has a limitation on argument groups that ...
by mjevans on Saturday June 14, 2025 @04:53PM
(#44278759)
It would be nice if --help reports the (program) default as the default value for an option. A different option might dump a fully evaluated configuration. While a third might exit without doing anything.
Re:Python argparse has a limitation on argument groups that ...
by Elixir6419 on Thursday June 19, 2025 @07:13AM
(#44317522)
if you pass formatter_class=argparse.ArgumentDefaultsHelpFormatter) you will get exactly that.
shameless copy from https://stackoverflow.com/questions/12151306/argparse-way-to...