cli: colorize output in various commands
Signed-off-by: NotAShelf <raf@notashelf.dev> Change-Id: I612086bad607a92e4ac1c1f09b41534d6a6a6964
This commit is contained in:
parent
1873bb19ae
commit
616916cd48
4 changed files with 48 additions and 20 deletions
|
|
@ -7,6 +7,7 @@ use std::{
|
|||
};
|
||||
|
||||
use indicatif::{ProgressBar, ProgressStyle};
|
||||
use yansi::Paint;
|
||||
|
||||
use crate::{
|
||||
cli::ForkArgs,
|
||||
|
|
@ -367,7 +368,7 @@ fn execute_init(
|
|||
add_to_gitignore()?;
|
||||
|
||||
println!();
|
||||
println!("✓ Fork initialized successfully");
|
||||
println!("{}", "✓ Fork initialized successfully".green());
|
||||
println!(" Parent: {url}");
|
||||
println!(" Ref: {} ({})", resolved_ref, match resolved_ref_type {
|
||||
RefType::Branch => "branch",
|
||||
|
|
@ -414,7 +415,7 @@ fn execute_set(
|
|||
local_config.parent = Some(parent.clone());
|
||||
local_config.save(config_dir)?;
|
||||
|
||||
println!("✓ Fork configuration updated");
|
||||
println!("{}", "✓ Fork configuration updated".green());
|
||||
println!(" Parent: {}", parent.id);
|
||||
println!(" Ref: {} ({})", parent.ref_, match parent.ref_type {
|
||||
RefType::Branch => "branch",
|
||||
|
|
@ -515,7 +516,7 @@ fn execute_unset() -> Result<(), PakkerError> {
|
|||
local_config.parent_config_hash = None;
|
||||
local_config.save(config_dir)?;
|
||||
|
||||
println!("✓ Fork configuration removed");
|
||||
println!("{}", "✓ Fork configuration removed".green());
|
||||
|
||||
Ok(())
|
||||
}
|
||||
|
|
@ -640,7 +641,7 @@ fn execute_sync() -> Result<(), PakkerError> {
|
|||
local_config.save(config_dir)?;
|
||||
|
||||
println!();
|
||||
println!("✓ Parent sync complete");
|
||||
println!("{}", "✓ Parent sync complete".green());
|
||||
println!(" Commit: {}", &commit_sha[..8]);
|
||||
|
||||
// Print diff of parent changes
|
||||
|
|
@ -678,7 +679,7 @@ fn execute_sync() -> Result<(), PakkerError> {
|
|||
for (slug, old_file, new_file) in updated {
|
||||
let old = old_file.as_deref().unwrap_or("?");
|
||||
let new = new_file.as_deref().unwrap_or("?");
|
||||
println!(" ~ {slug}: {old} → {new}");
|
||||
println!(" {} {slug}: {old} → {new}", "~".yellow());
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue