Skip to content
Extraits de code Groupes Projets
Vérifiée Valider e00748a6 rédigé par Kubat's avatar Kubat
Parcourir les fichiers

Operators for stickers are something that can be parsed by the shell...

parent ac1d5cc9
Aucune branche associée trouvée
Aucune étiquette associée trouvée
1 requête de fusion!75Resolve "Stickers in lkt"
...@@ -142,8 +142,9 @@ List the stickers of an object \fIuri\fP. The object \fItype\fP can be ...@@ -142,8 +142,9 @@ List the stickers of an object \fIuri\fP. The object \fItype\fP can be
\fIkara\fP or \fIplt\fP. \fIkara\fP or \fIplt\fP.
A condition can be defined on the value of the sticker with an operator 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, \fIop\fP and an integer value \fIvalue\fP. Supported operators are \fIl\fP
\fI=\fP and \fI>\fP. Operations are not strict. for 'less than', \fIe\fP for 'equal to' and \fIg\fP for 'greater than'.
Operations are not strict.
.TP .TP
\fBsticker set\fP <type> <uri> <name> <value> \fBsticker set\fP <type> <uri> <name> <value>
Set the value of a sticker \fIname\fP to \fIvalue\fP for the object with the Set the value of a sticker \fIname\fP to \fIvalue\fP for the object with the
......
...@@ -703,9 +703,13 @@ stickers_get__(struct lkt_cmd_args *args) ...@@ -703,9 +703,13 @@ stickers_get__(struct lkt_cmd_args *args)
else if (args->argc == 3) else if (args->argc == 3)
write_socket(sock = lkt_connect(), "sticker get %s %s %s\n", args->argv[0], args->argv[1], write_socket(sock = lkt_connect(), "sticker get %s %s %s\n", args->argv[0], args->argv[1],
args->argv[2]); 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], 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 else
fail("Invalid argument"); fail("Invalid argument");
......
0% Chargement en cours ou .
You are about to add 0 people to the discussion. Proceed with caution.
Veuillez vous inscrire ou vous pour commenter