-
Notifications
You must be signed in to change notification settings - Fork 3
/
cli.rs
36 lines (33 loc) · 847 Bytes
/
cli.rs
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
use clap::{Parser, Subcommand};
#[derive(Parser)]
#[clap(author, version, about, long_about = None)]
pub struct Cli {
#[clap(subcommand)]
pub command: Commands,
}
#[derive(Subcommand)]
pub enum Commands {
/// Add a project to the ecosystem file
Add {
#[clap(flatten)]
project: crate::ecosystem::ProjectSrc,
},
/// Build the site.
Build {
/// The directory in which to build the site.
#[clap(default_value = "./build")]
target: String,
/// Generate a CNAME file with the provided domain
#[clap(long)]
cname: Option<String>,
},
/// Clean the build directory.
Clean {
/// The directory in which the built files are.
#[clap(default_value = "./build")]
target: String,
},
}
pub fn parse() -> Cli {
Cli::parse()
}