signstar_request_signature/
cli.rs1use std::path::PathBuf;
4
5use clap::Parser;
6use clap_verbosity_flag::Verbosity;
7
8use crate::ssh::client::ConnectConfig;
9
10#[derive(Debug, Parser)]
12pub struct Cli {
13 #[command(flatten)]
15 pub verbosity: Verbosity,
16
17 #[command(subcommand)]
19 pub command: Command,
20}
21
22#[derive(Debug, Parser)]
24pub enum Command {
25 Prepare(PrepareCommand),
27
28 Send(SendCommand),
30}
31
32#[derive(Debug, Parser)]
34pub struct PrepareCommand {
35 #[arg(env = "SIGNSTAR_REQUEST_FILE")]
37 pub input: PathBuf,
38}
39
40#[derive(Debug, Parser)]
42pub struct SendCommand {
43 #[arg(long, env = "SIGNSTAR_REQUEST_CONFIG", long_help = format!("Configuration file to use.
45
46If unspecified, one of the following configuration files is used if it exists, in the following order:
47
48{paths}", paths = ConnectConfig::CONFIG_ORDER.iter().map(|path| format!("- {path}")).collect::<Vec<_>>().join("\n")))]
49 pub config: Option<PathBuf>,
50
51 #[arg(long)]
55 pub user: Option<String>,
56
57 #[arg(env = "SIGNSTAR_REQUEST_FILE")]
59 pub input: PathBuf,
60}