Skip to content

Commit a9a35c3

Browse files
committed
fix: tighten CLI and add color on 3.14+
Signed-off-by: Henry Schreiner <[email protected]>
1 parent 574a024 commit a9a35c3

File tree

1 file changed

+5
-1
lines changed

1 file changed

+5
-1
lines changed

pybind11/__main__.py

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@
22
from __future__ import annotations
33

44
import argparse
5+
import functools
56
import re
67
import sys
78
import sysconfig
@@ -49,7 +50,10 @@ def print_includes() -> None:
4950

5051

5152
def main() -> None:
52-
parser = argparse.ArgumentParser()
53+
make_parser = functools.partial(argparse.ArgumentParser, allow_abbrev=False)
54+
if sys.version_info >= (3, 14):
55+
make_parser = functools.partial(make_parser, color=True, suggest_on_error=True)
56+
parser = make_parser()
5357
parser.add_argument(
5458
"--version",
5559
action="version",

0 commit comments

Comments
 (0)