wip
This commit is contained in:
parent
e9e51d455b
commit
4b99f2028d
26
src/cmd/mod.rs
Normal file
26
src/cmd/mod.rs
Normal file
@ -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,
|
||||||
|
}
|
29
src/main.rs
29
src/main.rs
@ -1,31 +1,8 @@
|
|||||||
use clap::{Args,Parser,Subcommand};
|
mod cmd;
|
||||||
|
|
||||||
|
use cmd::{Cli,Commands};
|
||||||
use futures::{StreamExt,TryStreamExt};
|
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]
|
#[tokio::main]
|
||||||
async fn main(){
|
async fn main(){
|
||||||
let cli=Cli::parse();
|
let cli=Cli::parse();
|
||||||
|
Loading…
x
Reference in New Issue
Block a user