diff --git a/doc/lkt.1 b/doc/lkt.1 index 911e8436e665c2a2a12c12e863d76f8776f56813..a45acc985836b0a26a2144aecdfd5531c0306933 100644 --- a/doc/lkt.1 +++ b/doc/lkt.1 @@ -142,8 +142,9 @@ List the stickers of an object \fIuri\fP. The object \fItype\fP can be \fIkara\fP or \fIplt\fP. A condition can be defined on the value of the sticker with an operator -\fIop\fP and an integer value \fIvalue\fP. Supported operators are \fI<\fP, -\fI=\fP and \fI>\fP. Operations are not strict. +\fIop\fP and an integer value \fIvalue\fP. Supported operators are \fIl\fP +for 'less than', \fIe\fP for 'equal to' and \fIg\fP for 'greater than'. +Operations are not strict. .TP \fBsticker set\fP <type> <uri> <name> <value> Set the value of a sticker \fIname\fP to \fIvalue\fP for the object with the diff --git a/src/main/lkt.c b/src/main/lkt.c index bb7613fb838a7811a9da12b866aadc94d24d4907..06050b755d6e095a7a3e9d796fc721b789886be3 100644 --- a/src/main/lkt.c +++ b/src/main/lkt.c @@ -703,9 +703,13 @@ stickers_get__(struct lkt_cmd_args *args) else if (args->argc == 3) write_socket(sock = lkt_connect(), "sticker get %s %s %s\n", args->argv[0], args->argv[1], args->argv[2]); - else if (args->argc == 5) + else if (args->argc == 5) { + const char *op = args->argv[3]; + op = op[0] == 'e' ? "=" : op[0] == 'l' ? "<" : op[0] == 'g' ? ">" : NULL; + fail_if(!op, "Invalid argument"); write_socket(sock = lkt_connect(), "sticker get %s %s %s %s %s\n", args->argv[0], - args->argv[1], args->argv[2], args->argv[3], args->argv[4]); + args->argv[1], args->argv[2], op, args->argv[4]); + } else fail("Invalid argument");