Skip to content

Commit a5f3a69

Browse files
committed
Fix: All python -m semver commands fail with 'error: invalid choice:'
This was caused by __main__.py passing `sys.argv` to `cli.main()`, which includes the path of the script in `sys.argv[0]`. `argparse.ArgumentParser.parse_args()` parses this as the subcommand name, causing it to throw an error.
1 parent 2018346 commit a5f3a69

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

src/semver/__main__.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -25,4 +25,4 @@ def main(cliargs: Optional[List[str]] = None) -> int:
2525

2626

2727
if __name__ == "__main__":
28-
sys.exit(main(sys.argv))
28+
sys.exit(main(sys.argv[1:]))

0 commit comments

Comments
 (0)
pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy