2023-04-22 17:16:07 +00:00
|
|
|
use clap::{Parser, Subcommand};
|
|
|
|
|
|
|
|
#[derive(Parser)]
|
|
|
|
pub struct Cli {
|
|
|
|
/// Set a custom username
|
|
|
|
#[clap(short, long)]
|
2023-04-22 17:47:12 +00:00
|
|
|
pub name: Option<String>,
|
2023-04-22 17:16:07 +00:00
|
|
|
|
|
|
|
#[clap(subcommand)]
|
|
|
|
pub command: Option<Commands>,
|
|
|
|
|
|
|
|
#[arg(short, long, action = clap::ArgAction::Count)]
|
|
|
|
pub verbose: u8,
|
|
|
|
}
|
|
|
|
|
|
|
|
#[derive(Subcommand)]
|
|
|
|
pub enum Commands {
|
|
|
|
Auth {
|
|
|
|
api_key: String,
|
|
|
|
},
|
|
|
|
Weblog {
|
|
|
|
#[arg(short, long)]
|
|
|
|
yay: u8,
|
|
|
|
|
|
|
|
#[arg(short, long)]
|
|
|
|
nay: Option<u8>,
|
|
|
|
},
|
|
|
|
Status {
|
|
|
|
#[arg(long)]
|
|
|
|
message: String,
|
|
|
|
|
|
|
|
/// Does this explain it?
|
|
|
|
req: String,
|
|
|
|
},
|
|
|
|
}
|