git-shadow 0.0.3

Standalone shadow copies of git repos (or parts of them) in a working directory.
//! `git shadow` — run git commands against shadow repositories that live
//! inside your working directory.
//!
//! A shadow repo is a separate git repository checked out inside another
//! project. Shadows are registered per parent repo in a config file under
//! the OS config directory, keyed by the parent's `remote.origin.url`, and
//! kept out of the parent's `git status` via `.git/info/exclude`.

mod cli;
mod commands;
mod config;
mod exclude;
mod git;
mod paths;
mod remote;

use std::process::ExitCode;

use clap::Parser;

use crate::cli::{Cli, Command};

fn main() -> ExitCode {
    match Cli::parse().command {
        Command::List { global } => commands::list::run(global),
        Command::Sync { name } => commands::sync::run(name.as_deref()),
        Command::Clone {
            repo,
            directory,
            name,
        } => commands::clone::run(&repo, directory, name),
        Command::Remove { name, delete } => commands::remove::run(&name, delete),
        Command::Passthrough(args) => commands::passthrough::run(&args),
    }
}