mirror of
https://github.com/CompeyDev/ruck.git
synced 2025-05-04 10:44:01 +01:00
32 lines
695 B
Rust
32 lines
695 B
Rust
mod cli;
|
|
mod client;
|
|
mod conf;
|
|
mod crypto;
|
|
mod file;
|
|
mod message;
|
|
mod server;
|
|
|
|
use clap::Parser;
|
|
use cli::{Cli, Commands};
|
|
use client::{receive, send};
|
|
use server::serve;
|
|
use std::error::Error;
|
|
|
|
#[tokio::main]
|
|
async fn main() -> Result<(), Box<dyn Error>> {
|
|
let args = Cli::parse();
|
|
match &args.command {
|
|
Commands::Send { paths, password } => {
|
|
println!("Sending {:?}", paths);
|
|
send(paths, password).await?;
|
|
}
|
|
Commands::Receive { password } => {
|
|
println!("Receiving password {}", password);
|
|
receive(password).await?
|
|
}
|
|
Commands::Relay {} => {
|
|
serve().await?;
|
|
}
|
|
}
|
|
Ok(())
|
|
}
|