Merge pull request #4 from neuschaefer/help

fox32: Add --help option
This commit is contained in:
Ry 2023-01-20 15:09:44 -08:00 committed by GitHub
commit d9f03fe1aa
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -57,7 +57,17 @@ int main(int argc, char *argv[]) {
size_t disk_id = 0;
for (int i = 1; i < argc; i++) {
if (strcmp(argv[i], "--disk") == 0) {
if (strcmp(argv[i], "--help") == 0) {
fprintf(stderr,
"Usage: %s [OPTIONS]\n\n"
"Options:\n"
" --help Print this message\n"
" --disk DISK Specify a disk image to use\n"
" --rom ROM Specify a ROM image to use\n"
" --debug Enable debug output\n"
, argv[0]);
return 0;
} else if (strcmp(argv[i], "--disk") == 0) {
if (i + 1 < argc) {
new_disk(argv[i + 1], disk_id++);
i++;