Skip to content

Commit

Permalink
Added verbose flag
Browse files Browse the repository at this point in the history
  • Loading branch information
jdjfisher committed Apr 16, 2023
1 parent fda4a4d commit cf1bda0
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 2 deletions.
10 changes: 8 additions & 2 deletions src/git.rs
Original file line number Diff line number Diff line change
@@ -1,8 +1,14 @@
use crate::Args;
use std::process::Command;
use std::process::{Command, Stdio};

pub fn checkout_target(target: &String, args: &Args) {
base_git_command(&args)
let mut command = base_git_command(&args);

if !args.verbose {
command.stdout(Stdio::null()).stderr(Stdio::null());
}

command
.args(["-c", "advice.detachedHead=false"])
.args(["checkout", target])
.status()
Expand Down
4 changes: 4 additions & 0 deletions src/main.rs
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,10 @@ pub struct Args {
/// Path
#[arg(short, long)]
directory: Option<PathBuf>,

/// Verbose
#[arg(short, long)]
verbose: bool,
}

#[derive(Copy, Clone, PartialEq, Eq, PartialOrd, Ord, ValueEnum, Debug)]
Expand Down

0 comments on commit cf1bda0

Please sign in to comment.