utils-cli 1.1.1

a compilation of utility scripts for every day use in building applications and using certain features on my laptop
use clap::{Parser, Subcommand};
use commands::{
    cli::CliCommands, gitignore::GitIgnoreCommands, readme::ReadmeCommands, store::StoreCommands,
};

use crate::{commands, config, style::LogMessage};

//acf
#[derive(Parser)]
#[command(author, version, about ="Compilation of utility scripts for everyday use", long_about = None)]
#[command(propagate_version = true)]
pub struct Utils {
    #[command(subcommand)]
    pub command: Commands,
}

impl Utils {
    pub async fn run() {
        let utils = Utils::parse();
        match utils.command {
            Commands::Ignore(git_ignore) => git_ignore.parse(),
            Commands::Readme(readme) => readme.parse(),
            Commands::Store(store) => store.parse().await.unwrap(),
            Commands::Upgrade => CliCommands::upgrade().await.unwrap(),
            Commands::Uninstall => CliCommands::uninstall().await.unwrap(),
            Commands::Sync => CliCommands::sync().await,
            Commands::Config => {
                // tell us the config path
                let config_path = config::Config::path().ok();
                if config_path.is_some() {
                    LogMessage::neutral(&format!(
                        "Modify the config file available at {}",
                        config_path.unwrap()
                    ));
                }
            }
        }
    }
}

#[derive(Subcommand)]
pub enum Commands {
    /// store data as key value pair
    Store(StoreCommands),
    /// generate .gitignore
    Ignore(GitIgnoreCommands),
    /// add readme to a git software project
    Readme(ReadmeCommands),
    /// Upgrade  the CLI
    Upgrade,
    /// uninstall the cli
    Uninstall,
    /// synchronize the data
    Sync,
    /// configure the cli behaviour via a config file at $HOME/.utils/utils.conf
    Config,
}