treeflow 0.2.1

CLI tool for simplified Git worktree management to speed up switching contexts when working collaboratively.
Documentation
#![allow(dead_code)]
#![allow(dead_code)]
#![allow(unused_imports)]
#![allow(unused_variables)]

use std::fmt::Debug;
use clap::{CommandFactory, Parser};
use clap_complete::CompleteEnv;
use treeflow::utils::errors::CustomError;
use treeflow::core::config::{get_config_dir, Config};
use crate::cli::{commands, match_treeflow};
use treeflow::utils::constants::CD_MARKER;
use treeflow::utils::Return;

mod cli;

fn main() -> Result<(), CustomError> {
    let config_paths = get_config_dir()?;
    let config = Config::load(&config_paths)?;
    let command = commands::command(&config);
    CompleteEnv::with_factory(|| command.clone()).complete();
    let matches = command.get_matches();

    match match_treeflow(&matches, config_paths)? {
        Return::Cd { path } => {
            print!("{}{}", CD_MARKER, path.display());
            Ok(())
        }
        Return::Null {} => {
            Ok(())
        }
    }
}