Skip to content

Commit cece4fc

Browse files
chore: Link to docs for query syntax in help text (#3007)
### Description Users were saying it was hard to understand how you can configure `--query`. This PR updates the help text to link to https://docs.sentry.io/concepts/search/. --------- Co-authored-by: Daniel Szoke <[email protected]>
1 parent faebac2 commit cece4fc

File tree

4 files changed

+15
-8
lines changed

4 files changed

+15
-8
lines changed

src/commands/issues/list.rs

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,12 @@ pub fn make_command(command: Command) -> Command {
2828
.long("query")
2929
.value_name("QUERY")
3030
.default_value("")
31-
.help("Query to pass at the request. An example is \"is:unresolved\""),
31+
.hide_default_value(true)
32+
.help(
33+
"Query to filter issues. Example: \"is:unresolved\". \
34+
If omitted, no filtering is applied. \
35+
See https://docs.sentry.io/concepts/search/ for syntax.",
36+
),
3237
)
3338
}
3439

src/commands/logs/list.rs

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -65,8 +65,10 @@ pub(super) struct ListLogsArgs {
6565
#[arg(help = format!("Maximum number of log entries to fetch and display (max {}).", MAX_ROWS_RANGE.end()))]
6666
max_rows: NonZeroUsize,
6767

68-
#[arg(long = "query", default_value = "")]
69-
#[arg(help = "Query to filter logs. Example: \"level:error\"")]
68+
#[arg(long = "query", default_value = "", hide_default_value = true)]
69+
#[arg(help = "Query to filter logs. Example: \"level:error\". \
70+
If omitted, no filtering is applied. \
71+
See https://docs.sentry.io/concepts/search/ for syntax.")]
7072
query: String,
7173

7274
#[arg(long = "live")]

tests/integration/_cases/issues/issues-list-help.trycmd

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -13,8 +13,9 @@ Options:
1313
-p, --project <PROJECT> The project ID or slug.
1414
--pages <PAGES> Maximum number of pages to fetch (100 issues/page). [default: 5]
1515
--auth-token <AUTH_TOKEN> Use the given Sentry auth token.
16-
--query <QUERY> Query to pass at the request. An example is "is:unresolved"
17-
[default: ]
16+
--query <QUERY> Query to filter issues. Example: "is:unresolved". If omitted, no
17+
filtering is applied. See https://docs.sentry.io/concepts/search/
18+
for syntax.
1819
-s, --status <STATUS> Select all issues matching a given status. [possible values:
1920
resolved, muted, unresolved]
2021
-a, --all Select all issues (this might be limited).

tests/integration/_cases/logs/logs-list-help.trycmd

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -29,9 +29,8 @@ Options:
2929
[default: 100]
3030

3131
--query <QUERY>
32-
Query to filter logs. Example: "level:error"
33-
34-
[default: ]
32+
Query to filter logs. Example: "level:error". If omitted, no filtering is applied. See
33+
https://docs.sentry.io/concepts/search/ for syntax.
3534

3635
--live
3736
Live stream logs.

0 commit comments

Comments
 (0)