-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathmain.rs
More file actions
34 lines (30 loc) · 752 Bytes
/
main.rs
File metadata and controls
34 lines (30 loc) · 752 Bytes
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
mod cargo_book;
mod cargo_docs;
use clap::{Parser, Subcommand};
#[derive(Parser)]
#[clap(bin_name = "cargo")]
struct Executable {
#[clap(subcommand)]
command: Command,
}
#[derive(Subcommand)]
enum Command {
#[clap(name = "docs")]
#[clap(author, version, about, long_about = None)]
Docs(cargo_docs::Options),
#[clap(name = "book")]
#[clap(author, version, about, long_about = None)]
Book(cargo_book::Options),
}
#[tokio::main]
async fn main() -> Result<(), anyhow::Error> {
lg::info::init()?;
Ok(match Executable::parse().command {
Command::Docs(mut options) => {
options.run().await?;
}
Command::Book(mut options) => {
options.run().await?;
}
})
}