diff options
Diffstat (limited to '')
| -rw-r--r-- | crates/common/src/shell.rs (renamed from crates/turtle/src/atuin_common/shell.rs) | 10 |
1 files changed, 6 insertions, 4 deletions
diff --git a/crates/turtle/src/atuin_common/shell.rs b/crates/common/src/shell.rs index 880ff00f..a57250e2 100644 --- a/crates/turtle/src/atuin_common/shell.rs +++ b/crates/common/src/shell.rs @@ -1,5 +1,5 @@ -#[derive(PartialEq)] -pub(crate) enum Shell { +#[derive(PartialEq, Clone, Copy, Debug)] +pub enum Shell { Sh, Bash, Fish, @@ -30,13 +30,15 @@ impl std::fmt::Display for Shell { } impl Shell { - pub(crate) fn from_env() -> Self { + #[must_use] + pub fn from_env() -> Self { std::env::var("ATUIN_SHELL").map_or(Self::Unknown, |shell| { Self::from_string(shell.trim().to_lowercase().as_str()) }) } - pub(crate) fn from_string(name: &str) -> Self { + #[must_use] + pub fn from_string(name: &str) -> Self { match name { "bash" => Self::Bash, "fish" => Self::Fish, |
