This commit is contained in:
tao.chen
2026-09-02 12:31:06 +08:00
commit 6fa600f88c
7 changed files with 2852 additions and 0 deletions
+41
View File
@@ -0,0 +1,41 @@
mod bark;
mod nettool;
mod archive;
use clap::{Parser, Subcommand};
#[derive(Parser, Debug)]
#[command(name = "toolbox", version, about = "多功能集成运维 CLI 工具")]
struct Cli {
#[command(subcommand)]
command: Commands,
}
#[derive(Subcommand, Debug)]
enum Commands {
/// 发送 Bark 推送通知
Bark(bark::BarkArgs),
/// 网络运维诊断工具
Nettool(nettool::NetToolArgs),
/// 文件归档与解压工具
Archive(archive::ArchiveArgs),
}
#[tokio::main]
async fn main() -> Result<(), Box<dyn std::error::Error>> {
let cli = Cli::parse();
match cli.command {
Commands::Bark(args) => {
bark::run(args).await?;
}
Commands::Nettool(args) => {
nettool::run(args).await?;
}
Commands::Archive(args) => {
archive::run(args).await?;
}
}
Ok(())
}