-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
These are still technically integration tests. They should be moved Bitch, you gave me the fucking clap
- Loading branch information
1 parent
d151a67
commit 2f67770
Showing
5 changed files
with
229 additions
and
25 deletions.
There are no files selected for viewing
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,56 @@ | ||
use clap::{Args, Parser, Subcommand}; | ||
|
||
#[derive(Parser)] | ||
#[command(version, about, long_about = None)] | ||
pub struct Cli { | ||
#[command(subcommand)] | ||
pub command: Commands, | ||
} | ||
|
||
#[derive(Subcommand)] | ||
pub enum Commands { | ||
/// Create a contact | ||
Create(CreateCommand), | ||
|
||
/// Edit a contact by ID | ||
Edit(EditCommand), | ||
} | ||
|
||
#[derive(Args)] | ||
pub struct CreateCommand { | ||
#[arg(short, long, value_name = "First Name")] | ||
pub first_name: Option<String>, | ||
|
||
#[arg(short, long, value_name = "Last Name")] | ||
pub last_name: Option<String>, | ||
|
||
#[arg(short, long, value_name = "Display Name")] | ||
pub display_name: Option<String>, | ||
|
||
#[arg(short, long)] | ||
pub email: Option<String>, | ||
|
||
#[arg(short, long, value_name = "Phone")] | ||
pub phone_number: Option<String>, | ||
} | ||
|
||
#[derive(Args, Debug)] | ||
pub struct EditCommand { | ||
/// ID of contact to edit | ||
id: i64, | ||
|
||
#[arg(short, long, value_name = "First Name")] | ||
first_name: Option<String>, | ||
|
||
#[arg(short, long, value_name = "Last Name")] | ||
last_name: Option<String>, | ||
|
||
#[arg(short, long, value_name = "Display Name")] | ||
display_name: Option<String>, | ||
|
||
#[arg(short, long)] | ||
email: Option<String>, | ||
|
||
#[arg(short, long, value_name = "Phone")] | ||
phone_number: Option<String>, | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.