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
_______________________________________________
Python-ideas mailing list
[email protected]
https://mail.python.org/mailman/listinfo/python-ideas
Code of Conduct: http://python.org/psf/codeofconduct/

Reply via email to