-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathmain.a68
executable file
·55 lines (45 loc) · 1.13 KB
/
main.a68
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
#!/usr/bin/a68g --script #
# -*- coding: utf-8 -*- #
PR nowarnings PR
PR include "generate test.a68" PR
PR include "operations/show tasks.a68" PR;
PR include "operations/add.a68" PR;
PR include "operations/edit.a68" PR;
PR include "operations/remove.a68" PR;
PR include "printing/week.a68" PR;
PR include "utils.a68" PR;
BEGIN
FILE f;
PROC a = (STRING path, header) VOID:
IF NOT file is regular(path) THEN
openf(f, path, stand out channel);
put(f, header);
close(f)
FI;
IF NOT file is directory(data path) THEN
create directory(data path)
FI;
a(tasks data path, task csv header);
a(notes data path, note csv header);
a(weeks data path, week csv header);
a(groups data path, group csv header);
a(last id data path, "0")
END;
IF a68g argc = 1 THEN
DATE week start = get week start;
new line(stand out);
get all weeks((WEEK week) VOID:
IF week start = date OF week THEN
print week(week)
FI
);
show tasks
ELSE
INT argi := 2;
STRING arg = a68g argv(argi);
IF arg = "gen" THEN generate test
ELIF arg = "add" THEN add(argi)
ELIF arg = "edit" THEN edit(argi)
ELIF arg = "remove" THEN remove(argi)
FI
FI