cdr_today/cmd/mod.rs
1//! ST Commands
2use crate::err::Error;
3use structopt::StructOpt;
4
5mod run;
6
7#[derive(StructOpt)]
8/// The server of cdr.today
9enum Opt {
10 /// Run api server
11 Run {
12 /// Http server Port
13 #[structopt(long, short, default_value = "1439")]
14 port: u16,
15 /// Verbose mode
16 #[structopt(long, short)]
17 verbose: bool,
18 },
19}
20
21/// Exec st commands
22pub async fn exec() -> Result<(), Error> {
23 match Opt::from_args() {
24 Opt::Run { port, verbose } => run::exec(port, verbose).await,
25 }?;
26
27 Ok(())
28}