Skip to content

parse command does not validate the --format flag — accepts invalid values silently #19

@krsiddalingamma690-dot

Description

@krsiddalingamma690-dot

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")

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions