bular 0.0.2

CLI for managing Bular deployments
use std::path::PathBuf;

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

mod deploy;
mod dev;
mod init;
mod login;
mod logout;
mod new;
mod whoami;

#[derive(Parser)]
#[command(name = env!("CARGO_PKG_NAME"))]
#[command(bin_name = env!("CARGO_PKG_NAME"))]
#[command(version = concat!(env!("CARGO_PKG_VERSION"), " - ", env!("GIT_HASH")))]
#[command(disable_version_flag = true)]
#[command(about = env!("CARGO_PKG_DESCRIPTION"))]
pub struct Cli {
    // We wanna support `-v` and that's not a Clap default
    #[arg(short = 'v', short_alias = 'V', long, action = clap::builder::ArgAction::Version)]
    version: (),

    /// The directory to run this command in.
    #[arg(short, long, global = true, value_hint = ValueHint::FilePath, value_name = "PATH", default_value = "./")]
    pub cwd: PathBuf,

    /// The API backend to use. This is only really useful for development.
    #[arg(long, hide = true, default_value = "https://bular.cloud")]
    pub server: String,

    #[command(subcommand)]
    pub command: Commands,
}

#[derive(Subcommand)]
pub enum Commands {
    Login(login::Command),
    Logout(logout::Command),
    Whoami(whoami::Command),
    Deploy(deploy::Command),
    Dev(dev::Command),
    New(new::Command),
    Init(init::Command),
}