aboutsummaryrefslogtreecommitdiff
path: root/sway/ipc.c
diff options
context:
space:
mode:
authorDrew DeVault <sir@cmpwn.com>2015-10-23 10:34:38 -0400
committerDrew DeVault <sir@cmpwn.com>2015-10-23 10:34:38 -0400
commit988a0bd67e02755308b478d369a3825c712a842e (patch)
treec29db67ec97907448084a36909c1e51d74cd8eaf /sway/ipc.c
parent8a57c48dffda7c49e59d1c56739f857c6f28b07d (diff)
parent362413bd5031aa709ab5d7a39c0d5912554e545b (diff)
Merge pull request #201 from sce/cmd_results
Replace cmd_status with cmd_results struct
Diffstat (limited to 'sway/ipc.c')
-rw-r--r--sway/ipc.c8
1 files changed, 5 insertions, 3 deletions
diff --git a/sway/ipc.c b/sway/ipc.c
index e4deb4d4..1134f1a2 100644
--- a/sway/ipc.c
+++ b/sway/ipc.c
@@ -222,10 +222,12 @@ void ipc_client_handle_command(struct ipc_client *client) {
case IPC_COMMAND:
{
buf[client->payload_length] = '\0';
- bool success = handle_command(buf);
- char reply[64];
- int length = snprintf(reply, sizeof(reply), "{\"success\":%s}", success ? "true" : "false");
+ struct cmd_results *results = handle_command(buf);
+ const char *json = cmd_results_to_json(results);
+ char reply[256];
+ int length = snprintf(reply, sizeof(reply), "%s", json);
ipc_send_reply(client, reply, (uint32_t) length);
+ free_cmd_results(results);
break;
}
case IPC_GET_WORKSPACES: