Skip to content

Commit

Permalink
chore(cli): remove query -> cquery guidance (#7183)
Browse files Browse the repository at this point in the history
We've gotten feedback from multiple customers that this is surprising.
It also doesn't work well with flags that query accepts but cquery does
not.

---

### Changes are visible to end-users: no

### Test plan

- Covered by existing test cases

GitOrigin-RevId: 0c1981fe30637e9d355bd3fbd5bc6db5099dcc8f
  • Loading branch information
alexeagle authored and jbedard committed Oct 29, 2024
1 parent 2a395a5 commit f3c0768
Showing 1 changed file with 1 addition and 18 deletions.
19 changes: 1 addition & 18 deletions pkg/aspect/query/query.go
Original file line number Diff line number Diff line change
Expand Up @@ -30,8 +30,6 @@ import (
)

const (
useCQuery = "query.cquery.use"
useCQueryInquired = "query.cquery.inquired"
allowAllQueries = "query.all.allow"
allowAllQueriesInquired = "query.all.inquired"
)
Expand Down Expand Up @@ -88,21 +86,6 @@ func (runner *Query) Run(ctx context.Context, cmd *cobra.Command, args []string)
if err != nil {
return err
}

err = runner.checkConfig(
useCQuery,
useCQueryInquired,
"Use cquery instead of query",
)
if err != nil {
return err
}
}

command := "query"

if runner.Prefs.GetBool(useCQuery) {
command = "cquery"
}

if runner.Prefs.GetBool(allowAllQueries) {
Expand All @@ -114,7 +97,7 @@ func (runner *Query) Run(ctx context.Context, cmd *cobra.Command, args []string)
return shared.GetPrettyError(cmd, err)
}

command, query, runReplacements, err := shared.SelectQuery(command, presets, runner.Presets, presetNames, runner.Streams, nonFlags, runner.Select)
command, query, runReplacements, err := shared.SelectQuery(cmd.CalledAs(), presets, runner.Presets, presetNames, runner.Streams, nonFlags, runner.Select)
if err != nil {
return shared.GetPrettyError(cmd, err)
}
Expand Down

0 comments on commit f3c0768

Please sign in to comment.