-
-
Notifications
You must be signed in to change notification settings - Fork 244
Expand file tree
/
Copy pathderive_parser.rs
More file actions
41 lines (33 loc) · 1.5 KB
/
derive_parser.rs
File metadata and controls
41 lines (33 loc) · 1.5 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
use crate::utils::auth_token::AuthToken;
use crate::utils::value_parsers::{auth_token_parser, kv_parser};
use clap::{ArgAction::SetTrue, Parser, Subcommand};
use super::dart_symbol_map::DartSymbolMapArgs;
use super::logs::LogsArgs;
use super::review::ReviewArgs;
#[derive(Parser)]
pub(super) struct SentryCLI {
#[command(subcommand)]
pub(super) command: SentryCLICommand,
#[arg(global=true, long="header", value_name="KEY:VALUE", value_parser=kv_parser)]
#[arg(help = "Custom headers that should be attached to all requests{n}in key:value format")]
pub(super) headers: Vec<(String, String)>,
#[arg(global=true, long, value_parser=auth_token_parser)]
#[arg(help = "Use the given Sentry auth token")]
pub(super) auth_token: Option<AuthToken>,
#[arg(global=true, ignore_case=true, value_parser=["trace", "debug", "info", "warn", "error"])]
#[arg(long, help = "Set the log output verbosity")]
pub(super) log_level: Option<String>,
#[arg(global=true, action=SetTrue, visible_alias="silent", long)]
#[arg(help = "Do not print any output while preserving correct exit code. \
This flag is currently implemented only for selected subcommands")]
pub(super) quiet: bool,
#[arg(global=true, action=SetTrue, long, hide=true, help="Always return 0 exit code")]
pub(super) allow_failure: bool,
}
#[derive(Subcommand)]
pub(super) enum SentryCLICommand {
Logs(LogsArgs),
DartSymbolMap(DartSymbolMapArgs),
#[command(hide = true)]
Review(ReviewArgs),
}