diff --git a/burrow/src/main.rs b/burrow/src/main.rs index 4e025bc..7ef7530 100644 --- a/burrow/src/main.rs +++ b/burrow/src/main.rs @@ -1,4 +1,4 @@ -use clap::Parser; +use clap::{Args, Parser, Subcommand}; use tokio::io::Result; use tun::TunInterface; @@ -8,7 +8,19 @@ use tun::TunInterface; #[command(version = "0.1")] #[command(about = "Burrow is a tool for burrowing through firewalls, built by teenagers at Hack Club.", long_about = None)] -struct Cli {} +struct Cli { + #[command(subcommand)] + command: Commands, +} + +#[derive(Subcommand)] +enum Commands { + /// Adds files to myapp + Start(StartArgs), +} + +#[derive(Args)] +struct StartArgs {} async fn try_main() -> Result<()> { let iface = TunInterface::new()?; @@ -19,6 +31,10 @@ async fn try_main() -> Result<()> { #[tokio::main(flavor = "current_thread")] async fn main() { - let _cli = Cli::parse(); - try_main().await.unwrap(); + let cli = Cli::parse(); + match &cli.command { + Commands::Start(..) => { + try_main().await.unwrap(); + } + } }