From ad47aa2a68957fb4611bc6dbcff21c54ec6ea937 Mon Sep 17 00:00:00 2001 From: Luc Perkins Date: Mon, 5 Aug 2024 15:36:39 +0200 Subject: [PATCH] Add env vars for global variables --- src/cli/cmd/list.rs | 2 +- src/cli/mod.rs | 3 +++ 2 files changed, 4 insertions(+), 1 deletion(-) diff --git a/src/cli/cmd/list.rs b/src/cli/cmd/list.rs index 8cf91534..68d73ff6 100644 --- a/src/cli/cmd/list.rs +++ b/src/cli/cmd/list.rs @@ -27,7 +27,7 @@ pub(crate) struct ListSubcommand { cmd: Subcommands, /// Output results as JSON. - #[arg(long, global = true, env = "FH_JSON_OUTPUT")] + #[arg(long, global = true, env = "FH_OUTPUT_JSON")] json: bool, #[arg(from_global)] diff --git a/src/cli/mod.rs b/src/cli/mod.rs index 970a0366..87af644c 100644 --- a/src/cli/mod.rs +++ b/src/cli/mod.rs @@ -13,6 +13,7 @@ pub(crate) struct Cli { global = true, long, default_value = "https://api.flakehub.com", + env = "FH_API_ADDR", hide = true )] pub api_addr: url::Url, @@ -24,6 +25,7 @@ pub(crate) struct Cli { global = true, long, default_value = "https://cache.flakehub.com", + env = "FH_CACHE_ADDR", hide = true )] pub cache_addr: url::Url, @@ -35,6 +37,7 @@ pub(crate) struct Cli { global = true, long, default_value = "https://flakehub.com", + env = "FH_FRONTEND_ADDR", hide = true )] pub frontend_addr: url::Url,