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] = &[section::PATH, section::INNER_URL, section::OUTER_URL];
87
88pub const ALIAS_EXISTS_SECTIONS: &[&str] = &[
90 section::PATH,
91 section::INNER_URL,
92 section::OUTER_URL,
93 section::SCRIPT,
94 section::BROWSER,
95 section::EDITOR,
96 section::VPN,
97];
98
99pub const MODIFY_SECTIONS: &[&str] = &[
101 section::PATH,
102 section::INNER_URL,
103 section::OUTER_URL,
104 section::EDITOR,
105 section::BROWSER,
106 section::VPN,
107];
108
109pub const REMOVE_CLEANUP_SECTIONS: &[&str] = &[
111 section::EDITOR,
112 section::VPN,
113 section::BROWSER,
114 section::SCRIPT,
115];
116
117pub const RENAME_SYNC_SECTIONS: &[&str] = &[
119 section::BROWSER,
120 section::EDITOR,
121 section::VPN,
122 section::SCRIPT,
123];
124
125pub mod config_key {
129 pub const MODE: &str = "mode";
130 pub const VERBOSE: &str = "verbose";
131 pub const CONCISE: &str = "concise";
132 pub const SEARCH_ENGINE: &str = "search-engine";
133 pub const WEEK_REPORT: &str = "week_report";
134 pub const WEEK_NUM: &str = "week_num";
135 pub const LAST_DAY: &str = "last_day";
136 pub const GIT_REPO: &str = "git_repo";
137}
138
139pub const DEFAULT_SEARCH_ENGINE: &str = "bing";
143
144pub mod search_engine {
146 pub const GOOGLE: &str = "https://www.google.com/search?q={}";
147 pub const BING: &str = "https://www.bing.com/search?q={}";
148 pub const BAIDU: &str = "https://www.baidu.com/s?wd={}";
149}
150
151pub const REPORT_DATE_FORMAT: &str = "%Y.%m.%d";
155
156pub const REPORT_SIMPLE_DATE_FORMAT: &str = "%Y/%m/%d";
158
159pub const DEFAULT_CHECK_LINES: usize = 5;
161
162pub mod cmd {
167 pub const SET: &[&str] = &["set", "s"];
169 pub const REMOVE: &[&str] = &["rm", "remove"];
170 pub const RENAME: &[&str] = &["rename", "rn"];
171 pub const MODIFY: &[&str] = &["mf", "modify"];
172
173 pub const NOTE: &[&str] = &["note", "nt"];
175 pub const DENOTE: &[&str] = &["denote", "dnt"];
176
177 pub const LIST: &[&str] = &["ls", "list"];
179 pub const CONTAIN: &[&str] = &["contain", "find"];
180
181 pub const REPORT: &[&str] = &["report", "r"];
183 pub const REPORTCTL: &[&str] = &["reportctl", "rctl"];
184 pub const CHECK: &[&str] = &["check", "c"];
185 pub const SEARCH: &[&str] = &["search", "select", "look", "sch"];
186
187 pub const TODO: &[&str] = &["todo", "td"];
189
190 pub const CONCAT: &[&str] = &["concat"];
192
193 pub const TIME: &[&str] = &["time"];
195
196 pub const LOG: &[&str] = &["log"];
198 pub const CHANGE: &[&str] = &["change", "chg"];
199 pub const CLEAR: &[&str] = &["clear", "cls"];
200
201 pub const VERSION: &[&str] = &["version", "v"];
203 pub const HELP: &[&str] = &["help", "h"];
204 pub const EXIT: &[&str] = &["exit", "q", "quit"];
205
206 pub const COMPLETION: &[&str] = &["completion"];
208
209 pub const AGENT: &[&str] = &["agent"];
211 pub const SYSTEM: &[&str] = &["system", "ps"];
212
213 pub fn all_keywords() -> Vec<&'static str> {
215 let groups: &[&[&str]] = &[
216 SET, REMOVE, RENAME, MODIFY, NOTE, DENOTE, LIST, CONTAIN, REPORT, REPORTCTL, CHECK,
217 SEARCH, TODO, CONCAT, TIME, LOG, CHANGE, CLEAR, VERSION, HELP, EXIT, COMPLETION, AGENT,
218 SYSTEM,
219 ];
220 groups.iter().flat_map(|g| g.iter().copied()).collect()
221 }
222}
223
224pub mod rmeta_action {
227 pub const NEW: &str = "new";
228 pub const SYNC: &str = "sync";
229 pub const PUSH: &str = "push";
230 pub const PULL: &str = "pull";
231 pub const SET_URL: &str = "set-url";
232 pub const OPEN: &str = "open";
233}
234
235pub mod time_function {
238 pub const COUNTDOWN: &str = "countdown";
239}
240
241pub mod search_flag {
244 pub const FUZZY_SHORT: &str = "-f";
245 pub const FUZZY: &str = "-fuzzy";
246}
247
248pub const LIST_ALL: &str = "all";
251
252pub const WELCOME_MESSAGE: &str = "Welcome to use work copilot 🚀 ~";
256
257pub const SHELL_PREFIX: char = '!';
259
260pub const INTERACTIVE_PROMPT: &str = "copilot >";
262
263pub const HISTORY_FILE: &str = "history.txt";
265
266pub const CONFIG_FILE: &str = "config.yaml";
268
269pub const SCRIPTS_DIR: &str = "scripts";
271
272pub const REPORT_DIR: &str = "report";
274
275pub const REPORT_DEFAULT_FILE: &str = "week_report.md";
277
278pub const DATA_DIR: &str = ".jdata";
280
281pub const DATA_PATH_ENV: &str = "J_DATA_PATH";
283
284pub mod shell {
287 pub const BASH_PATH: &str = "/bin/bash";
288 pub const WINDOWS_CMD: &str = "cmd";
289 pub const WINDOWS_CMD_FLAG: &str = "/c";
290 pub const BASH_CMD_FLAG: &str = "-c";
291 pub const WINDOWS_OS: &str = "windows";
292 pub const MACOS_OS: &str = "macos";
293}