cantino / mcfly

Fly through your shell history. Great Scott!
MIT License
6.85k stars 178 forks source link

Please consider adding a config to enable/disable the tip/banner. #140

Closed cocoonkid closed 2 years ago

cocoonkid commented 3 years ago

Please consider adding a config to enable/disable the tip/banner.

navazjm commented 2 years ago

I would like to claim this one and try to implement it.

I have one idea on a potential solution. We add a boolean property to Settings called disable_menu. By default, it will be false. If users want to disable the menu, they can use an env variable to disable it. If the disable_menu is false, the menu will be displayed, otherwise disable the menu.

impl Settings { pub fn parse_args() -> Settings { settings.disable_menu = match env::var_os("MCFLY_DISABLE_MENU") { Some(_val) => true, None => false, }; } }


- interface.rs
```rust
fn menubar<W: Write>(&self, screen: &mut W) {
    if !self.settings.disable_menu {
        // show menu
    }
 }
cantino commented 2 years ago

This seems reasonable @michaelnavs!