Conversation
Previously, `--tool` and `--no-tools` values were collected into
separate vecs and applied in a fixed order: disable-all > enable-all >
enable-named > disable-named. The position of flags on the command line
had no effect, making interleaved usage like `--tool=write --no-tools
--tool=read` surprising and unexpressive.
This implements RFD-008 by introducing a `ToolDirective` enum and a
`ToolDirectives` struct that preserves flag order using
`ArgMatches::indices_of`. `apply_enable_tools` now iterates directives
sequentially, enabling precise tool composition:
# Start from nothing, add only what you need
jp q --no-tool --tool=write
# Start from everything, carve out exceptions
jp q --tool --no-tool=dangerous_tool
The former restriction against combining bare `--no-tool` with bare
`--tool` is removed, since ordered evaluation makes that well-defined.
BREAKING CHANGE: `--no-tools` renamed to `--no-tool`
The long form `--no-tools` has been renamed to `--no-tool` to match the
singular `--tool` flag. The short form `-T` is unchanged. Update any
scripts or aliases using `--no-tools` to use `--no-tool` instead.
Signed-off-by: Jean Mertz <git@jeanmertz.com>
Signed-off-by: Jean Mertz <git@jeanmertz.com>
--tool/--no-tool flags left-to-right--tool/--no-tool flags left-to-right
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.
Previously,
--tooland--no-toolsvalues were collected intoseparate vecs and applied in a fixed order: disable-all > enable-all >
enable-named > disable-named. The position of flags on the command line had no effect, making interleaved usage like
--tool=write --no-tools --tool=readsurprising and unexpressive.This implements RFD-008 by introducing a
ToolDirectiveenum and aToolDirectivesstruct that preserves flag order usingArgMatches::indices_of.apply_enable_toolsnow iterates directives sequentially, enabling precise tool composition:The former restriction against combining bare
--no-toolwith bare--toolis removed, since ordered evaluation makes that well-defined.