heddle_cli_args/cli/cli_args/
commands_review.rs1use clap::{Args, Subcommand, ValueEnum};
5
6#[derive(Clone, Debug, Subcommand)]
7pub enum ReviewCommands {
8 Show(ReviewShowArgs),
10 Sign(ReviewSignArgs),
12 Next(ReviewNextArgs),
14 Health(ReviewHealthArgs),
16}
17
18#[derive(Clone, Debug, Args)]
19pub struct ReviewShowArgs {
20 pub state: Option<String>,
22 #[arg(long)]
24 pub all_signals: bool,
25}
26
27#[derive(Clone, Debug, Args)]
28pub struct ReviewSignArgs {
29 pub state: String,
30 #[arg(long, value_enum)]
32 pub kind: SignKindArg,
33 #[arg(long)]
35 pub justification: Option<String>,
36 #[arg(long)]
39 pub symbols: Vec<String>,
40 #[arg(long, default_value = "ed25519")]
42 pub algorithm: String,
43 #[arg(long)]
45 pub public_key: String,
46 #[arg(long)]
48 pub signature: String,
49 #[arg(long)]
53 pub signed_at_unix: i64,
54}
55
56#[derive(Clone, Debug, ValueEnum)]
57pub enum SignKindArg {
58 Read,
59 AgentPreview,
60 AgentCoReview,
61}
62
63impl SignKindArg {
64 pub fn as_wire(&self) -> &'static str {
65 match self {
66 Self::Read => "read",
67 Self::AgentPreview => "agent_preview",
68 Self::AgentCoReview => "agent_co_review",
69 }
70 }
71
72 pub fn as_proto(&self) -> api::heddle::api::v1alpha1::ReviewKind {
73 use api::heddle::api::v1alpha1::ReviewKind;
74 match self {
75 Self::Read => ReviewKind::Read,
76 Self::AgentPreview => ReviewKind::AgentPreview,
77 Self::AgentCoReview => ReviewKind::AgentCoReview,
78 }
79 }
80}
81
82#[derive(Clone, Debug, Args)]
83pub struct ReviewNextArgs {
84 #[arg(long)]
86 pub mine_only: bool,
87 #[arg(long)]
89 pub kind: Option<String>,
90}
91
92#[derive(Clone, Debug, Args)]
93pub struct ReviewHealthArgs {
94 #[arg(long)]
97 pub window: Option<u32>,
98}