mirror of
https://github.com/supleed2/omg-rs.git
synced 2024-11-09 18:45:48 +00:00
Add basic command structure and options for account
Include demo comments that are used by Clap in help messages
This commit is contained in:
parent
9c96dc9108
commit
d4bed3b436
96
src/cli.rs
96
src/cli.rs
|
@ -2,22 +2,44 @@ use clap::{Parser, Subcommand};
|
||||||
|
|
||||||
#[derive(Parser)]
|
#[derive(Parser)]
|
||||||
pub struct Cli {
|
pub struct Cli {
|
||||||
/// Set a custom username
|
/// Set which omg.lol username to use, overrides config and environment variable (OMGLOL_USERNAME)
|
||||||
#[clap(short, long)]
|
#[clap(short, long)]
|
||||||
pub name: Option<String>,
|
pub name: Option<String>,
|
||||||
|
/// Which subciomnmnandnjhsdflk
|
||||||
#[clap(subcommand)]
|
#[clap(subcommand)]
|
||||||
pub command: Option<Commands>,
|
pub command: Option<Commands>,
|
||||||
|
/// Print debug information, repeat for higher levels of debug info (max 1)
|
||||||
#[arg(short, long, action = clap::ArgAction::Count)]
|
#[arg(short, long, action = clap::ArgAction::Count)]
|
||||||
pub verbose: u8,
|
pub verbose: u8,
|
||||||
}
|
}
|
||||||
|
|
||||||
#[derive(Subcommand)]
|
#[derive(Subcommand)]
|
||||||
pub enum Commands {
|
pub enum Commands {
|
||||||
|
Account{ // TODO: include or not?
|
||||||
|
/// Email of your omg.lol account, needed for Account commands only
|
||||||
|
email: String,
|
||||||
|
#[clap(subcommand)]
|
||||||
|
command: Account,
|
||||||
|
},
|
||||||
|
Address,
|
||||||
Auth {
|
Auth {
|
||||||
api_key: String,
|
api_key: String,
|
||||||
},
|
},
|
||||||
|
Directory,
|
||||||
|
/// Adjust the switchboard / DNS records for your omg.lol subdomain
|
||||||
|
DNS,
|
||||||
|
Email,
|
||||||
|
NowPage,
|
||||||
|
Pastebin,
|
||||||
|
Preferences{ // TODO: include or not?
|
||||||
|
},
|
||||||
|
PURL,
|
||||||
|
Service{ // TODO: include or not?
|
||||||
|
},
|
||||||
|
Status,
|
||||||
|
Theme{ // TODO: include or not?
|
||||||
|
},
|
||||||
|
Web,
|
||||||
Weblog {
|
Weblog {
|
||||||
#[arg(short, long)]
|
#[arg(short, long)]
|
||||||
yay: u8,
|
yay: u8,
|
||||||
|
@ -25,11 +47,67 @@ pub enum Commands {
|
||||||
#[arg(short, long)]
|
#[arg(short, long)]
|
||||||
nay: Option<u8>,
|
nay: Option<u8>,
|
||||||
},
|
},
|
||||||
Status {
|
}
|
||||||
#[arg(long)]
|
|
||||||
message: String,
|
|
||||||
|
|
||||||
/// Does this explain it?
|
// Link for info to add above: https://api.omg.lol/
|
||||||
req: String,
|
|
||||||
|
#[derive(Subcommand)]
|
||||||
|
pub enum Account {
|
||||||
|
/// Get information about your account
|
||||||
|
GetInfo,
|
||||||
|
GetAddrs,
|
||||||
|
GetName,
|
||||||
|
SetName {
|
||||||
|
name: String,
|
||||||
},
|
},
|
||||||
}
|
GetSessions,
|
||||||
|
RemoveSession {
|
||||||
|
session_id: String,
|
||||||
|
},
|
||||||
|
GetSettings,
|
||||||
|
SetSettings {
|
||||||
|
json_data: String,
|
||||||
|
},
|
||||||
|
}
|
||||||
|
|
||||||
|
#[derive(Subcommand)]
|
||||||
|
pub enum Address {}
|
||||||
|
|
||||||
|
#[derive(Subcommand)]
|
||||||
|
pub enum Auth {}
|
||||||
|
|
||||||
|
#[derive(Subcommand)]
|
||||||
|
pub enum Directory {}
|
||||||
|
|
||||||
|
#[derive(Subcommand)]
|
||||||
|
pub enum DNS {}
|
||||||
|
|
||||||
|
#[derive(Subcommand)]
|
||||||
|
pub enum Email {}
|
||||||
|
|
||||||
|
#[derive(Subcommand)]
|
||||||
|
pub enum NowPage {}
|
||||||
|
|
||||||
|
#[derive(Subcommand)]
|
||||||
|
pub enum Pastebin {}
|
||||||
|
|
||||||
|
#[derive(Subcommand)]
|
||||||
|
pub enum Preferences {}
|
||||||
|
|
||||||
|
#[derive(Subcommand)]
|
||||||
|
pub enum PURL {}
|
||||||
|
|
||||||
|
#[derive(Subcommand)]
|
||||||
|
pub enum Service {}
|
||||||
|
|
||||||
|
#[derive(Subcommand)]
|
||||||
|
pub enum Status {}
|
||||||
|
|
||||||
|
#[derive(Subcommand)]
|
||||||
|
pub enum Theme {}
|
||||||
|
|
||||||
|
#[derive(Subcommand)]
|
||||||
|
pub enum Web {}
|
||||||
|
|
||||||
|
#[derive(Subcommand)]
|
||||||
|
pub enum Weblog {}
|
Loading…
Reference in a new issue