From 4b99f2028db9c637e3fbf1fa98b3f126db1b86ec Mon Sep 17 00:00:00 2001 From: Quaternions <krakow20@gmail.com> Date: Thu, 26 Dec 2024 15:46:56 -0800 Subject: [PATCH] wip --- src/cmd/mod.rs | 26 ++++++++++++++++++++++++++ src/main.rs | 29 +++-------------------------- 2 files changed, 29 insertions(+), 26 deletions(-) create mode 100644 src/cmd/mod.rs diff --git a/src/cmd/mod.rs b/src/cmd/mod.rs new file mode 100644 index 0000000..e5d499f --- /dev/null +++ b/src/cmd/mod.rs @@ -0,0 +1,26 @@ +use clap::{Args,Parser,Subcommand}; + +#[derive(Parser)] +#[command(author,version,about,long_about=None)] +#[command(propagate_version=true)] +pub struct Cli{ + #[command(subcommand)] + command:Commands, +} + +#[derive(Subcommand)] +pub enum Commands{ + Review(ReviewCommand), + UploadScripts(UploadScriptsCommand), +} + +#[derive(Args)] +struct ReviewCommand{ + #[arg(long)] + cookie:String, +} +#[derive(Args)] +struct UploadScriptsCommand{ + #[arg(long)] + session_id:PathBuf, +} diff --git a/src/main.rs b/src/main.rs index b79c39e..a4c830f 100644 --- a/src/main.rs +++ b/src/main.rs @@ -1,31 +1,8 @@ -use clap::{Args,Parser,Subcommand}; +mod cmd; + +use cmd::{Cli,Commands}; use futures::{StreamExt,TryStreamExt}; -#[derive(Parser)] -#[command(author,version,about,long_about=None)] -#[command(propagate_version=true)] -struct Cli{ - #[command(subcommand)] - command:Commands, -} - -#[derive(Subcommand)] -enum Commands{ - Review(ReviewCommand), - UploadScripts(UploadScriptsCommand), -} - -#[derive(Args)] -struct ReviewCommand{ - #[arg(long)] - cookie:String, -} -#[derive(Args)] -struct UploadScriptsCommand{ - #[arg(long)] - session_id:PathBuf, -} - #[tokio::main] async fn main(){ let cli=Cli::parse();