asimov_cli/commands/
message.rs1use asimov_protocol::Topic;
4use clientele::{StandardOptions, crates::clap::Subcommand};
5use core::error::Error;
6use std::string::String;
7
8#[derive(Debug, Subcommand)]
9pub enum MessageCommand {
10 Send {
12 recipient: Topic,
14
15 message: String,
17
18 #[arg(long)]
20 ticket: Option<String>,
21 },
22}
23
24impl MessageCommand {
25 pub async fn run(&self, flags: &StandardOptions) -> Result<(), Box<dyn Error>> {
26 use MessageCommand::*;
27 match self {
28 Send {
29 recipient,
30 message,
31 ticket,
32 } => send(recipient, message, ticket, flags).await,
33 }
34 }
35}
36
37mod send;
38pub use send::*;