Commit 3ae715ec authored by Seblu's avatar Seblu
Browse files

naive implementation of stop command

parent de561f32
Loading
Loading
Loading
Loading
+14 −2
Original line number Diff line number Diff line
@@ -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"