From 69872baead53d8161f99cec1d9671cd3230fc555 Mon Sep 17 00:00:00 2001 From: Jente Hidskes Date: Sat, 23 Mar 2019 20:18:37 +0100 Subject: [PATCH] Cage: encapsulate debug specific behavior --- cage.c | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/cage.c b/cage.c index e173391..5f537d4 100644 --- a/cage.c +++ b/cage.c @@ -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;