feat: add explicit "query" subcommand#16
Open
mfacenet wants to merge 1 commit into
Open
Conversation
Both `sting query --author ...` and the direct root form (`sting --author ...`) now work. This makes the documented getting-started example in README.md functional while preserving the existing ergonomic direct-invocation style. Signed-off-by: Shawn Stratton <shawn.stratton@mface.net>
Contributor
There was a problem hiding this comment.
Pull request overview
This PR adds an explicit sting query subcommand to the CLI while preserving the existing “query via root flags” invocation style, aligning the implementation with documented usage.
Changes:
- Introduced a new
querysubcommand that reuses the existingrunQueryexecution path. - Registered the existing query flags on both the root command and the
querysubcommand sosting query --author ...works. - Updated root command long help text to document
sting queryexplicitly.
Reviewed changes
Copilot reviewed 2 out of 2 changed files in this pull request and generated 1 comment.
| File | Description |
|---|---|
| internal/cli/root.go | Wires queryCmd into the root command and registers query flags on both root and subcommand; updates help text. |
| internal/cli/query.go | Adds the queryCmd cobra command definition that reuses runQuery. |
Comment on lines
63
to
+66
| registerQueryFlags(rootCmd) | ||
| // Also register on the query subcommand so `sting query --author ...` works | ||
| // with the exact same flag surface (and satisfies documented usage). | ||
| registerQueryFlags(queryCmd) |
63d2f0b to
077b59a
Compare
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
Implemented the
sting querysubcommand.queryCmdininternal/cli/query.go(reuses the existing battle-testedrunQuery+ flag registration).internal/cli/root.go(flags registered on both root and the subcommand; added toAddCommand).Longhelp text to document the new form.Both styles continue to work:
sting query --author mendedlink --window 7dsting --author mendedlink --window 7d(unchanged, still fully supported)Why
The README (and getting-started section) documented
sting query ..., but only the root-flag path existed. This closes the documentation vs. implementation gap with a minimal, additive change.Testing performed
go -C tools tool task build→ cleango -C tools tool task test→ all packages passsting query --help(shows dedicated subcommand + flags)sting query(no args → friendly help, exit 0)sting --help(now listsquerycommand + updated description)No behavior change for existing users or the MCP path. Purely additive for the documented CLI surface.
Checklist
feat:)-S) + DCO sign-off (-s)