Repository navigation
♻️ refactor(run): align CLI flags with jq and move actions to subcommnds - #2575
Merged
Merged
Conversation
…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.
Merging this PR will not alter performance
Comparing Footnotes
|
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
-cis now the short form of--compact(jq compatible);--countis long-only--arg NAME VALUEsets a named string argument,--args VALUES...sets positional arguments (replaces--args NAME VALUEand--argv)--listis nowmq list--clear-cacheis nowmq cache clearBREAKING CHANGE:
-cno longer means--count,--args NAME VALUEis now--arg,--argvis now--args,--listis nowmq list, and--clear-cacheis nowmq cache clear.Type of Change
Checklist
cargo fmtandcargo clippyand addressed any warningsjust test-alland all tests pass/docs, crateREADME.md) if neededAdditional Context