diff --git a/cli-client/src/main.rs b/cli-client/src/main.rs index ea6772f..fa3b0bd 100644 --- a/cli-client/src/main.rs +++ b/cli-client/src/main.rs @@ -4,7 +4,7 @@ use strikes::clients::client::StrikeClient; use strikes::clients::local_client::LocalClient; use strikes::clients::remote_client::RemoteClient; use strikes::configuration::{get_configuration, Settings}; -use strikes::output::print_as_table; +use strikes::output::{print_as_table, print_strikes}; #[tokio::main] async fn main() { @@ -14,7 +14,7 @@ async fn main() { match &args.clone().command.unwrap() { Command::Strike { name } => match client.add_strike(name).await { - Ok(strikes) => println!("{} has now {} strikes!", name, strikes), + Ok(strikes) => print_strikes(name, strikes), Err(err) => eprintln!("Failed to add strike: {}", err), }, Command::Ls => { diff --git a/cli-client/src/output.rs b/cli-client/src/output.rs index 4842a98..ef18264 100644 --- a/cli-client/src/output.rs +++ b/cli-client/src/output.rs @@ -6,3 +6,7 @@ pub fn print_as_table(tarnished: Vec) { println!("{0: <10} | {1: <10} |", tarnished.name, tarnished.strikes); } } + +pub fn print_strikes(name: &str, strikes: i8) { + println!("{} has now {} strikes!", name, strikes); +}