Skip to content

bug: config set treats negative numeric values as CLI flags #45

Description

@weklund

Description

Running mlx-stack config set memory-budget-pct -5 produces:

Error: No such option: -5

Click interprets -5 as a CLI flag instead of a value argument. This is a known Click limitation when positional arguments start with -.

Steps to Reproduce

mlx-stack config set memory-budget-pct -5
# Expected: "Invalid memory budget '-5'. Must be between 1 and 100."
# Actual: "Error: No such option: -5"

Expected Behavior

Negative values should be passed through to the validation layer, which already correctly rejects out-of-range values (tested: 200 correctly produces "Must be between 1 and 100").

Possible Fixes

  1. Use Click's nargs or type handling to prevent flag interpretation
  2. Add context_settings=dict(ignore_unknown_options=True)
  3. Document that -- separator can be used: mlx-stack config set -- memory-budget-pct -5

Impact

Low — edge case, but the error message is confusing and misleading.

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

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