From 9326428141d25b8eb2bb8d1ad5a3faef3b2dc9fe Mon Sep 17 00:00:00 2001 From: tangowithfoxtrot <5676771+tangowithfoxtrot@users.noreply.github.com> Date: Sun, 3 Nov 2024 11:20:15 -0800 Subject: [PATCH] feat: allow configuration via env vars --- Cargo.toml | 2 +- src/main.rs | 8 +++++++- 2 files changed, 8 insertions(+), 2 deletions(-) diff --git a/Cargo.toml b/Cargo.toml index 030f3c5..9b7e811 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -38,7 +38,7 @@ tokio = { version = "1.36.0", features = ["full"] } tokio-util = "0.7.8" ratatui = { version = "0.28.0", features = ["all-widgets"] } urlencoding = "2.1.2" -clap = { version = "4.5.20", features = ["derive", "cargo"] } +clap = { version = "4.5.20", features = ["derive", "cargo", "env"] } clap_complete = "4.5.33" itertools = "0.13.0" ctrlc = "3.4.5" diff --git a/src/main.rs b/src/main.rs index 0c7ecb1..218bc15 100644 --- a/src/main.rs +++ b/src/main.rs @@ -71,10 +71,16 @@ struct Cli { long, global = true, value_parser, + env = "MANAGARR_CONFIG_FILE", help = "The Managarr configuration file to use" )] config: Option, - #[arg(long, global = true, help = "Disable the terminal size checks")] + #[arg( + long, + global = true, + env = "MANAGARR_DISABLE_TERMINAL_SIZE_CHECKS", + help = "Disable the terminal size checks" + )] disable_terminal_size_checks: bool, }