rgblib: return EX_USAGE for usage-related errors

This commit is contained in:
bentley
2010-01-15 19:44:46 -07:00
parent 8406fd84d6
commit e25d69e976

View File

@@ -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();