git integration

This commit is contained in:
aaron-jack-manning
2022-08-20 17:06:55 +10:00
parent 261aa74800
commit 1cc7adfeb8
4 changed files with 48 additions and 3 deletions

View File

@@ -1,5 +1,6 @@
#![allow(dead_code, unused_variables)]
mod git;
mod vault;
mod error;
mod tasks;
@@ -16,7 +17,7 @@ struct Args {
}
#[derive(clap::Subcommand, Debug)]
#[clap(version, about, author, global_setting = clap::AppSettings::DisableHelpSubcommand)]
#[clap(version, about, author, global_setting=clap::AppSettings::DisableHelpSubcommand)]
enum Command {
/// Create a new task.
New {
@@ -43,6 +44,11 @@ enum Command {
Complete {
id : tasks::Id,
},
/// Run Git commands at the root of the vault.
#[clap(trailing_var_arg=true)]
Git {
args : Vec<String>,
},
/// Commands for interacting with vaults.
#[clap(subcommand)]
Vault(VaultCommand),
@@ -151,6 +157,9 @@ fn program() -> Result<(), error::Error> {
task.save()?;
println!("Marked task {} as complete", colour::id(&id.to_string()));
},
Git { args } => {
git::run_command(args, vault_folder)?;
},
Vault(_) => unreachable!(),
}