From fee3905a4c175200fcc1c62959c6cdbe3c3d5b5e Mon Sep 17 00:00:00 2001 From: Bryan Newbold Date: Thu, 10 Nov 2022 19:32:20 -0800 Subject: cli: u/username on CLI; allow sending invite code --- adenosine-cli/src/bin/adenosine.rs | 11 +++++++++-- 1 file changed, 9 insertions(+), 2 deletions(-) diff --git a/adenosine-cli/src/bin/adenosine.rs b/adenosine-cli/src/bin/adenosine.rs index f593b11..6873a8b 100644 --- a/adenosine-cli/src/bin/adenosine.rs +++ b/adenosine-cli/src/bin/adenosine.rs @@ -61,7 +61,7 @@ enum AccountCommand { #[structopt(long, short)] email: String, - #[structopt(long, short)] + #[structopt(long = "--username", short = "-u")] handle: String, #[structopt(long, short)] @@ -69,6 +69,9 @@ enum AccountCommand { #[structopt(long, short)] recovery_key: Option, + + #[structopt(long, short)] + invite_code: Option, }, /// Delete the currently logged-in account (danger!) Delete, @@ -77,7 +80,7 @@ enum AccountCommand { /// This will return a JWT token that you should assign to the `ATP_AUTH_TOKEN` environment /// variable Login { - #[structopt(long, short)] + #[structopt(long = "--username", short = "-u")] handle: String, #[structopt(long, short)] @@ -433,6 +436,7 @@ fn run(opt: Opt) -> Result<()> { handle, password, recovery_key, + invite_code, }, } => { let mut body = json!({ @@ -443,6 +447,9 @@ fn run(opt: Opt) -> Result<()> { if let Some(key) = recovery_key { body["recoveryKey"] = json!(key); } + if let Some(code) = invite_code { + body["inviteCode"] = json!(code); + } xrpc_client.post( &Nsid::from_str("com.atproto.account.create")?, None, -- cgit v1.2.3