diff options
Diffstat (limited to 'labbot/__main__.py')
-rw-r--r-- | labbot/__main__.py | 11 |
1 files changed, 11 insertions, 0 deletions
diff --git a/labbot/__main__.py b/labbot/__main__.py index fdd2537..39d8842 100644 --- a/labbot/__main__.py +++ b/labbot/__main__.py @@ -3,6 +3,7 @@ import logging from typing import List from importlib import import_module import json +import shutil import labbot.bot import labbot.config @@ -98,5 +99,15 @@ def list_instances(): for ins in labbot.config.list_instances(): print(f"- {ins}") +@main.command(name="remove", help="Remove an instance") +@click.argument('name') +@click.option('--yes', is_flag=True, expose_value=False, + prompt='Are you sure you want to remove the instance?') +def remove_instance(name): + try: + shutil.rmtree(labbot.config.instance_config_dir(name)) + except FileNotFoundError: + print("Instance not found") + if __name__ == "__main__": main()
\ No newline at end of file |