diff options
| author | Dan Davison <dandavison7@gmail.com> | 2024-11-16 10:51:28 -0500 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2024-11-16 10:51:28 -0500 |
| commit | 1dd28e7b51a913fc28eefc59d01f3b78f1146850 (patch) | |
| tree | 78daa146d86977963b64ab8b749cb3e06f31f0e2 /src/env.rs | |
| parent | b2fb1de562cddfecbd7b6013bd3a2b27063519f3 (diff) | |
Support {host} in hyperlinks (#1901)
* Support {host} in hyperlinks
* Improve help text
Diffstat (limited to 'src/env.rs')
| -rw-r--r-- | src/env.rs | 7 |
1 files changed, 7 insertions, 0 deletions
@@ -19,6 +19,7 @@ pub struct DeltaEnv { pub features: Option<String>, pub git_config_parameters: Option<String>, pub git_prefix: Option<String>, + pub hostname: Option<String>, pub navigate: Option<String>, pub pagers: (Option<String>, Option<String>), } @@ -33,6 +34,7 @@ impl DeltaEnv { let features = env::var(DELTA_FEATURES).ok(); let git_config_parameters = env::var(GIT_CONFIG_PARAMETERS).ok(); let git_prefix = env::var(GIT_PREFIX).ok(); + let hostname = hostname(); let navigate = env::var(DELTA_NAVIGATE).ok(); let current_dir = env::current_dir().ok(); @@ -53,12 +55,17 @@ impl DeltaEnv { features, git_config_parameters, git_prefix, + hostname, navigate, pagers, } } } +fn hostname() -> Option<String> { + grep_cli::hostname().ok()?.to_str().map(|s| s.to_string()) +} + #[cfg(test)] pub mod tests { use super::DeltaEnv; |
