From 021d92a48000e8e04548ef45bad64c753ad0d1b4 Mon Sep 17 00:00:00 2001 From: 魏曹先生 <1992414357@qq.com> Date: Thu, 19 Mar 2026 15:45:47 +0800 Subject: Add helpdoc module for environment variable handling --- utils/src/env/helpdoc.rs | 15 +++++++++++++++ 1 file changed, 15 insertions(+) create mode 100644 utils/src/env/helpdoc.rs (limited to 'utils/src/env/helpdoc.rs') diff --git a/utils/src/env/helpdoc.rs b/utils/src/env/helpdoc.rs new file mode 100644 index 0000000..d9bce2c --- /dev/null +++ b/utils/src/env/helpdoc.rs @@ -0,0 +1,15 @@ +/// Gets the default help documentation setting based on environment variables. +/// +/// The function checks the JV_HELPDOC environment variable. +/// If the variable is set to "1", it returns true (enabled). +/// If the variable is set to any other value, it returns false (disabled). +/// If the variable is not set, it returns true (enabled by default). +/// +/// # Returns +/// A boolean indicating whether help documentation is enabled +pub fn get_helpdoc_enabled() -> bool { + match std::env::var("JV_HELPDOC") { + Ok(value) => value == "1", + Err(_) => true, + } +} -- cgit