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

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 {
pub(crate) command: Commands,
#[derive(Subcommand, Debug)]
pub(crate) enum Commands {
/// Initialize an empty website folder.
/// Build the static site.
#[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,
mod tests {
use super::*;
fn verify_cli() {
use clap::CommandFactory;