feat: authlite command

This commit is contained in:
mokurin000
2025-07-30 13:14:06 +08:00
parent 82e30c020d
commit d3c3592e67
7 changed files with 78 additions and 22 deletions

View File

@@ -1,5 +1,6 @@
use palc::Parser;
use palc::Subcommand;
use strum::EnumString;
#[derive(Parser)]
#[command(about = "SDGB api tool", long_about = env!("CARGO_PKG_DESCRIPTION"))]
@@ -8,8 +9,28 @@ pub struct Cli {
pub command: Commands,
}
#[derive(EnumString)]
pub enum AuthLiteVariant {
SDGB,
SDHJ,
}
#[derive(Subcommand)]
pub enum Commands {
/// Login with QRCode from wechat
QRLogin {
/// content of the qrcode, only the last 64 characters were used
#[arg(short, long)]
qrcode_content: String,
},
AuthLite {
#[arg(short, long, default_value = "1.50")]
title_ver: String,
#[arg(long, default_value = "SDGB")]
variant: AuthLiteVariant,
},
Ping,
Preview {
#[arg(short, long)]
@@ -19,10 +40,4 @@ pub enum Commands {
#[arg(short, long)]
user_id: u32,
},
/// Login with QRCode from wechat
QRLogin {
/// content of the qrcode, only the last 64 characters were used
#[arg(short, long)]
qrcode_content: String,
},
}