feat(configuration): Add global configuration
also update some error messages
This commit is contained in:
parent
8cd4b4b10f
commit
f0485abfbb
6 changed files with 67 additions and 22 deletions
17
src/main.rs
17
src/main.rs
|
|
@ -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?;
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue