Repository: zellij-org/zellij
File: zellij-utils/src/setup.rs (Rust)

Code before:
        write!(
            &mut message,
            " Or check the font that is in use:\n {}\n",
            hyperlink_compat
        )
        .unwrap();
        message.push_str("[MOUSE INTERACTION]: \n");
        message.push_str(" Can be temporarily disabled through pressing the [SHIFT] key.\n");
        message.push_str(" If that doesn't fix any issues consider to disable the mouse handling of zellij: 'zellij options --disable-mouse-mode'\n");

        writeln!(&mut message, "[FEATURES]: {:?}", FEATURES).unwrap();
        let mut hyperlink = String::new();
        hyperlink.push_str(hyperlink_start);
        hyperlink.push_str("https://www.zellij.dev/documentation/");
        hyperlink.push_str(hyperlink_mid);
        hyperlink.push_str("zellij.dev/documentation");
        hyperlink.push_str(hyperlink_end);
        writeln!(&mut message, "[DOCUMENTATION]: {}", hyperlink).unwrap();
        //printf '\e]8;;http://example.com\e\\This is a link\e]8;;\e\\\n'

        std::io::stdout().write_all(message.as_bytes())?;

        Ok(())
    }
    fn generate_completion(shell: &str) {
        let shell: Shell = match shell.parse() {
            Ok(shell) => shell,
            _ => {
                eprintln!("Unsupported shell: {}", shell);
                std::process::exit(1);
            }
        };
        let mut out = std::io::stdout();
        clap_complete::generate(shell, &mut CliArgs::into_app(), "zellij", &mut out);
    }
}

#[cfg(test)]
mod setup_test {
    use super::Setup;
    use crate::input::{
        config::{Config, ConfigError},
        layout::LayoutFromYamlIntermediate,
        options::Options,
    };

    fn deserialise_config_and_layout(
        config: &str,
        layout: &str,
    ) -> Result<(Config, LayoutFromYamlIntermediate), ConfigError> {
        let config = Config::from_yaml(config)?;

Review comment (suggestion):
Since the `Shell` can only be in lower-case, it would be nice to have a part to convert it to lower-case.

```rust
let shell: Shell = match.shell.to_lowercase().parse() {
...
}
```

Code after:
        write!(
            &mut message,
            " Or check the font that is in use:\n {}\n",
            hyperlink_compat
        )
        .unwrap();
        message.push_str("[MOUSE INTERACTION]: \n");
        message.push_str(" Can be temporarily disabled through pressing the [SHIFT] key.\n");
        message.push_str(" If that doesn't fix any issues consider to disable the mouse handling of zellij: 'zellij options --disable-mouse-mode'\n");

        writeln!(&mut message, "[FEATURES]: {:?}", FEATURES).unwrap();
        let mut hyperlink = String::new();
        hyperlink.push_str(hyperlink_start);
        hyperlink.push_str("https://www.zellij.dev/documentation/");
        hyperlink.push_str(hyperlink_mid);
        hyperlink.push_str("zellij.dev/documentation");
        hyperlink.push_str(hyperlink_end);
        writeln!(&mut message, "[DOCUMENTATION]: {}", hyperlink).unwrap();
        //printf '\e]8;;http://example.com\e\\This is a link\e]8;;\e\\\n'

        std::io::stdout().write_all(message.as_bytes())?;

        Ok(())
    }
    fn generate_completion(shell: &str) {
        let shell: Shell = match shell.to_lowercase().parse() {
            Ok(shell) => shell,
            _ => {
                eprintln!("Unsupported shell: {}", shell);
                std::process::exit(1);
            }
        };
        let mut out = std::io::stdout();
        clap_complete::generate(shell, &mut CliArgs::into_app(), "zellij", &mut out);
    }
}

#[cfg(test)]
mod setup_test {
    use super::Setup;
    use crate::input::{
        config::{Config, ConfigError},
        layout::LayoutFromYamlIntermediate,
        options::Options,
    };

    fn deserialise_config_and_layout(
        config: &str,
        layout: &str,
    ) -> Result<(Config, LayoutFromYamlIntermediate), ConfigError> {
        let config = Config::from_yaml(config)?;