-
Notifications
You must be signed in to change notification settings - Fork 186
/
Copy pathutil.py
executable file
·53 lines (45 loc) · 1.56 KB
/
util.py
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
#!/usr/bin/env python3
from util.utility import gen_wiki, prepare_after, prepare_before, make_release, \
install, wiki
from util.command import RootCommand, Command, not_enough_args, not_found
def fallback(ex: str, options: list[str],
flags: dict[str, list[str]]):
if not options:
not_enough_args(ex)
not_found(ex, options[0])
def main():
c = RootCommand(
"util",
"Pokete utility",
fallback,
commands=[
Command(
"install", "Install pokete to a given directory", install,
usage="[dest]"
),
Command(
"prepare-pages", "Prepares github pages", fallback,
commands=[
Command("before", "Actions run pre branch switch",
prepare_before),
Command("after", "Actions run post branch switch",
prepare_after)
]
),
Command(
"release", "Prepare all relevant files for release",
make_release,
additional_info="Tags have to follow the `vMAJOR.MINOR.PATCH-RELEASE` semantic.",
usage="[tag]"
),
Command(
"wiki", "Generate a markdown wiki", gen_wiki, flags=[
wiki.silent_flag, wiki.quiet_flag, wiki.verbose_flag,
wiki.single_flag, wiki.multi_flag, wiki.pics_flag
]
)
]
)
c.exec()
if __name__ == "__main__":
main()