use std::path::PathBuf;
use clap::Parser;
use clap_verbosity_flag::Verbosity;
use crate::ssh::client::ConnectConfig;
#[derive(Debug, Parser)]
pub struct Cli {
#[command(flatten)]
pub verbosity: Verbosity,
#[command(subcommand)]
pub command: Command,
}
#[derive(Debug, Parser)]
pub enum Command {
Prepare(PrepareCommand),
Send(SendCommand),
}
#[derive(Debug, Parser)]
pub struct PrepareCommand {
#[arg(env = "SIGNSTAR_REQUEST_FILE")]
pub input: PathBuf,
}
#[derive(Debug, Parser)]
pub struct SendCommand {
#[arg(long, env = "SIGNSTAR_REQUEST_CONFIG", long_help = format!("Configuration file to use.
If unspecified, one of the following configuration files is used if it exists, in the following order:
{paths}", paths = ConnectConfig::CONFIG_ORDER.iter().map(|path| format!("- {path}")).collect::<Vec<_>>().join("\n")))]
pub config: Option<PathBuf>,
#[arg(long)]
pub user: String,
#[arg(env = "SIGNSTAR_REQUEST_FILE")]
pub input: PathBuf,
}