Skip to content

Commit ddbf08f

Browse files
author
Rainer Keller
committed
Add usage help message
Change-Id: I1fe67283fe29aaf67baccd80f4f5d4fc043230f8 Reviewed-by: Eirik Aavitsland <[email protected]>
1 parent df46e63 commit ddbf08f

File tree

1 file changed

+22
-0
lines changed

1 file changed

+22
-0
lines changed

main.cpp

Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -44,6 +44,25 @@ static int serverSocket = -1;
4444

4545
static const char socketPath[] = "#Boot2Qt_appcontroller";
4646

47+
static void usage()
48+
{
49+
printf("appcontroller [--debug-gdb] [--debug-qml] [--port-range <range>] [--stop] [--launch] [--show-platfrom] [--make-default] [--remove-default] [--print-debug] [--version] [--detach] [executable] [arguments]\n"
50+
"\n"
51+
"--port-range <range> Port range to use for debugging connections\n"
52+
"--debug-gdb Start GDB debugging\n"
53+
"--debug-qml Start QML debugging\n"
54+
"--stop Stop already running application\n"
55+
"--launch Start application without stopping already running application\n"
56+
"--show-platform Show platform information\n"
57+
"--make-default Make this application the default on boot\n"
58+
"--remove-default Restore the default application\n"
59+
"--print-debug Print debug messages to stdout on Android\n"
60+
"--version Print version information\n"
61+
"--detach Start application as usual, then go into background\n"
62+
"--help, -h, -help Show this help\n"
63+
);
64+
}
65+
4766
static void setupAddressStruct(struct sockaddr_un &address)
4867
{
4968
address.sun_family = AF_UNIX;
@@ -285,6 +304,9 @@ int main(int argc, char **argv)
285304
return 0;
286305
} else if (arg == "--detach") {
287306
detach = true;
307+
} else if (arg == "--help" || arg == "-help" || arg == "-h") {
308+
usage();
309+
return 0;
288310
} else {
289311
args.prepend(arg);
290312
break;

0 commit comments

Comments
 (0)