You cannot select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

49 lines
1.0 KiB
Rust

use clap::Args;
use clap::Parser;
use clap::Subcommand;
use std::path::PathBuf;
#[derive(Parser, Debug)]
#[command(name = "Natter")]
#[command(version = env!("CARGO_PKG_VERSION"))]
#[command(about = "Generate a static site.", long_about = None)]
#[command(propagate_version = true)]
pub(crate) struct Cli {
#[command(subcommand)]
pub(crate) command: Commands,
}
#[derive(Subcommand, Debug)]
pub(crate) enum Commands {
/// Initialize an empty website folder.
Init(InitArgs),
/// Build the static site.
Build(BuildArgs),
}
#[derive(Args, Debug)]
pub(crate) struct InitArgs {
/// Path where you want the initial natter structure to be located.
#[arg(short, long)]
pub(crate) path: PathBuf,
}
#[derive(Args, Debug)]
pub(crate) struct BuildArgs {
/// Path to the natter config file.
#[arg(short, long)]
pub(crate) config: PathBuf,
}
#[cfg(test)]
mod tests {
use super::*;
#[test]
fn verify_cli() {
use clap::CommandFactory;
Cli::command().debug_assert()
}
}