Cage: encapsulate debug specific behavior

This commit is contained in:
Jente Hidskes 2019-03-23 20:18:37 +01:00
parent 78fc6fbe0d
commit 69872baead
No known key found for this signature in database
GPG key ID: 04BE5A29F32D91EA

8
cage.c
View file

@ -87,7 +87,9 @@ usage(FILE *file, const char *cage)
fprintf(file, "Usage: %s [OPTIONS] [--] APPLICATION\n"
"\n"
" -d\t Don't draw client side decorations, when possible\n"
#ifdef DEBUG
" -D\t Turn on damage tracking debugging\n"
#endif
" -h\t Display this help message\n"
"\n"
" Use -- when you want to pass arguments to APPLICATION\n",
@ -98,14 +100,20 @@ static bool
parse_args(struct cg_server *server, int argc, char *argv[])
{
int c;
#ifdef DEBUG
while ((c = getopt(argc, argv, "dDh")) != -1) {
#else
while ((c = getopt(argc, argv, "dh")) != -1) {
#endif
switch (c) {
case 'd':
server->xdg_decoration = true;
break;
#ifdef DEBUG
case 'D':
server->debug_damage_tracking = true;
break;
#endif
case 'h':
usage(stdout, argv[0]);
return false;