-
-
Notifications
You must be signed in to change notification settings - Fork 246
Expand file tree
/
Copy pathmod.rs
More file actions
50 lines (42 loc) · 1.46 KB
/
Copy pathmod.rs
File metadata and controls
50 lines (42 loc) · 1.46 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
mod list;
use self::list::ListLogsArgs;
use super::derive_parser::{SentryCLI, SentryCLICommand};
use anyhow::Result;
use clap::ArgMatches;
use clap::{Args, Command, Parser as _, Subcommand};
const BETA_WARNING: &str = "[BETA] The \"logs\" command is in beta. The command is subject \
to breaking changes, including removal, in any Sentry CLI release.";
const LIST_ABOUT: &str = "List logs from your organization";
#[derive(Args)]
pub(super) struct LogsArgs {
#[command(subcommand)]
subcommand: LogsSubcommand,
}
#[derive(Subcommand)]
#[command(about = "[BETA] Manage logs in Sentry")]
#[command(long_about = format!(
"Manage and query logs in Sentry. \
This command provides access to log entries.\n\n\
{BETA_WARNING}")
)]
enum LogsSubcommand {
#[command(about = format!("[BETA] {LIST_ABOUT}"))]
#[command(long_about = format!("{LIST_ABOUT}. \
Query and filter log entries from your Sentry projects. \
Supports filtering by log level and custom queries.\n\n\
{BETA_WARNING}")
)]
List(ListLogsArgs),
}
pub(super) fn make_command(command: Command) -> Command {
LogsSubcommand::augment_subcommands(command)
}
pub(super) fn execute(_: &ArgMatches) -> Result<()> {
let SentryCLICommand::Logs(LogsArgs { subcommand }) = SentryCLI::parse().command else {
unreachable!("expected logs subcommand");
};
eprintln!("{BETA_WARNING}");
match subcommand {
LogsSubcommand::List(args) => list::execute(args),
}
}