snip_cli/models/
commands_model.rs

1use crate::models::identifier_model::Identifier;
2use clap::Subcommand;
3
4#[derive(Subcommand)]
5pub enum Commands {
6    /// Adds entry to Snippet Collection file
7    Add {
8        #[arg(short, long)]
9        key: String,
10        #[arg(short, long)]
11        prefix: String,
12        #[arg(short, long)]
13        description: String,
14        #[arg(last(true))]
15        body: Vec<String>,
16    },
17    /// Removes entry from Snippet Collection file
18    Rm { key: String },
19    /// Edits entry in Snippet Collection file
20    Edit {
21        #[arg(short, long)]
22        key: String,
23        #[arg(short, long)]
24        prefix: Option<String>,
25        #[arg(short, long)]
26        description: Option<String>,
27        #[arg(last(true))]
28        body: Option<Vec<String>>,
29    },
30    /// Lists all entries in Snippet Collection file
31    Ls {
32        #[arg(value_enum)]
33        list_option: Identifier,
34    },
35    /// Gets entry from Snippet Collection file
36    Show { key: String },
37    /// Searches for entries in Snippet Collection file
38    Search {
39        #[arg(value_enum)]
40        id: Option<Identifier>,
41        #[arg(last(true))]
42        name: String,
43    },
44    /// Configures the Snippet Collection file
45    Config { path: Option<String> },
46    UpdateKey {
47        #[arg(short, long)]
48        old_key: String,
49        #[arg(short, long)]
50        new_key: String,
51    },
52    Open {
53        #[arg(short, long)]
54        editor: Option<String>,
55    },
56}