1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
use clap::{Parser, Subcommand};

use crate::{auth_app, projects};

#[derive(Parser)]
#[clap(author, version, about)]
pub struct Cli {
    /// Log level: trace, debug, info, warn, error, off
    #[clap(short, long, global = true)]
    pub log_level: Option<String>,

    #[clap(subcommand)]
    pub command: Commands,
}

#[derive(Subcommand)]
pub enum Commands {
    #[clap(about = "Create an account. Use your email as your username.")]
    Signup {},
    #[clap(about = "Login to your account. To create an account, use smb signup.")]
    Login {},
    #[clap(about = "Logout all session.")]
    Logout {},
    #[clap(about = "Forgot email? Use this command to reset your password.")]
    Forgot {},

    #[clap(about = "Manage your projects. Add, delete, edit. Need authentication.")]
    Projects {
        #[clap(subcommand)]
        command: projects::Commands,
    },

    #[clap(about = "Manage your AuthApp. Add, delete, edit. Need authentication.")]
    AuthApp {
        #[clap(subcommand)]
        command: auth_app::cli::Commands,
    },
}