Add basic help command line flag;

This commit is contained in:
bjorn 2022-03-25 00:59:57 -07:00
parent 5e752f0b25
commit bb9a20aaf2
1 changed files with 11 additions and 0 deletions

View File

@ -32,6 +32,17 @@ int main(int argc, char** argv) {
exit(0);
}
if (argc > 1 && (!strcmp(argv[1], "--help") || !strcmp(argv[1], "-h"))) {
os_open_console();
printf(
"usage: lovr [options] [<folder>]\n"
" -h, --help\t\tShow help and exit\n"
" -v, --version\t\tShow version and exit\n"
" --console\t\tAttach Windows console\n"
);
exit(0);
}
if (!os_init()) {
fprintf(stderr, "Failed to initialize platform");
exit(1);