mirror of
https://github.com/cage-kiosk/cage.git
synced 2025-10-29 05:40:19 -04:00
Cage: exit when there is no application passed
This regression was introduced in 667667505a
due to wrongfully handling optind.
This commit is contained in:
parent
c2226da89b
commit
848929c88c
1 changed files with 5 additions and 3 deletions
8
cage.c
8
cage.c
|
|
@ -84,11 +84,13 @@ handle_signal(int signal, void *data)
|
||||||
static void
|
static void
|
||||||
usage(FILE *file, const char *cage)
|
usage(FILE *file, const char *cage)
|
||||||
{
|
{
|
||||||
fprintf(file, "Usage: %s 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"
|
||||||
" -D\t Turn on damage tracking debugging\n"
|
" -D\t Turn on damage tracking debugging\n"
|
||||||
" -h\t Display this help message\n",
|
" -h\t Display this help message\n"
|
||||||
|
"\n"
|
||||||
|
" Use -- when you want to pass arguments to APPLICATION\n",
|
||||||
cage);
|
cage);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
@ -113,7 +115,7 @@ parse_args(struct cg_server *server, int argc, char *argv[])
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
if (optind == 0) {
|
if (optind >= argc) {
|
||||||
usage(stderr, argv[0]);
|
usage(stderr, argv[0]);
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue