add colors

This commit is contained in:
JMARyA 2024-03-27 15:43:40 +01:00
parent 5802b1104c
commit bafbb58ff0
Signed by: jmarya
GPG key ID: 901B2ADDF27C2263
3 changed files with 38 additions and 2 deletions

View file

@ -1,4 +1,6 @@
use std::process::{Command, Output};
use ansi_term::Color;
mod args;
#[derive(Debug, Clone)]
@ -27,7 +29,9 @@ impl IterationOutput {
fn print_text(&self) {
println!(
"Commit [{}] ({}): {}",
self.commit.hash, self.commit.datetime, self.commit.name
Color::Green.paint(&self.commit.hash),
Color::Purple.paint(&self.commit.datetime),
Color::Blue.paint(&self.commit.name)
);
println!("{}", self.stdout);
if !self.stderr.is_empty() {
@ -169,7 +173,6 @@ fn main() {
if is_repository_clean(repo) || allow_dirty {
let commits = get_commit_list(repo).unwrap();
for commit in commits {
// todo : add colors
out.push(commit.run_command(&command));
}
checkout(repo, "main").unwrap();