use argh::FromArgs;
#[derive(FromArgs, PartialEq, Debug)]
pub struct FlowCtlOptions {
#[argh(option, default = "String::from(\"http://localhost:8080\")")]
pub url: String,
#[argh(subcommand)]
pub command: Command,
}
#[derive(FromArgs, PartialEq, Debug)]
#[argh(subcommand)]
pub enum Command {
List(LsOpts),
Describe(DescribeOpts),
Download(DownloadOpts),
Secret(SecretOpts),
Subscribe(SubscribeOpts),
Submit(SubmitOpts),
}
#[derive(FromArgs, PartialEq, Debug)]
#[argh(subcommand, name = "list")]
pub struct LsOpts {}
#[derive(FromArgs, PartialEq, Debug)]
#[argh(subcommand, name = "describe")]
pub struct DescribeOpts {
#[argh(positional)]
pub id: String,
}
#[derive(FromArgs, PartialEq, Debug)]
#[argh(subcommand, name = "download")]
pub struct DownloadOpts {
#[argh(positional)]
pub id: String,
#[argh(positional)]
pub name: String,
#[argh(positional)]
pub local_dir_path: String,
}
#[derive(FromArgs, PartialEq, Debug)]
#[argh(subcommand, name = "secret")]
pub struct SecretOpts {
#[argh(subcommand)]
pub command: SecretCommand,
}
#[derive(FromArgs, PartialEq, Debug)]
#[argh(subcommand)]
pub enum SecretCommand {
Create(SecretCreateOpts),
Delete(SecretDeleteOpts),
Update(SecretUpdateOpts),
}
#[derive(FromArgs, PartialEq, Debug)]
#[argh(subcommand, name = "create")]
pub struct SecretCreateOpts {
#[argh(positional)]
pub key: String,
#[argh(positional)]
pub value: String,
}
#[derive(FromArgs, PartialEq, Debug)]
#[argh(subcommand, name = "delete")]
pub struct SecretDeleteOpts {
#[argh(positional)]
pub key: String,
}
#[derive(FromArgs, PartialEq, Debug)]
#[argh(subcommand, name = "update")]
pub struct SecretUpdateOpts {
#[argh(positional)]
pub key: String,
#[argh(positional)]
pub value: String,
}
#[derive(FromArgs, PartialEq, Debug)]
#[argh(subcommand, name = "subscribe")]
pub struct SubscribeOpts {
#[argh(switch)]
pub secure: bool,
}
#[derive(FromArgs, PartialEq, Debug)]
#[argh(subcommand, name = "submit")]
pub struct SubmitOpts {
#[argh(positional)]
pub file_path: String,
}