From 3ae715ecf519373fa370ecb1457f1100fce090ac Mon Sep 17 00:00:00 2001 From: Seblu Date: Mon, 27 Dec 2010 14:27:24 +0100 Subject: [PATCH] naive implementation of stop command --- cccli/command.py | 16 ++++++++++++++-- 1 file changed, 14 insertions(+), 2 deletions(-) diff --git a/cccli/command.py b/cccli/command.py index 6059171..eb36521 100644 --- a/cccli/command.py +++ b/cccli/command.py @@ -151,7 +151,7 @@ class Command(object): cmd_rcmd.desc = "Print remote command list" def cmd_list(self, argv): - '''List something''' + '''List objects''' if len(argv) == 1: argv.append("") items = self.cli.rpc.list(str.join("", argv[1:])) @@ -159,6 +159,18 @@ class Command(object): pprint.pprint(item) #for key, val in item.items(): # printer.out("%s: %s "%(key, val)) - cmd_list.usage = "list [tags]" + cmd_list.usage = "list [tql]" cmd_list.desc = "Print information about tags" + def cmd_stop(self, argv): + '''Stop an object''' + if len(argv) == 0: + raise BadArgument() + tql = str.join("", argv[1:]) + items = self.cli.rpc.list(tql) + for item in items: + pprint.pprint(item) + if raw_input("Are you sure? (yes/no)") == "yes": + items = self.cli.rpc.stop(tql) + cmd_stop.usage = "stop [tql]" + cmd_stop.desc = "Stop objects" -- GitLab