rspyts-cli 3.0.1

Compiler and build orchestrator for rspyts
Documentation
//! Command-line syntax and argument types.

use std::path::PathBuf;

use clap::{Args, Parser, Subcommand};

#[derive(Debug, Parser)]
#[command(
    name = "rspyts",
    version,
    about = "Build one Rust API for Python and TypeScript"
)]
pub(crate) struct Cli {
    #[command(subcommand)]
    pub(crate) command: Command,
}

#[derive(Debug, Subcommand)]
pub(crate) enum Command {
    /// Create a Rust, Python, and TypeScript project.
    Init(InitArgs),
    /// Build the Python and TypeScript packages.
    Build(ProjectArgs),
    /// Rebuild when Rust or Cargo files change.
    Watch(ProjectArgs),
    /// Check that generated language sources match the Rust source.
    Check(ProjectArgs),
}

#[derive(Debug, Args)]
pub(crate) struct InitArgs {
    /// New project directory. The final path component is the package name.
    pub(crate) path: PathBuf,
    /// Initial Cargo, Python, and npm package version.
    #[arg(long, default_value = "0.1.0")]
    pub(crate) version: semver::Version,
}

#[derive(Debug, Args)]
pub(crate) struct ProjectArgs {
    /// Path to an rspyts application configuration.
    #[arg(long)]
    pub(crate) config: Option<PathBuf>,
}