mirror of
https://github.com/cage-kiosk/cage.git
synced 2026-03-02 01:40:56 -05:00
Cage: encapsulate debug specific behavior
This commit is contained in:
parent
78fc6fbe0d
commit
69872baead
1 changed files with 8 additions and 0 deletions
8
cage.c
8
cage.c
|
|
@ -87,7 +87,9 @@ usage(FILE *file, const char *cage)
|
||||||
fprintf(file, "Usage: %s [OPTIONS] [--] APPLICATION\n"
|
fprintf(file, "Usage: %s [OPTIONS] [--] APPLICATION\n"
|
||||||
"\n"
|
"\n"
|
||||||
" -d\t Don't draw client side decorations, when possible\n"
|
" -d\t Don't draw client side decorations, when possible\n"
|
||||||
|
#ifdef DEBUG
|
||||||
" -D\t Turn on damage tracking debugging\n"
|
" -D\t Turn on damage tracking debugging\n"
|
||||||
|
#endif
|
||||||
" -h\t Display this help message\n"
|
" -h\t Display this help message\n"
|
||||||
"\n"
|
"\n"
|
||||||
" Use -- when you want to pass arguments to APPLICATION\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[])
|
parse_args(struct cg_server *server, int argc, char *argv[])
|
||||||
{
|
{
|
||||||
int c;
|
int c;
|
||||||
|
#ifdef DEBUG
|
||||||
while ((c = getopt(argc, argv, "dDh")) != -1) {
|
while ((c = getopt(argc, argv, "dDh")) != -1) {
|
||||||
|
#else
|
||||||
|
while ((c = getopt(argc, argv, "dh")) != -1) {
|
||||||
|
#endif
|
||||||
switch (c) {
|
switch (c) {
|
||||||
case 'd':
|
case 'd':
|
||||||
server->xdg_decoration = true;
|
server->xdg_decoration = true;
|
||||||
break;
|
break;
|
||||||
|
#ifdef DEBUG
|
||||||
case 'D':
|
case 'D':
|
||||||
server->debug_damage_tracking = true;
|
server->debug_damage_tracking = true;
|
||||||
break;
|
break;
|
||||||
|
#endif
|
||||||
case 'h':
|
case 'h':
|
||||||
usage(stdout, argv[0]);
|
usage(stdout, argv[0]);
|
||||||
return false;
|
return false;
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue