--config is now a required switch

This commit is contained in:
minish 2023-12-08 13:08:38 -05:00
parent a0ffd1ddd1
commit 0d176bca40
Signed by: min
GPG Key ID: FEECFF24EF0CE9E9
1 changed files with 3 additions and 2 deletions

View File

@ -21,7 +21,8 @@ mod view;
#[derive(Parser, Debug)]
struct Args {
/// The path to configuration file
config: Option<PathBuf>,
#[arg(short, long, value_name = "file")]
config: PathBuf,
}
#[tokio::main]
@ -30,7 +31,7 @@ async fn main() {
let args = Args::parse();
// read & parse config
let config_str = fs::read_to_string(args.config.unwrap_or("./breeze.toml".into()))
let config_str = fs::read_to_string(args.config)
.await
.expect("failed to read config file! make sure it exists and you have read permissions");