diff --git a/cccli/command.py b/cccli/command.py index 60591714bb262504c8926d4c023826db0957d062..eb36521509c5a982b099d950b4a5e70c733eeda3 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"