Skip to content

Commit

Permalink
Add prog arguments to ArgumentParser to prevent the wrong inferred name
Browse files Browse the repository at this point in the history
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
  • Loading branch information
joerick authored and henryiii committed Apr 27, 2022
1 parent 8c77d5e commit 91fae82
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 0 deletions.
1 change: 1 addition & 0 deletions cibuildwheel/__main__.py
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
1 change: 1 addition & 0 deletions cibuildwheel/from_sdist.py
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@

def main() -> None:
parser = argparse.ArgumentParser(
prog="cibuildwheel-from-sdist",
description=textwrap.dedent(
"""
Build wheels from an sdist archive.
Expand Down

0 comments on commit 91fae82

Please sign in to comment.