Skip to content

[bug] invalid CLI option values are silently accepted #550

Description

@Hiro-Chiba

Description

Common CLI options are accepted without validating their documented domain. Unknown output formats fall through to text output, and parseInt partially accepts malformed numeric values before the command contacts the backend.

Steps to reproduce

  1. Run ix doctor --format yaml.
  2. Run ix inventory --kind file --limit 1e3.
  3. Run ix search term --as-of abc and ix search term --as-of 1e3.
  4. Run ix map --level nope, ix map --min-confidence 1.1, or ix map --sort newest.
  5. Run ix savings --model unknown.

Expected behavior

Invalid choices and malformed numbers are rejected before any backend request, with a non-zero exit status and an option-specific error.

Actual behavior

The commands silently select another behavior. Examples include 1e3 becoming 1, an invalid revision being ignored or truncated, an unknown format rendering text, and an unknown pricing model using the default model.

CLI output

These invocations currently complete instead of reporting invalid arguments.

Environment

  • OS: macOS
  • Node: 22.x
  • Ix version: 0.10.5 and current main (3baa7dc)

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions