{"record":{"id":"f2ee09b96458b042","repo":"podman-container-tools/podman","slug":"this-script-accepts-no-arguments","errorCode":null,"errorMessage":"This script accepts no arguments","messagePattern":"This script accepts no arguments","errorType":"exception","errorClass":"Exception","httpStatus":null,"severity":"error","filePath":"hack/markdown-preprocess","lineNumber":284,"sourceCode":"                return rhs\n            return lhs\n\n        return re.sub(r'<<[^\\|>]*\\|[^\\|>]*>>', replwith, line)\n\n\ndef main():\n    \"script entry point\"\n    script_dir = os.path.abspath(os.path.dirname(__file__))\n    man_dir = os.path.join(script_dir,\"../docs/source/markdown\")\n\n    try:\n        os.chdir(man_dir)\n    except FileNotFoundError as ex:\n        raise Exception(\"Please invoke me from the base repo dir\") from ex\n\n    # No longer possible to invoke us with args: reject any such invocation\n    if len(sys.argv) > 1:\n        raise Exception(\"This script accepts no arguments\")\n\n    preprocessor = Preprocessor()\n    for infile in sorted(glob.glob('*.md.in')):\n        preprocessor.process(infile)\n\n    # Now rewrite all option files\n    preprocessor.rewrite_optionfiles()\n\nif __name__ == \"__main__\":\n    main()\n","sourceCodeStart":266,"sourceCodeEnd":295,"githubUrl":"https://github.com/podman-container-tools/podman/blob/a2409076ef2fef60ad9ac046375dedc7d9410ef4/hack/markdown-preprocess#L266-L295","documentation":"Raised by main() when sys.argv has more than one element: this script deliberately accepts no command-line arguments. Older versions took arguments; the current contract is 'cd into docs/source/markdown and process all *.md.in files' with zero configuration. Any extra word (a file name, --help, a flag) aborts before processing.","triggerScenarios":"Invoking './hack/markdown-preprocess podman-run.1.md.in' or './hack/markdown-preprocess --help' or passing a wrapper script's stray argument; Makefile/custom target still using the old argument-based interface.","commonSituations":"Outdated docs/CI instructions or muscle memory from the old CLI; wrapper scripts that forward \"$@\"; automation appending flags.","solutions":["Call it bare: ./hack/markdown-preprocess (or python3 hack/markdown-preprocess)","Update stale wrappers/Makefile snippets that pass file arguments","To regenerate one man page, let the script run over all *.md.in — it is fast and idempotent"],"exampleFix":"# before\n./hack/markdown-preprocess podman-run.1.md.in\n\n# after\n./hack/markdown-preprocess","handlingStrategy":"validation","validationCode":"# Wrapper that enforces the no-args contract explicitly\nimport subprocess, sys\nif len(sys.argv) != 1:\n    sys.exit('markdown-preprocess takes no arguments; it processes all *.md.in files')\nraise SystemExit(subprocess.run(['./hack/markdown-preprocess']).returncode)","typeGuard":null,"tryCatchPattern":null,"preventionTips":["Invoke it bare: ./hack/markdown-preprocess — there are no flags, no file arguments, no --help","Fix wrappers that forward \"$@\" or append flags; drop the old argument-based callsites","To touch one man page, edit the .md.in or options/*.md source — the script always regenerates all pages"],"tags":["docs","cli","usage"],"backgroundTag":null,"analyzedSha":"a2409076ef2fef60ad9ac046375dedc7d9410ef4","analyzedAt":"2026-08-15T15:57:05.625Z","schemaVersion":2},"datasetVersion":"2026-08-15T17:31:12.345Z"}