Add prog arguments to ArgumentParser to prevent the wrong inferred name

when calling like 'python -m cibuildwheel', we get errors like

usage: __main__.py [-h] [--platform {auto,linux,macos,windows}] [--archs ARCHS] [--output-dir OUTPUT_DIR] [--config-file CONFIG_FILE]
                   [--print-build-identifiers] [--allow-empty] [--prerelease-pythons]
                   [package_dir]
__main__.py: error: unrecognized arguments: --sad

With this change, we get error outputs like:

usage: cibuildwheel [-h] [--platform {auto,linux,macos,windows}] [--archs ARCHS] [--output-dir OUTPUT_DIR] [--config-file CONFIG_FILE]
                    [--print-build-identifiers] [--allow-empty] [--prerelease-pythons]
                    [package_dir]
cibuildwheel: error: unrecognized arguments: --asda
This commit is contained in:
Joe Rickerby
2022-04-27 01:01:31 -04:00
committed by Henry Schreiner
parent 8c77d5ed41
commit 91fae8268e
2 changed files with 2 additions and 0 deletions
+1
View File
@@ -28,6 +28,7 @@ def main() -> None:
platform: PlatformName
parser = argparse.ArgumentParser(
prog="cibuildwheel",
description="Build wheels for all the platforms.",
epilog="""
Most options are supplied via environment variables or in
+1
View File
@@ -11,6 +11,7 @@ from cibuildwheel.util import format_safe
def main() -> None:
parser = argparse.ArgumentParser(
prog="cibuildwheel-from-sdist",
description=textwrap.dedent(
"""
Build wheels from an sdist archive.