From cb05f6b6ab29ad75b60e388131ccc7dd00d0482f Mon Sep 17 00:00:00 2001 From: Lazaro Raul Date: Fri, 6 Nov 2020 18:38:41 -0500 Subject: [PATCH] [heroku] refs #25 - Create a subparser for running the app in heroku --- main.py | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/main.py b/main.py index 6cee904..2e3ac28 100644 --- a/main.py +++ b/main.py @@ -21,13 +21,20 @@ def main(args): else: raise Exception(f'Invalid or missing "token" in {args.config}') +def heroku(args): pass if __name__ == '__main__': import argparse parser = argparse.ArgumentParser(description='Bot initializer') + parser.set_defaults(command=main) + parser.add_argument('-c', '--config', type=str, default='config.ini', help='path of the configuration file') parser.add_argument('--debug', help='execute in debug mode', action="store_true") + subparsers = parser.add_subparsers() + heroku_parser = subparsers.add_parser('heroku', help="Run a bot instance using heroku") + heroku_parser.set_defaults(command=heroku) + args = parser.parse_args() - main(args) + args.command(args)