git integration
This commit is contained in:
11
src/main.rs
11
src/main.rs
@@ -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!(),
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user