Skip to content

Commit 734ad0f

Browse files
authored
Merge pull request #44 from Synix4Life/main
Help message + Some additions
2 parents 4e51939 + bfb2268 commit 734ad0f

2 files changed

Lines changed: 27 additions & 4 deletions

File tree

.gitignore

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,6 @@
11
/build
2+
/.idea/
3+
/.vscode/
24
/tests/out
35
.DS_Store
46

sources/kong.c

Lines changed: 25 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -33,8 +33,29 @@
3333

3434
typedef enum arg_mode { MODE_MODECHECK, MODE_INPUT, MODE_OUTPUT, MODE_PLATFORM, MODE_API, MODE_INTEGRATION } arg_mode;
3535

36-
static void help(void) {
37-
printf("No help is coming.");
36+
static void help(const char* basename) {
37+
printf("\n");
38+
printf("Usage: %s -i|--in <dir> -o|--out <dir> -p|--platform <platform> [options]\n", basename);
39+
40+
printf("\nRequired options:\n");
41+
printf(" -i, --in <directory> Shader input directory (contains *.kong files)\n");
42+
printf(" -o, --out <directory> Output directory\n");
43+
printf(" -p, --platform <platform> Target platform\n");
44+
45+
printf("\nOptional options:\n");
46+
printf(" -h, --help Display this help message\n");
47+
printf(" --debug Enable debug mode\n");
48+
printf(" -a, --api <api> Shader API (auto-detected if omitted)\n");
49+
printf(" -n, --integration <name> Enable Kore3 integration\n");
50+
51+
printf("\nInformation:\n");
52+
printf(" <platform> Automatic API resolution only applies if <platform> is one of:\n");
53+
printf(" windows, macos, linux, ios, android, wasm, kompjuta\n");
54+
printf(" <api> Supported:\n");
55+
printf(" direct3d11, direct3d12, opengl, metal, webgpu, vulkan\n");
56+
printf(" <integration> Supported:\n");
57+
printf(" kore3\n");
58+
printf("\n");
3859
}
3960

4061
static void read_file(char *filename) {
@@ -105,7 +126,7 @@ int main(int argc, char **argv) {
105126
debug = true;
106127
}
107128
else if (strcmp(&arg[2], "help") == 0) {
108-
help();
129+
help(argv[0]);
109130
return 0;
110131
}
111132
else {
@@ -143,7 +164,7 @@ int main(int argc, char **argv) {
143164
mode = MODE_INTEGRATION;
144165
break;
145166
case 'h':
146-
help();
167+
help(argv[0]);
147168
return 0;
148169
default: {
149170
kong_log(LOG_LEVEL_WARNING, "Ignoring unknown parameter %s.", arg);

0 commit comments

Comments
 (0)