gitm 0.4.3

Git manager is a nice wrapper to git, where it manages repos in a specified directory
Documentation
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
use crate::config::{Configuration, Editors};

pub mod editor_nvim;
pub mod editor_vscode;

pub trait EditorOpen {
  fn open(&self, dir: &str) -> Result<(), ()>;
}

pub fn get_editor<'a>(config: &Configuration) -> Option<&'a dyn EditorOpen> {
  let editor: &'a dyn EditorOpen = match config.editor? {
    Editors::Neovim => &editor_nvim::Neovim,
    Editors::VSCode => &editor_vscode::VSCode,
  };

  Some(editor)
}