From d4bed3b436ada221566f2fc23f4d520bbd295939 Mon Sep 17 00:00:00 2001 From: Aadi Desai <21363892+supleed2@users.noreply.github.com> Date: Sun, 23 Apr 2023 00:56:51 +0100 Subject: [PATCH] Add basic command structure and options for account Include demo comments that are used by Clap in help messages --- src/cli.rs | 96 +++++++++++++++++++++++++++++++++++++++++++++++++----- 1 file changed, 87 insertions(+), 9 deletions(-) diff --git a/src/cli.rs b/src/cli.rs index 67235ae..db72b52 100644 --- a/src/cli.rs +++ b/src/cli.rs @@ -2,22 +2,44 @@ use clap::{Parser, Subcommand}; #[derive(Parser)] pub struct Cli { - /// Set a custom username + /// Set which omg.lol username to use, overrides config and environment variable (OMGLOL_USERNAME) #[clap(short, long)] pub name: Option, - + /// Which subciomnmnandnjhsdflk #[clap(subcommand)] pub command: Option, - + /// Print debug information, repeat for higher levels of debug info (max 1) #[arg(short, long, action = clap::ArgAction::Count)] pub verbose: u8, } #[derive(Subcommand)] 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 { 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 { #[arg(short, long)] yay: u8, @@ -25,11 +47,67 @@ pub enum Commands { #[arg(short, long)] nay: Option, }, - Status { - #[arg(long)] - message: String, +} - /// Does this explain it? - req: String, +// Link for info to add above: https://api.omg.lol/ + +#[derive(Subcommand)] +pub enum Account { + /// Get information about your account + GetInfo, + GetAddrs, + GetName, + SetName { + name: String, }, -} \ No newline at end of file + 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 {} \ No newline at end of file