summaryrefslogtreecommitdiffstats
path: root/Python/getopt.c
diff options
context:
space:
mode:
authorÉric <earaujo@caravan.coop>2022-06-01 09:50:01 (GMT)
committerGitHub <noreply@github.com>2022-06-01 09:50:01 (GMT)
commit8aa9d40b00741213c5a53b1ae15509998893ae31 (patch)
tree75b85a42e550b8190cfaf915113ebb486f459752 /Python/getopt.c
parent132e563703ed634312e54c04a9b1636f8b0e2923 (diff)
downloadcpython-8aa9d40b00741213c5a53b1ae15509998893ae31.zip
cpython-8aa9d40b00741213c5a53b1ae15509998893ae31.tar.gz
cpython-8aa9d40b00741213c5a53b1ae15509998893ae31.tar.bz2
gh-90300: split --help output into separate options (#30331)
Make --help output shorter and add new help options. --help-env, --help-xoptions and --help-all command-line options are added to complement --help.
Diffstat (limited to 'Python/getopt.c')
-rw-r--r--Python/getopt.c6
1 files changed, 5 insertions, 1 deletions
diff --git a/Python/getopt.c b/Python/getopt.c
index fcea607..4135bf1 100644
--- a/Python/getopt.c
+++ b/Python/getopt.c
@@ -44,8 +44,12 @@ static const wchar_t *opt_ptr = L"";
#define SHORT_OPTS L"bBc:dEhiIJm:OPqRsStuvVW:xX:?"
static const _PyOS_LongOption longopts[] = {
+ /* name, has_arg, val (used in switch in initconfig.c) */
{L"check-hash-based-pycs", 1, 0},
- {NULL, 0, 0},
+ {L"help-all", 0, 1},
+ {L"help-env", 0, 2},
+ {L"help-xoptions", 0, 3},
+ {NULL, 0, -1}, /* sentinel */
};