use std::path::PathBuf;
use clap::{Parser, Subcommand, ValueEnum};
#[derive(Parser)]
#[command(name = "canaad")]
#[command(version, about, long_about = None)]
pub(crate) struct Cli {
#[command(subcommand)]
pub(crate) command: Commands,
}
#[derive(Subcommand)]
pub(crate) enum Commands {
Canonicalize {
input: Option<String>,
#[arg(short = 'f', long = "file", conflicts_with = "input")]
file: Option<PathBuf>,
#[arg(short = 'o', long = "output", default_value = "utf8")]
output_format: OutputFormat,
#[arg(long = "to-file")]
to_file: Option<PathBuf>,
},
Validate {
input: Option<String>,
#[arg(short = 'f', long = "file", conflicts_with = "input")]
file: Option<PathBuf>,
#[arg(short = 'q', long = "quiet")]
quiet: bool,
},
Hash {
input: Option<String>,
#[arg(short = 'f', long = "file", conflicts_with = "input")]
file: Option<PathBuf>,
#[arg(short = 'o', long = "output", default_value = "hex")]
output_format: HashOutputFormat,
},
}
#[derive(Clone, Copy, ValueEnum)]
pub(crate) enum OutputFormat {
Utf8,
Hex,
Base64,
Raw,
}
#[derive(Clone, Copy, ValueEnum)]
pub(crate) enum HashOutputFormat {
Hex,
Base64,
}