Skip to content

♻️ refactor(run): align CLI flags with jq and move actions to subcommnds - #2575

Merged
harehare merged 2 commits into
mainfrom
refactor/cli-flag-cleanup
Oct 16, 2026
Merged

harehare merged 2 commits into
mainfrom
refactor/cli-flag-cleanup

Conversation

@harehare

Copy link
Copy Markdown
Owner

Summary

  • -c is now the short form of --compact (jq compatible); --count is long-only
  • --arg NAME VALUE sets a named string argument, --args VALUES... sets positional arguments (replaces --args NAME VALUE and --argv)
  • --list is now mq list
  • --clear-cache is now mq cache clear

BREAKING CHANGE: -c no longer means --count, --args NAME VALUE is now --arg, --argv is now --args, --list is now mq list, and --clear-cache is now mq cache clear.

Type of Change

  • 🐛 Bug fix
  • ✨ New feature
  • ♻️ Refactor
  • 📝 Documentation
  • ⚡ Performance
  • ✅ Test
  • 📦 Build / dependencies
  • 👷 CI

Checklist

  • I ran cargo fmt and cargo clippy and addressed any warnings
  • I ran just test-all and all tests pass
  • I added or updated tests covering this change
  • I updated relevant documentation (/docs, crate README.md) if needed
  • I added a changelog entry if this is a user-facing change

Additional Context

…ands

- `-c` is now the short form of `--compact` (jq compatible); `--count` is long-only
- `--arg NAME VALUE` sets a named string argument, `--args VALUES...` sets positional
  arguments (replaces `--args NAME VALUE` and `--argv`)
- `--list` is now `mq list`
- `--clear-cache` is now `mq cache clear`

BREAKING CHANGE: `-c` no longer means `--count`, `--args NAME VALUE` is now `--arg`,
`--argv` is now `--args`, `--list` is now `mq list`, and `--clear-cache` is now
`mq cache clear`.
…`, unify subcommand dispatch

- `mq list` is now `mq commands`. Descriptions come from the clap definition,
  external subcommands show their resolved path, and `--json` is added
- `mq cache clear` is removed and `--clear-cache` is restored, so the cache is
  cleared at run time before the query executes
- `run()` handles subcommands that take no query input (`commands`, `completion`,
  `help`, `compile`, `dap`) first, so query output flag validation no longer
  applies to them. `repl` skips output flag validation too

BREAKING CHANGE: `mq list` is now `mq commands`, and `mq cache clear` is
`--clear-cache` again.
@codspeed

codspeed Bot commented Oct 15, 2026 •

Copy link
Copy Markdown

Merging this PR will not alter performance

✅ 43 untouched benchmarks
⏩ 35 skipped benchmarks1


Comparing refactor/cli-flag-cleanup (9ba7596) with main (207a4ab)

Open in CodSpeed

Footnotes

  1. 35 benchmarks were skipped, so the baseline results were used instead. If they were deleted from the codebase, click here and archive them to remove them from the performance reports. ↩

@harehare
harehare merged commit e69af3a into main Oct 16, 2026
12 checks passed
@harehare
harehare deleted the refactor/cli-flag-cleanup branch October 16, 2026 00:35
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant