From b242ee9f6e1f84d7cbc6114cac1bc5300fa3afcc Mon Sep 17 00:00:00 2001 From: Alejandro Sirgo Rica Date: Mon, 4 Mar 2024 09:58:41 +0100 Subject: change 'ogcli send' command into 'ogcli request' By using the word 'request' the command becomes more semantic and represents the 'best effort' nature of the communication with ogserver. --- cli/cli.py | 28 ++++++++++++++-------------- 1 file changed, 14 insertions(+), 14 deletions(-) (limited to 'cli/cli.py') diff --git a/cli/cli.py b/cli/cli.py index 8e88a11..a81ed07 100644 --- a/cli/cli.py +++ b/cli/cli.py @@ -124,27 +124,27 @@ class OgCLI(): elif parsed_args.item == 'server': OgServer.set_server(self.rest, args[1:]) - def send(self, args): + def request(self, args): choices = ['reboot', 'refresh', 'poweroff', 'wol', 'session'] - parser = argparse.ArgumentParser(prog='ogcli send') - parser.add_argument('send_obj', choices=choices) + parser = argparse.ArgumentParser(prog='ogcli request') + parser.add_argument('request_obj', choices=choices) if not args: - print('Missing send subcommand', file=sys.stderr) + print('Missing request subcommand', file=sys.stderr) parser.print_help(file=sys.stderr) sys.exit(1) parsed_args = parser.parse_args([args[0]]) - if parsed_args.send_obj == 'wol': - OgWol.send_wol(self.rest, args[1:]) - elif parsed_args.send_obj == 'poweroff': - OgPoweroff.send_poweroff(self.rest, args[1:]) - elif parsed_args.send_obj == 'refresh': - OgClient.send_refresh(self.rest, args[1:]) - elif parsed_args.send_obj == 'reboot': - OgReboot.send_reboot(self.rest, args[1:]) - elif parsed_args.send_obj == 'session': - OgSession.send_session(self.rest, args[1:]) + if parsed_args.request_obj == 'wol': + OgWol.request_wol(self.rest, args[1:]) + elif parsed_args.request_obj == 'poweroff': + OgPoweroff.request_poweroff(self.rest, args[1:]) + elif parsed_args.request_obj == 'refresh': + OgClient.request_refresh(self.rest, args[1:]) + elif parsed_args.request_obj == 'reboot': + OgReboot.request_reboot(self.rest, args[1:]) + elif parsed_args.request_obj == 'session': + OgSession.request_session(self.rest, args[1:]) def restore(self, args): choices = ['image'] -- cgit v1.2.3-18-g5258