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
47
48
49
50
51
52
use crate::models::identifier_model::Identifier;
use clap::Subcommand;

#[derive(Subcommand)]
pub enum Commands {
    /// Adds entry to Snippet Collection file
    Add {
        #[arg(short, long)]
        key: String,
        #[arg(short, long)]
        prefix: String,
        #[arg(short, long)]
        description: String,
        #[arg(last(true))]
        body: Vec<String>,
    },
    /// Removes entry from Snippet Collection file
    Rm { key: String },
    /// Edits entry in Snippet Collection file
    Edit {
        #[arg(short, long)]
        key: String,
        #[arg(short, long)]
        prefix: Option<String>,
        #[arg(short, long)]
        description: Option<String>,
        #[arg(last(true))]
        body: Option<Vec<String>>,
    },
    /// Lists all entries in Snippet Collection file
    Ls {
        #[arg(value_enum)]
        list_option: Identifier,
    },
    /// Gets entry from Snippet Collection file
    Show { key: String },
    /// Searches for entries in Snippet Collection file
    Search {
        #[arg(value_enum)]
        id: Option<Identifier>,
        #[arg(last(true))]
        name: String,
    },
    /// Configures the Snippet Collection file
    Config { path: Option<String> },
    UpdateKey {
        #[arg(short, long)]
        old_key: String,
        #[arg(short, long)]
        new_key: String,
    },
}