From 2f870d7b6a1e823530c5219504929c58b5f32b1d Mon Sep 17 00:00:00 2001 From: Alejandro Sirgo Rica Date: Fri, 13 Dec 2024 11:54:59 +0100 Subject: cli: add lives alias to the live command argument --- cli/cli.py | 18 ++++++++++-------- 1 file changed, 10 insertions(+), 8 deletions(-) diff --git a/cli/cli.py b/cli/cli.py index 25c1daf..8dce3f5 100644 --- a/cli/cli.py +++ b/cli/cli.py @@ -101,7 +101,8 @@ class OgCLI(): def list(self, args): choices = ['clients', 'scopes', 'modes', 'hardware', - 'client', 'images', 'disks', 'servers', 'repos', 'live'] + 'client', 'images', 'disks', 'servers', 'repos', + 'live', 'lives'] parser = argparse.ArgumentParser(prog='ogcli list') parser.add_argument('item', choices=choices) @@ -130,12 +131,12 @@ class OgCLI(): ret = OgRepo.list_repos(self.rest) elif parsed_args.item == 'servers': ret = OgServer.list_servers(self.rest) - elif parsed_args.item == 'live': + elif parsed_args.item in ['live', 'lives']: ret = OgLive.list_live(self.rest, args[1:]) return ret def set(self, args): - choices = ['modes', 'mode', 'repo', 'live'] + choices = ['modes', 'mode', 'repo', 'live', 'lives'] parser = argparse.ArgumentParser(prog='ogcli set') parser.add_argument('item', choices=choices) @@ -150,7 +151,7 @@ class OgCLI(): ret = OgModes.set_modes(self.rest, args[1:]) elif parsed_args.item == 'repo': ret = OgRepo.set_repo(self.rest, args[1:]) - elif parsed_args.item == 'live': + elif parsed_args.item in ['live', 'lives']: ret = OgLive.set_live(self.rest, args[1:]) return ret @@ -251,7 +252,8 @@ class OgCLI(): return ret def delete(self, args): - choices = ['server', 'repo', 'center', 'room', 'client', 'folder', 'live'] + choices = ['server', 'repo', 'center', 'room', 'client', 'folder', + 'live', 'lives'] parser = argparse.ArgumentParser(prog='ogcli delete') parser.add_argument('delete_obj', choices=choices) @@ -273,7 +275,7 @@ class OgCLI(): ret = OgClient.delete_client(self.rest, args[1:]) elif parsed_args.delete_obj == 'folder': ret = OgFolder.delete_folder(self.rest, args[1:]) - elif parsed_args.delete_obj == 'live': + elif parsed_args.delete_obj in ['live', 'lives']: ret = OgLive.delete_live(self.rest, args[1:]) return ret @@ -304,7 +306,7 @@ class OgCLI(): return ret def install(self, args): - choices = ['live'] + choices = ['live', 'lives'] parser = argparse.ArgumentParser(prog='ogcli install') parser.add_argument('install_obj', choices=choices) @@ -315,6 +317,6 @@ class OgCLI(): parsed_args = parser.parse_args([args[0]]) ret = 0 - if parsed_args.install_obj == 'live': + if parsed_args.install_obj in ['live', 'lives']: ret = OgLive.install_live(self.rest, args[1:]) return ret -- cgit v1.2.3-18-g5258