aboutsummaryrefslogtreecommitdiff
path: root/bot/__main__.py
blob: 915136e5db8210dbbeb889af4c3460855f22cac8 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
from sys import argv

from ._bs.load import load
from ._bs.tasks import tasks


def main():
    load('tasks')
    if len(argv) <= 1:
        print(f"Please provide a task to run: {' '.join(tasks.keys())}")
        return 1
    to_run = tasks.get(argv[1])
    if not to_run:
        print(f"Unknown task: {argv[1]}")
    to_run()


if __name__ == '__main__':
    exit(main())