Begin CLI Work

Uses the Parser module + it sets up a help & version.
This commit is contained in:
Sam Poder 2023-06-06 15:05:42 +00:00 committed by Cara Salter
parent 82c4d218d7
commit d65b9a4c68
4 changed files with 120 additions and 1 deletions

View file

@ -9,3 +9,4 @@ crate-type = ["lib", "staticlib"]
[dependencies]
tokio = { version = "1.21", features = ["rt", "macros"] }
tun = { version = "0.1", path = "../tun" }
clap = "4.3.2"

View file

@ -1,6 +1,15 @@
use clap::Parser;
use tokio::io::Result;
use tun::TunInterface;
#[derive(Parser)]
#[command(name = "Burrow")]
#[command(author = "Hack Club <team@hackclub.com>")]
#[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 {}
async fn try_main() -> Result<()> {
let iface = TunInterface::new()?;
println!("{:?}", iface.name());
@ -10,5 +19,6 @@ async fn try_main() -> Result<()> {
#[tokio::main(flavor = "current_thread")]
async fn main() {
let cli = Cli::parse();
try_main().await.unwrap();
}