Commit Graph

1 Commits

Author SHA1 Message Date
nicolargo
33a90f5eb8 feat(v5): G2 — add -s/--server and --enable-mcp CLI flags + validation
Step 1 of the mode-dispatch refactor (plan
``docs/superpowers/plans/2026-05-15-glances-v5-phase2-g2.md``). This
commit only introduces the flags + cross-flag validation; the
dispatch wiring lands in Tasks 2 and 3.

- ``-s`` / ``--server``: opt in to the REST API mode (headless).
- ``--enable-mcp``: mount /mcp; requires ``--server`` — caught by
  ``validate_args`` with a clear stderr message + argparse exit 2.
- ``--quiet`` / ``--no-tui``: kept (open point — see plan G2 §"Open
  points"). When passed together with ``-s`` an info log notes that
  the flag is redundant.
- New ``validate_args`` helper called from ``main()`` after
  ``setup_logging``.

15 new tests in ``tests/test_cli_v5.py`` covering parser shape,
defaults, alias spellings, and the validation rules.
2026-05-15 11:07:15 +02:00