1use clap::{ArgAction, Parser, Subcommand};
9
10#[derive(Parser)]
11#[command(
12 name = "dn",
13 version = "0.1.3",
14 about = "A command to manage notes following the Denote naming scheme"
15)]
16pub struct Cli {
17 #[command(subcommand)]
18 pub command: Commands,
19}
20
21#[derive(Subcommand)]
22pub enum Commands {
23 New {
25 #[arg(
27 short = 'p',
28 long = "print",
29 action = ArgAction::SetTrue,
30 )]
31 cli_print: bool,
32
33 #[arg(
35 short = 'd',
36 long = "directory",
37 value_name = "PATH",
38 action = ArgAction::Set,
39 )]
40 cli_directory_path: Option<String>,
41
42 #[arg(
44 short = 'c',
45 long = "config",
46 value_name = "PATH",
47 action = ArgAction::Set,
48 )]
49 cli_config_path: Option<String>,
50
51 #[arg(
53 short = 'T',
54 long = "template",
55 value_name = "PATH",
56 action = ArgAction::Set,
57 )]
58 cli_template_path: Option<String>,
59
60 #[arg(
62 short = 's',
63 long = "signature",
64 value_name = "SIGNATURE",
65 action = ArgAction::Set,
66 )]
67 cli_signature: Option<String>,
68
69 #[arg(
71 short = 't',
72 long = "title",
73 value_name = "TITLE",
74 action = ArgAction::Set,
75 )]
76 cli_title: Option<String>,
77
78 #[arg(
80 short = 'e',
81 long = "extension",
82 value_name = "EXTENSION",
83 action = ArgAction::Set,
84 )]
85 cli_extension: Option<String>,
86
87 #[arg(
89 short = 'k',
90 long = "keywords",
91 value_name = "KEYWORD(S)",
92 action = ArgAction::Set,
93 )]
94 cli_keywords: Option<String>,
95 },
96
97 Rename {
99 input: String,
101
102 #[arg(
104 short = 'p',
105 long = "print",
106 action = ArgAction::SetTrue,
107 )]
108 cli_print: bool,
109
110 #[arg(
112 short = 'I',
113 long = "regenerate-identifier",
114 action = ArgAction::SetTrue,
115 )]
116 cli_regenerate_identifier: bool,
117
118 #[arg(
120 short = 'c',
121 long = "config",
122 value_name = "PATH",
123 action = ArgAction::Set,
124 )]
125 cli_config_path: Option<String>,
126
127 #[arg(
129 short = 's',
130 long = "signature",
131 value_name = "SIGNATURE",
132 action = ArgAction::Set,
133 )]
134 cli_signature: Option<String>,
135
136 #[arg(
138 short = 't',
139 long = "title",
140 value_name = "TITLE",
141 action = ArgAction::Set,
142 )]
143 cli_title: Option<String>,
144
145 #[arg(
147 short = 'k',
148 long = "keywords",
149 value_name = "KEYWORDS",
150 action = ArgAction::Set,
151 )]
152 cli_keywords: Option<String>,
153
154 #[arg(
156 short = 'A',
157 long = "add-keywords",
158 value_name = "KEYWORDS",
159 action = ArgAction::Set,
160 )]
161 cli_add_keywords: Option<String>,
162
163 #[arg(
165 short = 'R',
166 long = "remove-keywords",
167 value_name = "KEYWORDS",
168 action = ArgAction::Set,
169 )]
170 cli_remove_keywords: Option<String>,
171
172 #[arg(
174 short = 'e',
175 long = "extension",
176 value_name = "EXTENSION",
177 action = ArgAction::Set,
178 )]
179 cli_extension: Option<String>,
180 },
181}