abbaye/cli.rs
1use std::path::PathBuf;
2
3use clap::Parser;
4use clap::Subcommand;
5
6#[derive(Parser, Debug)]
7#[command(author, version, about, long_about = None)]
8pub struct CliArgs {
9 /// Verbosity level (0 = normal, 1 = verbose, 2 = debug)
10 #[arg(short, long, default_value_t = 0, action=clap::ArgAction::Count)]
11 verbose: u8,
12 #[command(subcommand)]
13 pub command: CliCommand,
14}
15
16#[derive(Subcommand, Debug, Clone)]
17pub enum CliCommand {
18 /// Initialize a new abbaye.toml file
19 Init {
20 /// path to directory to initialize in
21 path: Option<PathBuf>,
22 },
23 /// Build the site
24 Build,
25 /// Build the site for every git tag, starting from the lowest semver version.
26 /// Checks out each tag in order, builds, then restores the original HEAD.
27 BuildAll,
28 /// Dumps the default theme to `.abbaye/theme` so you can inspect and modify it. It will be used afterwards when building the site.
29 DumpTheme,
30}