-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathhelp.go
234 lines (175 loc) · 5.96 KB
/
help.go
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
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
package main
import "log"
func helpNote() {
x := `USAGE
./note [FILTER] ACTION [OPTIONS] [PARAMETERS]
For more specific usage use -h after the ACTION argument. E.g. ./note add -h
COMMANDS
./note add [TAG...] TITLE
Create a note
./note [FILTER] [read]
Read note with pagination
./note [FILTER] edit [VERSION]
Create a new note version based on VERSION
./note [FILTER] list [notes|templates]
List notes
./note [FILTER] tags [OPTIONS]
List note tags
./note [FILTER] search [OPTIONS] [REGEXP]
Search for regular expression matches
./note [FILTER] delete
Mark note as deleted
./note [FILTER] print
Print note content
./note [FILTER] versions
Print the note versions
./note [FILTER] file { add | browse | list }
Manage note file attachments
./note [FILTER] modify [TAGMODIFIER...] [TITLE]
Modify note tags and title
./note version
Display Notemanager version
`
x += helpFilter()
log.Fatal(Autobreak(x))
}
func helpNoteList() {
x := `USAGE
./note [FILTER] list [notes|templates]
DESCRIPTION
List a selection of notes matching the supplied FILTER terms. By default, if no FILTER is supplied, all notes are displayed except deleted notes.
ARGUMENTS
PARAMETERS
notes List notes [Default]
templates List templates
`
log.Fatal(Autobreak(x))
}
// ====================================================================
// Note Width = 72
func helpNoteSearch() {
x := `USAGE
./note [FILTER] search [OPTIONS] [REGEXP]
DESCRIPTION
Search for regular expression in notes matching FILTER.
ARGUMENTS
FILTER
For explanation of filters run: ./note -h
OPTIONS
-s|--case-sensitive
Perform case sensitive pattern matching
REGEXP
Regular Expression to search for
`
//x += helpFilter()
log.Fatal(Autobreak(x))
}
func helpFilter() (x string) {
x = `FILTER
DESCRIPTION
FILTER is a collection of options and terms or just a list of specific note ids to built a selection of notes. All supplied filter terms must match in order for a note to be included in the note selection. By default deleted notes are excluded from the note selection.
SYNTAX
[OPTIONS] [TERM...]
ARGUMENTS
OPTIONS
-a|--all
Select all notes, include deleted notes
-h|--help
Display Notemanager Usage
TERMS
Filter notes based on supplied terms. All terms must match. Multiple terms must be separated by white space.
created.after:TIMESTAMP
Notes created after date
created.before:TIMESTAMP
Notes created before date
modified.after:TIMESTAMP
Notes modified after date
modified.before:TIMESTAMP
Notes modified before date
+string
Notes with tag string
-string
Notes without tag string
TIMESTAMP:
The TIMESTAMP syntax is YYYY-MM-DD [HH:mm[:ss]], you can optionally omit any separator. Any compontent of the time which is missing, is assumed to be 0.
NOTE IDS
One or multiple note ids can be supplied as the most exclusive filtering method. Note Ids must be separated by white spaces. If a note id is supplied the -a option is implicit. Note ids and other filters are mutually exclusive.
---
[a-f0-9]{8} Specific note with an abbreviated id
UUID (36-bytes) Specific note with full UUID
`
return Autobreak(x)
//return
}
func helpNoteTags() {
x := `USAGE
./note [FILTER] tags [OPTIONS]
DESCRIPTION
List all note tags of a selection of notes matching the FILTER terms.
ARGUMENTS
FILTER
For explanation of filters run: ./note -h
OPTIONS
-f|--full
Display notes along with tags
-h|--help
Display usage
-o|--order count|name
Order tags by a parameter. [Default: count]
`
log.Fatal(Autobreak(x))
}
func helpNoteAdd() {
x := `USAGE
./note add [OPTIONS] [TAG...] [TITLE]
DESCRIPTION
Create a note with supplied TAG and TITLE parameters. When issueing the command an editor will be started where the note content can be written to.
ARGUMENTS
OPTIONS
-t|--template
Use template file as note layout. [Default=note]
TAG
Tags are strings prefixed by a '+' sign. Multiple tags can be supplied by separating them by spaces.
TITLE
All remaining arguments after TAG build the note's title. You usually do not need to wrap the title in quotes, unless you want to keep white spaces for some reason. [Default=Undefined]
EXAMPLE
Create a note with tags 'important' and 'exam' with the title 'Exam Deadline'
note add +important +exam Exam Deadline
`
log.Fatal(Autobreak(x))
}
func helpNoteFile() {
x := `USAGE
./note [FILTER] file [add FILE...|browse|delete FILE...|list|purge]
DESCRIPTION
List or modify file attachments of notes.
ARGUMENTS
FILTER
For explanation of filters run: ./note -h
PARAMETERS
add FILE...
Attach files to the note selection
browse Start a file manager to browse the files
delete FILE
Mark the file attachments from the note selection as deleted
list List all files of note selection
purge Purge deleted file attachments of notes
`
log.Fatal(Autobreak(x))
}
func helpNoteAlias() {
x := `USAGE
./note [FILTER] alias [set STRING|list|remove]
DESCRIPTION
List or modify alias of notes.
ARGUMENTS
FILTER
For explanation of filters run: ./note -h
PARAMETERS
set STRING
Set alias for a single note. Filter must be single note.
remove Delete note alias. Filter must be single note.
list List aliases
`
log.Fatal(Autobreak(x))
}