feat(configuration): Add global configuration

also update some error messages
This commit is contained in:
Alexander Navarro 2024-04-29 19:22:45 -04:00
parent 8cd4b4b10f
commit f0485abfbb
6 changed files with 67 additions and 22 deletions

View file

@ -1,26 +1,11 @@
use core::panic;
use std::{env, path::PathBuf};
use clap::Parser;
use std::error::Error;
mod configuration;
mod file_explorer;
mod grpc;
#[derive(Parser)]
#[command(version, about, long_about = None)]
struct Args {
#[arg(help = "Directory to scan for files")]
path: Option<PathBuf>,
}
#[tokio::main()]
async fn main() -> Result<(), Box<dyn Error>> {
let cli = Args::parse();
let path = cli
.path
.unwrap_or(env::current_dir().expect("Current directory is not available."));
let server = grpc::run()?;
server.connect().await?;