@smbcloud / cli / commits / 509854a

Add signup module

Seto Elkahfi committed Feb 20, 2023 at 18:44 UTC 509854a5051648d1b3729f19561c32612443ba68
5 files changed +15 -1
src/cli/mod.rs
+9 -1
@@ -13,7 +13,15 @@ pub struct Cli {
13
14 #[derive(Subcommand)]
15 pub enum Commands {
16 - #[clap(about = "Create a new project")]
16 + #[clap(about = "Create an account")]
17 + Signup {
18 + #[clap(short, long)]
19 + username: String,
20 + #[clap(short, long)]
21 + password: String,
22 + },
23 +
24 + #[clap(about = "Login to an account")]
25 Login {
26 #[clap(short, long)]
27 username: String,
src/lib.rs
+1
@@ -1,3 +1,4 @@
1 pub mod cli;
2 pub mod constants;
3 pub mod login;
4 +pub mod signup;
src/main.rs
+3
@@ -85,6 +85,9 @@ async fn run() -> Result<()> {
85 join_handle.await?;
86 spinner.stop_and_persist("✅", style("You are logged in!").green().bold().to_string())
87 }
88 + Commands::Signup { username, password } => {
89 + println!("Signup: {}, {}", username, password);
90 + }
91 }
92
93 Ok(())
src/signup/mod.rs new
+2
@@ -0,0 +1,2 @@
1 +pub mod process;
2 +pub use process::*;
src/signup/process.rs