"""Every `--flag` the docs name exists in the code, and a command line that runs one tool uses that tool's flags. python -I tests/test_docs_cli_flags.py `tests/test_docs_repo_paths.py` checks the paths the docs name; this checks the options. A renamed or removed argparse option leaves `python -I tools/x.py --old` in a README or guide that no longer runs. Two checks: 1. a `--flag` anywhere in a Markdown page appears as a string in some tracked non-Markdown source file; 2. in a fenced command that starts `python [-I] tools/x.py` (or `scripts/`, or `make_game.py`), every flag appears in that script (a script that builds flags as `"--" + name` is skipped; `--help` is argparse's own). Reads tracked files only; no game files. """ import os import re import subprocess import unittest ROOT = os.path.dirname(os.path.dirname(os.path.abspath(__file__))) FLAG = re.compile(r"(?