summaryrefslogtreecommitdiffstats
path: root/Python/getopt.c
diff options
context:
space:
mode:
authorMiss Islington (bot) <31488909+miss-islington@users.noreply.github.com>2022-06-14 19:15:42 (GMT)
committerGitHub <noreply@github.com>2022-06-14 19:15:42 (GMT)
commitcbfbe248e304cc1936f04d3a3d2c3b115dea8663 (patch)
tree0630954fd7095769e1c507f4fd465166c5e594f7 /Python/getopt.c
parent29c7e815bc6087bfa0f34855d8313b16f236dd34 (diff)
downloadcpython-cbfbe248e304cc1936f04d3a3d2c3b115dea8663.zip
cpython-cbfbe248e304cc1936f04d3a3d2c3b115dea8663.tar.gz
cpython-cbfbe248e304cc1936f04d3a3d2c3b115dea8663.tar.bz2
gh-90300: split --help output into separate options (GH-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. (cherry picked from commit 8aa9d40b00741213c5a53b1ae15509998893ae31) Co-authored-by: Éric <earaujo@caravan.coop>
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 */
};