File tree Expand file tree Collapse file tree 2 files changed +12
-1
lines changed Expand file tree Collapse file tree 2 files changed +12
-1
lines changed Original file line number Diff line number Diff line change @@ -67,6 +67,7 @@ typedef struct reply_t {
67
67
char * errorposition ;
68
68
} reply_t ;
69
69
70
+ static int exit_code = 0 ;
70
71
static reply_t last_reply ;
71
72
72
73
static int reply_boolean_cb (void * params , int val ) {
@@ -100,6 +101,7 @@ static int reply_end_map_cb(void *params) {
100
101
fprintf (stderr , "ERROR: %s\n" , last_reply .errorposition );
101
102
}
102
103
fprintf (stderr , "ERROR: %s\n" , last_reply .error );
104
+ exit_code = 2 ;
103
105
}
104
106
return 1 ;
105
107
}
@@ -326,5 +328,5 @@ int main(int argc, char *argv[]) {
326
328
327
329
close (sockfd );
328
330
329
- return 0 ;
331
+ return exit_code ;
330
332
}
Original file line number Diff line number Diff line change @@ -90,6 +90,15 @@ See the -m option for continuous monitoring.
90
90
i3-msg is a sample implementation for a client using the unix socket IPC
91
91
interface to i3.
92
92
93
+ === Exit status:
94
+
95
+ 0:
96
+ if OK,
97
+ 1:
98
+ if invalid syntax or unable to connect to ipc-socket
99
+ 2:
100
+ if i3 returned an error processing your command(s)
101
+
93
102
== EXAMPLES
94
103
95
104
------------------------------------------------
You can’t perform that action at this time.
0 commit comments