From 2051896d99750ccfb7940d645cb3affc0b667dd3 Mon Sep 17 00:00:00 2001 From: Jason Ribble Date: Wed, 24 Jul 2024 07:42:31 -0700 Subject: [PATCH] feat: show contact via CLI - need to make into table - discovered bug; phone / email will be emptied in edit command --- src/commander.rs | 3 +++ src/main.rs | 5 +++++ 2 files changed, 8 insertions(+) diff --git a/src/commander.rs b/src/commander.rs index 04250a5..75721e1 100644 --- a/src/commander.rs +++ b/src/commander.rs @@ -14,6 +14,9 @@ pub enum Commands { /// Edit a contact by ID Edit(EditCommand), + + /// Get all contacts + Show, } #[derive(Args)] diff --git a/src/main.rs b/src/main.rs index e3d68e4..a69850b 100644 --- a/src/main.rs +++ b/src/main.rs @@ -49,6 +49,11 @@ async fn main() -> anyhow::Result<()> { let _ = contact_repo.update(contact).await; } + Commands::Show => { + let contacts = contact_repo.get_all().await?; + + println!("{contacts:?}") + } } Ok(())