elvsc

19 commits
Updated 2026-04-30 16:50:05
src
src/cli.rs
use crate::RemoteOrLocalBuf;

use clap::{Args, Subcommand};

#[derive(Debug, Clone, Args)]
pub struct ElvscGlobal {
    /// Connect to the hub and generate a new frontend for the targeted repository
    #[arg(long)]
    elvsc_update: bool,
}

#[derive(Debug, Clone, Subcommand)]
pub enum UpdateCommand {
    /// Connect to the hub and generate a new frontend for the hub
    Hub,
    /// Connect to the hub and generate a new frontend for the current repository
    Repo,
}

#[derive(clap::Parser, Clone, Debug)]
pub enum ElvscCommand {
    Connect {
        /// The path of the hub used to store repositories
        hub: RemoteOrLocalBuf,
        /// The public address where the hub frontend is accessible from,
        /// will be used to fetch assets and template all adresses
        #[arg(long)]
        public: String,
        /// The output for the hub frontend
        #[arg(long)]
        output: RemoteOrLocalBuf,
        /// The name of the current repository as it should appear in the hub
        #[arg(long)]
        repo: Option<String>,
        /// Force a new connection
        #[arg(long)]
        reconnect: bool,
        /// Dry run
        #[arg(long)]
        dry_run: bool,
    },
    #[command(subcommand)]
    Update(UpdateCommand),
}