Problem
Any codelens CLI invocation crashes with:
argparse.ArgumentError: argument --format/-f: conflicting option string(s): -f
Root cause: PR #157 (--diff-base flag) added --format/-f at the global parser level (line ~926 in scripts/codelens.py). But subparsers already define --format/-f at the subparser level. argparse does not allow duplicate short flags across parent and child parsers.
Reported independently by workers fixing PR #139 (formatters) and PR #141 (baseline diff).
Impact
Fix
Two options:
Option A (recommended): Remove the -f short alias from the global --format flag added in PR #157. Keep --format (long form only) at global level. Subparsers keep their --format/-f. This is non-breaking — users who use codelens -f json can use codelens --format json instead.
Option B: Remove the global --format flag entirely from PR #157's addition. The --diff-base flag doesn't need format at global level — format is already available per-subcommand.
Definition of Done
Problem
Any
codelensCLI invocation crashes with:Root cause: PR #157 (--diff-base flag) added
--format/-fat the global parser level (line ~926 inscripts/codelens.py). But subparsers already define--format/-fat the subparser level. argparse does not allow duplicate short flags across parent and child parsers.Reported independently by workers fixing PR #139 (formatters) and PR #141 (baseline diff).
Impact
codelens --helpcrashescodelens scan .crashes-fflag crashestest_cli.pyandtest_doctor.pysmoke testsexisting_option_stringsguard — but the underlying root cause remains on mainFix
Two options:
Option A (recommended): Remove the
-fshort alias from the global--formatflag added in PR #157. Keep--format(long form only) at global level. Subparsers keep their--format/-f. This is non-breaking — users who usecodelens -f jsoncan usecodelens --format jsoninstead.Option B: Remove the global
--formatflag entirely from PR #157's addition. The--diff-baseflag doesn't need format at global level — format is already available per-subcommand.Definition of Done
codelens --helpruns without errorcodelens scan . --format jsonruns without argparse errorcodelens scan . -f jsonworkstest_cli.pyandtest_doctor.pypass--diff-basefunctionality (PR [FEAT] --diff-base flag: scope all analysis commands to changed files only #157 feature still works)