pants_store/
cli.rs

1use clap::{Parser, Subcommand};
2
3#[derive(Parser)]
4pub struct CliArgs {
5    #[command(subcommand)]
6    pub command: Option<CLICommands>,
7}
8
9#[derive(Subcommand)]
10pub enum CLICommands {
11    /// create new entry
12    New {
13        #[command(subcommand)]
14        style: EntryStyle,
15    },
16    /// lookup the given entry
17    Get { key: String },
18    /// update the entry
19    Update {
20        key: String,
21        // #[command(subcommand)]
22        // password: Option<Generate>,
23    },
24    /// delete the entry
25    Delete { key: String },
26    /// list the entries in the vault
27    List,
28    /// create a backup of the vault
29    Backup,
30    /// rotate master password for the vault
31    Rotate, // Transaction,
32    /// generate password
33    Gen(pants_gen::cli::CliArgs),
34}
35
36#[derive(Subcommand)]
37pub enum EntryStyle {
38    Password {
39        name: String,
40        // #[command(subcommand)]
41        // password: Option<Generate>,
42    },
43    UsernamePassword {
44        name: String,
45    },
46}