Description
The parse CLI command accepts any arbitrary
string for --format without validation.
Root Cause
In commands.py lines 10-14, args.format only
checks for "json" but never validates input.
Invalid values silently fall through to else
branch instead of raising an error.
Expected Behavior
Should raise: "invalid format.
Supported: json, text"
Actual Behavior
Invalid --format values accepted silently.
Fix
Add validation:
if args.format not in ("json", "text"):
raise ValueError(f"invalid format")
Description
The
parseCLI command accepts any arbitrarystring for --format without validation.
Root Cause
In commands.py lines 10-14, args.format only
checks for "json" but never validates input.
Invalid values silently fall through to else
branch instead of raising an error.
Expected Behavior
Should raise: "invalid format.
Supported: json, text"
Actual Behavior
Invalid --format values accepted silently.
Fix
Add validation:
if args.format not in ("json", "text"):
raise ValueError(f"invalid format")