1pub const VERSION: &str = env!("CARGO_PKG_VERSION");
8
9pub const APP_NAME: &str = "work-copilot";
11
12pub const AUTHOR: &str = "lingojack";
14
15pub const EMAIL: &str = "lingojack@qq.com";
17
18pub mod section {
22 pub const PATH: &str = "path";
23 pub const INNER_URL: &str = "inner_url";
24 pub const OUTER_URL: &str = "outer_url";
25 pub const EDITOR: &str = "editor";
26 pub const BROWSER: &str = "browser";
27 pub const VPN: &str = "vpn";
28 pub const SCRIPT: &str = "script";
29 pub const VERSION: &str = "version";
30 pub const SETTING: &str = "setting";
31 pub const LOG: &str = "log";
32 pub const REPORT: &str = "report";
33}
34
35pub const ALL_SECTIONS: &[&str] = &[
37 section::PATH,
38 section::INNER_URL,
39 section::OUTER_URL,
40 section::EDITOR,
41 section::BROWSER,
42 section::VPN,
43 section::SCRIPT,
44 section::VERSION,
45 section::SETTING,
46 section::LOG,
47 section::REPORT,
48];
49
50pub const DEFAULT_DISPLAY_SECTIONS: &[&str] = &[
52 section::PATH,
53 section::INNER_URL,
54 section::OUTER_URL,
55 section::EDITOR,
56 section::BROWSER,
57 section::VPN,
58 section::SCRIPT,
59];
60
61pub const CONTAIN_SEARCH_SECTIONS: &[&str] = &[
63 section::PATH,
64 section::SCRIPT,
65 section::BROWSER,
66 section::EDITOR,
67 section::VPN,
68 section::INNER_URL,
69 section::OUTER_URL,
70];
71
72pub const NOTE_CATEGORIES: &[&str] = &[
76 section::BROWSER,
77 section::EDITOR,
78 section::VPN,
79 section::OUTER_URL,
80 section::SCRIPT,
81];
82
83pub const ALIAS_PATH_SECTIONS: &[&str] = &[
87 section::PATH,
88 section::INNER_URL,
89 section::OUTER_URL,
90];
91
92pub const ALIAS_EXISTS_SECTIONS: &[&str] = &[
94 section::PATH,
95 section::INNER_URL,
96 section::OUTER_URL,
97 section::SCRIPT,
98 section::BROWSER,
99 section::EDITOR,
100 section::VPN,
101];
102
103pub const MODIFY_SECTIONS: &[&str] = &[
105 section::PATH,
106 section::INNER_URL,
107 section::OUTER_URL,
108 section::EDITOR,
109 section::BROWSER,
110 section::VPN,
111];
112
113pub const REMOVE_CLEANUP_SECTIONS: &[&str] = &[
115 section::EDITOR,
116 section::VPN,
117 section::BROWSER,
118 section::SCRIPT,
119];
120
121pub const RENAME_SYNC_SECTIONS: &[&str] = &[
123 section::BROWSER,
124 section::EDITOR,
125 section::VPN,
126 section::SCRIPT,
127];
128
129pub mod config_key {
133 pub const MODE: &str = "mode";
134 pub const VERBOSE: &str = "verbose";
135 pub const CONCISE: &str = "concise";
136 pub const SEARCH_ENGINE: &str = "search-engine";
137 pub const WEEK_REPORT: &str = "week_report";
138 pub const WEEK_NUM: &str = "week_num";
139 pub const LAST_DAY: &str = "last_day";
140 pub const GIT_REPO: &str = "git_repo";
141}
142
143pub const DEFAULT_SEARCH_ENGINE: &str = "bing";
147
148pub mod search_engine {
150 pub const GOOGLE: &str = "https://www.google.com/search?q={}";
151 pub const BING: &str = "https://www.bing.com/search?q={}";
152 pub const BAIDU: &str = "https://www.baidu.com/s?wd={}";
153}
154
155pub const REPORT_DATE_FORMAT: &str = "%Y.%m.%d";
159
160pub const REPORT_SIMPLE_DATE_FORMAT: &str = "%Y/%m/%d";
162
163pub const DEFAULT_CHECK_LINES: usize = 5;
165
166pub mod cmd {
171 pub const SET: &[&str] = &["set", "s"];
173 pub const REMOVE: &[&str] = &["rm", "remove"];
174 pub const RENAME: &[&str] = &["rename", "rn"];
175 pub const MODIFY: &[&str] = &["mf", "modify"];
176
177 pub const NOTE: &[&str] = &["note", "nt"];
179 pub const DENOTE: &[&str] = &["denote", "dnt"];
180
181 pub const LIST: &[&str] = &["ls", "list"];
183 pub const CONTAIN: &[&str] = &["contain", "find"];
184
185 pub const REPORT: &[&str] = &["report", "r"];
187 pub const REPORTCTL: &[&str] = &["reportctl", "rctl"];
188 pub const CHECK: &[&str] = &["check", "c"];
189 pub const SEARCH: &[&str] = &["search", "select", "look", "sch"];
190
191 pub const CONCAT: &[&str] = &["concat"];
193
194 pub const TIME: &[&str] = &["time"];
196
197 pub const LOG: &[&str] = &["log"];
199 pub const CHANGE: &[&str] = &["change", "chg"];
200 pub const CLEAR: &[&str] = &["clear", "cls"];
201
202 pub const VERSION: &[&str] = &["version", "v"];
204 pub const HELP: &[&str] = &["help", "h"];
205 pub const EXIT: &[&str] = &["exit", "q", "quit"];
206
207 pub const COMPLETION: &[&str] = &["completion"];
209
210 pub const AGENT: &[&str] = &["agent"];
212 pub const SYSTEM: &[&str] = &["system", "ps"];
213
214 pub fn all_keywords() -> Vec<&'static str> {
216 let groups: &[&[&str]] = &[
217 SET, REMOVE, RENAME, MODIFY,
218 NOTE, DENOTE,
219 LIST, CONTAIN,
220 REPORT, REPORTCTL, CHECK, SEARCH,
221 CONCAT, TIME,
222 LOG, CHANGE, CLEAR,
223 VERSION, HELP, EXIT,
224 COMPLETION,
225 AGENT, SYSTEM,
226 ];
227 groups.iter().flat_map(|g| g.iter().copied()).collect()
228 }
229}
230
231pub mod rmeta_action {
234 pub const NEW: &str = "new";
235 pub const SYNC: &str = "sync";
236 pub const PUSH: &str = "push";
237 pub const PULL: &str = "pull";
238 pub const SET_URL: &str = "set-url";
239 pub const OPEN: &str = "open";
240}
241
242pub mod time_function {
245 pub const COUNTDOWN: &str = "countdown";
246}
247
248pub mod search_flag {
251 pub const FUZZY_SHORT: &str = "-f";
252 pub const FUZZY: &str = "-fuzzy";
253}
254
255pub const LIST_ALL: &str = "all";
258
259pub const WELCOME_MESSAGE: &str = "Welcome to use work copilot 🚀 ~";
263
264pub const SHELL_PREFIX: char = '!';
266
267pub const INTERACTIVE_PROMPT: &str = "copilot >";
269
270pub const HISTORY_FILE: &str = "history.txt";
272
273pub const CONFIG_FILE: &str = "config.yaml";
275
276pub const SCRIPTS_DIR: &str = "scripts";
278
279pub const REPORT_DIR: &str = "report";
281
282pub const REPORT_DEFAULT_FILE: &str = "week_report.md";
284
285pub const DATA_DIR: &str = ".jdata";
287
288pub const DATA_PATH_ENV: &str = "J_DATA_PATH";
290
291pub mod shell {
294 pub const BASH_PATH: &str = "/bin/bash";
295 pub const WINDOWS_CMD: &str = "cmd";
296 pub const WINDOWS_CMD_FLAG: &str = "/c";
297 pub const BASH_CMD_FLAG: &str = "-c";
298 pub const WINDOWS_OS: &str = "windows";
299 pub const MACOS_OS: &str = "macos";
300}