Docs #3

Merged
samsonium merged 12 commits from docs into master 2026-10-19 18:57:11 +00:00
2 changed files with 19 additions and 15 deletions
Showing only changes of commit c2532ae11f - Show all commits
+18 -15
View File
@@ -27,6 +27,7 @@ fzl_options_t *fzl_mkoptions(int argc, char **argv)
} }
memset(opts, 0, sizeof(fzl_options_t)); memset(opts, 0, sizeof(fzl_options_t));
opts->should_continue = true;
if (argc < 2) if (argc < 2)
{ {
@@ -81,24 +82,27 @@ fzl_options_t *fzl_mkoptions(int argc, char **argv)
size_t fcount = 0; size_t fcount = 0;
char **files = malloc(fremainder * sizeof(char *)); char **files = malloc(fremainder * sizeof(char *));
for (; i < argc; i++) if (opts->should_continue)
{ {
if (argv[i][0] == '-') for (; i < argc; i++)
{ {
printf( if (argv[i][0] == '-')
"%sWarning%s: unhandled flag '%s' (should be defined before sources " {
"list)\n", printf("%sWarning%s: unhandled flag '%s' (should be defined before "
FZL_CWARNING, FZL_CRST, argv[i]); "sources "
continue; "list)\n",
} FZL_CWARNING, FZL_CRST, argv[i]);
continue;
}
if (fremainder <= fcount) if (fremainder <= fcount)
{ {
fremainder *= 2; fremainder *= 2;
files = realloc(files, fremainder * sizeof(char *)); files = realloc(files, fremainder * sizeof(char *));
} }
files[fcount++] = argv[i]; files[fcount++] = argv[i];
}
} }
opts->files = files; opts->files = files;
@@ -115,7 +119,6 @@ fzl_options_t *fzl_mkoptions(int argc, char **argv)
return NULL; return NULL;
} }
opts->should_continue = true;
return opts; return opts;
} }
+1
View File
@@ -17,6 +17,7 @@ void print_hint()
printf("Usage: fz [flags] <file path>\n"); printf("Usage: fz [flags] <file path>\n");
printf("Flags:\n"); printf("Flags:\n");
printf("\t-h\t--help\tprint usage information\n"); printf("\t-h\t--help\tprint usage information\n");
printf("\t-d\t--debug\tdisplay program opcodes\n");
} }
// Parse passed arguments and build args setup structure // Parse passed arguments and build args setup structure