Skip to content

Commit

Permalink
feat: show contact via CLI
Browse files Browse the repository at this point in the history
- need to make into table
- discovered bug; phone / email will be emptied in edit command
  • Loading branch information
jasonribble committed Jul 24, 2024
1 parent dea5aa2 commit 2051896
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 0 deletions.
3 changes: 3 additions & 0 deletions src/commander.rs
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,9 @@ pub enum Commands {

/// Edit a contact by ID
Edit(EditCommand),

/// Get all contacts
Show,
}

#[derive(Args)]
Expand Down
5 changes: 5 additions & 0 deletions src/main.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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(())
Expand Down

0 comments on commit 2051896

Please sign in to comment.