at 4940405
use std::path::PathBuf; use clap::Parser; use clap::Subcommand; #[derive(Parser, Debug)] #[command(author, version, about, long_about = None)] pub struct CliArgs { /// Verbosity level (0 = normal, 1 = verbose, 2 = debug) #[arg(short, long, default_value_t = 0, action=clap::ArgAction::Count)] verbose: u8, #[command(subcommand)] pub command: CliCommand, } #[derive(Subcommand, Debug, Clone)] pub enum CliCommand { /// Initialize a new abbaye.toml file Init { /// path to directory to initialize in path: Option<PathBuf>, }, /// Build the site Build, /// Build the site for every git tag, starting from the lowest semver version. /// Checks out each tag in order, builds, then restores the original HEAD. BuildAll, /// Dumps the default theme to `.abbaye/theme` so you can inspect and modify it. It will be used afterwards when building the site. DumpTheme, /// Print a JSON Schema for `abbaye.toml` to stdout. /// /// Redirect the output to a file (e.g. `abbaye dump-schema > abbaye.schema.json`) and /// point your editor or TOML language server at it to get field descriptions and /// auto-completion while editing `abbaye.toml`. DumpSchema, }