Begin CLI Work
Uses the Parser module + it sets up a help & version.
This commit is contained in:
parent
82c4d218d7
commit
d65b9a4c68
4 changed files with 120 additions and 1 deletions
|
|
@ -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"
|
||||
|
|
|
|||
|
|
@ -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();
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue