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
39
40
41
use clap::Parser;
use url::Url;
use super::*;
#[derive(Parser)]
#[clap(version = "1.5", author = "John S. <johnathan.sharratt@gmail.com>")]
pub struct Opts {
/// Sets the level of log verbosity, can be used multiple times
#[clap(short, long, parse(from_occurrences))]
pub verbose: i32,
/// URL where the user is authenticated (e.g. wss://tokera.sh/auth)
#[clap(short, long)]
pub auth: Option<Url>,
/// Token used to access your encrypted file-system (if you do not supply a token then you will
/// be prompted for a username and password)
#[clap(short, long)]
pub token: Option<String>,
/// Token file to read that holds a previously created token to be used to access your encrypted
/// file-system (if you do not supply a token then you will be prompted for a username and password)
#[clap(long)]
pub token_path: Option<String>,
/// Logs debug info to the console
#[clap(short, long)]
pub debug: bool,
#[clap(subcommand)]
pub subcmd: SubCommand,
}
#[derive(Parser)]
pub enum SubCommand {
/// Users are personal accounts and services that have an authentication context
#[clap()]
User(OptsUser),
/// Groups are collections of users that share something together
#[clap()]
Group(OptsDomain),
/// Tokens are stored authentication and authorization secrets used by other processes
#[clap()]
Token(OptsToken),
}