Argparse subparsers add required keyword

March 8, 2018
8:47 a.m.
With the stdlib argparse, subparsers can be defined and they can be marked as required (though this is not documented) but they do not support a "required" keyword. I think it would make everything more consistent if the keyword existed. This won't require any functional changes under the hood. Right now, this works (and behaves as expected): parser = argparse.ArgumentParser(...) subparsers = parser.add_subparsers(...) subparsers.required = True but this does not: parser = argparse.ArgumentParser(...) subparsers = parser.add_subparsers(..., required=True) --George
2568
Age (days ago)
2568
Last active (days ago)
0 comments
1 participants
participants (1)
-
George Leslie-Waksman