mirror of
https://github.com/gbdev/rgbds.git
synced 2025-11-21 10:42:07 +00:00
rgblib: return EX_USAGE for usage-related errors
This commit is contained in:
@@ -3,6 +3,7 @@
|
|||||||
#include <stdio.h>
|
#include <stdio.h>
|
||||||
#include <stdlib.h>
|
#include <stdlib.h>
|
||||||
#include <string.h>
|
#include <string.h>
|
||||||
|
#include <sysexits.h>
|
||||||
|
|
||||||
#include "asmotor.h"
|
#include "asmotor.h"
|
||||||
|
|
||||||
@@ -23,7 +24,7 @@ PrintUsage(void)
|
|||||||
"\td\tDelete modules from library\n"
|
"\td\tDelete modules from library\n"
|
||||||
"\tl\tList library contents\n"
|
"\tl\tList library contents\n"
|
||||||
"\tx\tExtract modules from library\n");
|
"\tx\tExtract modules from library\n");
|
||||||
exit(0);
|
exit(EX_USAGE);
|
||||||
}
|
}
|
||||||
/*
|
/*
|
||||||
* The main routine
|
* The main routine
|
||||||
@@ -100,10 +101,10 @@ main(int argc, char *argv[])
|
|||||||
("Extracted module '%s'\n",
|
("Extracted module '%s'\n",
|
||||||
argv[argn]);
|
argv[argn]);
|
||||||
} else
|
} else
|
||||||
errx(5,
|
errx(EX_NOINPUT,
|
||||||
"Unable to write module");
|
"Unable to write module");
|
||||||
} else
|
} else
|
||||||
errx(5, "Module not found");
|
errx(EX_NOINPUT, "Module not found");
|
||||||
|
|
||||||
argn += 1;
|
argn += 1;
|
||||||
argc -= 1;
|
argc -= 1;
|
||||||
@@ -111,12 +112,12 @@ main(int argc, char *argv[])
|
|||||||
lib_Free(lib);
|
lib_Free(lib);
|
||||||
break;
|
break;
|
||||||
default:
|
default:
|
||||||
errx(5, "Invalid command");
|
errx(EX_USAGE, "Invalid command");
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
|
||||||
} else {
|
} else {
|
||||||
errx(5, "Invalid command");
|
errx(EX_USAGE, "Invalid command");
|
||||||
}
|
}
|
||||||
} else
|
} else
|
||||||
PrintUsage();
|
PrintUsage();
|
||||||
|
|||||||
Reference in New Issue
Block a user