X-Git-Url: http://git.marmaro.de/?p=mmh;a=blobdiff_plain;f=uip%2Frcvpack.c;h=b4e37bdea0a4928b634a08fdadff6dacebb13e23;hp=4c271dffe45e186bcc2064309d350f8a4fb2e54d;hb=6e9577f324bef90765a5edc02044eb111ec48072;hpb=2abb9a7cfb0930e27062088734d306e7d78e4cc2 diff --git a/uip/rcvpack.c b/uip/rcvpack.c index 4c271df..b4e37bd 100644 --- a/uip/rcvpack.c +++ b/uip/rcvpack.c @@ -12,6 +12,7 @@ #include #include #include +#include static struct swit switches[] = { #define VERSIONSW 0 @@ -21,6 +22,7 @@ static struct swit switches[] = { { NULL, 0 } }; +char *version=VERSION; int main(int argc, char **argv) @@ -44,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; }