Commit 15895aa2 authored by Sébastien Luttringer's avatar Sébastien Luttringer
Browse files

Add title command

parent 9c0256b5
Loading
Loading
Loading
Loading
+20 −0
Original line number Diff line number Diff line
@@ -300,3 +300,23 @@ class Command_unrescue(TqlCommand):

    def remote_functions(self):
        return set(("unrescue",))

class Command_title(TqlCommand):
    '''Set a vm title'''

    def __init__(self, cli, argv0):
        TqlCommand.__init__(self, cli, argv0)
        self.set_usage("%prog [options] <tql> <title>")
        self.tql_filter += "&r=vm"
        self.remove_option("--direct")

    def __call__(self, argv):
        # arg parse
        self.parse_args(argv)
        if len(self.args) != 2:
            raise cmdBadArgument()
        # rpc call
        self.rpccall("title", self.args[0], self.args[1], _direct=True)

    def remote_functions(self):
        return set(("title",))