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
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
use chrono::{NaiveDate, NaiveTime};
use clap::{Parser, Subcommand, ValueEnum};
#[derive(ValueEnum, Clone, Debug)]
pub enum NoteTypes {
Idea,
CheckIn,
Todo,
Other,
}
#[derive(Parser)]
#[clap(author, version, about)]
pub struct MonoCLI {
#[command(subcommand)]
pub command: Option<MonoCommands>,
/// Copy output to clipboard
#[clap(short, long, global = true)]
pub copy: bool,
#[clap(short, long)]
pub animate: bool,
}
#[derive(Subcommand)]
pub enum MonoCommands {
/// Create a new note
Add {
/// Note text content
#[arg(value_name = "TEXT")]
text: Option<String>,
/// Note category [default 'other']
#[clap(short = 't', long = "type")]
note_type: Option<NoteTypes>,
/// Logged time of note (HH:MM or HH:MM:SS) [default: current time]
#[clap(long)]
time: Option<NaiveTime>,
/// Logged date of note (YYYY-MM-DD) [default: current date]
#[clap(long)]
date: Option<NaiveDate>,
/// Use clipboard content as the note body
#[clap(short, long)]
paste: bool,
},
/// Create a note with check-in type
CheckIn {
/// Note text content
#[arg(value_name = "TEXT")]
text: Option<String>,
/// Logged time of note (HH:MM or HH:MM:SS) [default: current time]
#[clap(long)]
time: Option<NaiveTime>,
/// Logged date of note (YYYY-MM-DD) [default: current date]
#[clap(long)]
date: Option<NaiveDate>,
/// Use clipboard content as the note body
#[clap(short, long)]
paste: bool,
},
/// List out existing notes
List {
/// Max amount of notes to be listed
#[clap(short, long)]
limit: Option<u16>,
/// Only allow certain types of notes (todo, check in, idea, other)
#[clap(short, long)]
note_type: Option<NoteTypes>,
/// Only show notes from today
#[clap(long)]
today: bool,
/// Show all notes after a date
#[clap(short, long)]
since: Option<NaiveDate>,
/// Show note content as well
#[clap(short, long)]
view: bool,
},
/// Search through notes
Search {
/// Search value
#[arg()]
text: String,
/// Max amount of notes to be returned
#[clap(short, long)]
limit: Option<u16>,
/// Only allow certain types of notes (todo, check in, idea, other)
#[clap(short, long)]
note_type: Option<NoteTypes>,
/// Filter by date (unimplemented)
#[clap(long)]
date: Option<NaiveDate>,
},
/// View a notes content
View {
/// The id of the note you want to view
#[arg()]
note_id: u32,
/// Remove md formatting (unimplemented)
#[clap(short, long)]
no_format: bool,
},
/// Edit a notes content (beta: not finished)
Edit {
/// The id of the note you want to edit
#[arg()]
note_id: u32,
/// Does not open text editor (unimplemented)
#[clap(long)]
headless: bool,
/// Append text to the end of the note
#[clap(short, long, conflicts_with = "overwrite")]
append: bool,
/// Overwrite note with new text
#[clap(short, long)]
overwrite: bool,
// For v2 do not require text
/// Text to append/overwrite
#[clap()]
text: String,
},
/// Delete a note
Delete {
/// The ID of the note you want to delete
#[arg()]
note_id: u32,
/// Approval flag to actually delete the note
#[clap(short, long)]
approve: bool,
},
/// Util command for displaying reminders
Reminder {},
/// Util command for initializing config
Init {},
}