New submission from Barry A. Warsaw: Sometimes we want to control the order of arguments printed by an argparse defined cli. In practice, arguments are printed in the order in which they are added via add_argument(), but I don't think this is documented and thus should be considered an implementation detail. It should be possible to enforce an order by the use of a formatter_class, but you'd probably need some extra metadata on arguments to do this, so it's not completely obvious how to write such a formatter class.
Instead, I propose to document and officially support that the order of add_argument() calls defines the order in which arguments are printed via --help. ---------- assignee: docs@python components: Documentation messages: 277060 nosy: barry, docs@python priority: normal severity: normal status: open title: Is order of argparse --help output officially defined? versions: Python 3.5, Python 3.6, Python 3.7 _______________________________________ Python tracker <rep...@bugs.python.org> <http://bugs.python.org/issue28219> _______________________________________ _______________________________________________ Python-bugs-list mailing list Unsubscribe: https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com