You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Answer --help and Refuse Unknown Arguments in Every Python Script #539
The fleet's CODESTYLE.md "Command-Line Arguments" says every command-line script answers --help and -h with its usage on stdout, exits 0, and changes nothing, and that it refuses an argument it does not recognize. Several of Blog's Python scripts do neither:
checks/env_docs_gate.py, checks/github_env_gate.py, checks/media_metadata_gate.py, and checks/media_redactions_gate.py ignore --help and run the gate. github_env_gate.py therefore reads the repository's variables and secrets from GitHub.
checks/url_parity_gate.py reads --help as the built site's path and fails with --help is not a directory.
capture/build_redirects.py refuses --help as an unknown option.
The scripts that already answer --help, such as csp_gate.py, text_pii_gate.py, and normalize_media.py, use argparse.
Done
Every script above answers --help and -h and refuses an unknown argument, and each gate's tests/ file covers both.
deploy/make-release.sh belongs on this list too, and it is the riskiest of them. It reads its first argument as the deploy root, so deploy/make-release.sh --help takes --help as that root and starts a release. It restores file mtimes and runs the build against the default environment file before anything refuses the root. On 2026-10-25 such a run stopped during the build and installed nothing. Its answer to --help should come before it sources any environment file.
Activity
ptr727 commentedon Oct 26, 2026
deploy/make-release.shbelongs on this list too, and it is the riskiest of them. It reads its first argument as the deploy root, sodeploy/make-release.sh --helptakes--helpas that root and starts a release. It restores file mtimes and runs the build against the default environment file before anything refuses the root. On 2026-10-25 such a run stopped during the build and installed nothing. Its answer to--helpshould come before it sources any environment file.Answer --help After Another Argument in the Shell Scripts
Answer --help and Refuse Unknown Arguments in Every Script (#542)