X-Git-Url: http://git.marmaro.de/?p=mmh;a=blobdiff_plain;f=uip%2Frcvpack.c;h=b4e37bdea0a4928b634a08fdadff6dacebb13e23;hp=352f785b6bbf0affc7ed33ac6b48086d602764d2;hb=6e9577f324bef90765a5edc02044eb111ec48072;hpb=fede6e42d81ce34fd5c1bbe7fb2757b281c2573a diff --git a/uip/rcvpack.c b/uip/rcvpack.c index 352f785..b4e37bd 100644 --- a/uip/rcvpack.c +++ b/uip/rcvpack.c @@ -10,6 +10,9 @@ #include #include #include +#include +#include +#include static struct swit switches[] = { #define VERSIONSW 0 @@ -19,6 +22,7 @@ static struct swit switches[] = { { NULL, 0 } }; +char *version=VERSION; int main(int argc, char **argv) @@ -42,23 +46,23 @@ main(int argc, char **argv) switch (smatch(++cp, switches)) { case AMBIGSW: ambigsw(cp, switches); - exit(1); + exit(EX_USAGE); case UNKWNSW: - adios(NULL, "-%s unknown", cp); + adios(EX_USAGE, NULL, "-%s unknown", cp); case HELPSW: snprintf(buf, sizeof(buf), "%s [switches] file", invo_name); print_help(buf, switches, 1); - exit(0); + exit(argc == 2 ? EX_OK : EX_USAGE); case VERSIONSW: print_version(invo_name); - exit(0); + exit(argc == 2 ? EX_OK : EX_USAGE); } } if (file) - adios(NULL, "only one file at a time!"); + adios(EX_USAGE, NULL, "only one file at a time!"); else file = cp; }