diff options
author | Alejandro Sirgo Rica <asirgo@soleta.eu> | 2024-12-13 11:54:59 +0100 |
---|---|---|
committer | Alejandro Sirgo Rica <asirgo@soleta.eu> | 2024-12-13 13:59:54 +0100 |
commit | 2f870d7b6a1e823530c5219504929c58b5f32b1d (patch) | |
tree | 0371c2a3c50c629f8434661b04192836b1a12442 /cli/cli.py | |
parent | 80a68ceb5aa7ea37670842fbd427d98c9c01d808 (diff) |
cli: add lives alias to the live command argument
Diffstat (limited to 'cli/cli.py')
-rw-r--r-- | cli/cli.py | 18 |
1 files changed, 10 insertions, 8 deletions
@@ -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 |