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
42
43
44
45
46
use clap::{Parser, Subcommand};
#[derive(Parser)]
pub struct CliArgs {
#[command(subcommand)]
pub command: Option<CLICommands>,
}
#[derive(Subcommand)]
pub enum CLICommands {
/// create new entry
New {
#[command(subcommand)]
style: EntryStyle,
},
/// lookup the given entry
Get { key: String },
/// update the entry
Update {
key: String,
// #[command(subcommand)]
// password: Option<Generate>,
},
/// delete the entry
Delete { key: String },
/// list the entries in the vault
List,
/// create a backup of the vault
Backup,
/// rotate master password for the vault
Rotate, // Transaction,
/// generate password
Gen(pants_gen::cli::CliArgs),
}
#[derive(Subcommand)]
pub enum EntryStyle {
Password {
name: String,
// #[command(subcommand)]
// password: Option<Generate>,
},
UsernamePassword {
name: String,
},
}