diff options
author | Roman Gräf <romangraef@loves.dicksinhisan.us> | 2020-09-05 23:19:39 +0200 |
---|---|---|
committer | Roman Gräf <romangraef@loves.dicksinhisan.us> | 2020-09-05 23:19:39 +0200 |
commit | 2b10e99265f816f34e8530bac6b88a4ebf05b7f7 (patch) | |
tree | 1fcfc6edc27a646f6b1323505365f160e52968c9 /bot/__main__.py | |
download | discord-bootstrap-master.tar.gz discord-bootstrap-master.tar.bz2 discord-bootstrap-master.zip |
Diffstat (limited to 'bot/__main__.py')
-rw-r--r-- | bot/__main__.py | 19 |
1 files changed, 19 insertions, 0 deletions
diff --git a/bot/__main__.py b/bot/__main__.py new file mode 100644 index 0000000..915136e --- /dev/null +++ b/bot/__main__.py @@ -0,0 +1,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()) |