projects
/
mmh
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
gitignore: More specific ignore patterns
[mmh]
/
uip
/
fmtdump.c
diff --git
a/uip/fmtdump.c
b/uip/fmtdump.c
index
884aa4f
..
c9b28cf
100644
(file)
--- a/
uip/fmtdump.c
+++ b/
uip/fmtdump.c
@@
-11,6
+11,7
@@
#include <h/fmt_compile.h>
#include <h/scansbr.h>
#include <locale.h>
#include <h/fmt_compile.h>
#include <h/scansbr.h>
#include <locale.h>
+#include <sysexits.h>
static struct swit switches[] = {
#define FORMSW 0
static struct swit switches[] = {
#define FORMSW 0
@@
-61,30
+62,29
@@
main(int argc, char **argv)
switch (smatch(++cp, switches)) {
case AMBIGSW:
ambigsw(cp, switches);
switch (smatch(++cp, switches)) {
case AMBIGSW:
ambigsw(cp, switches);
- /*sysexits.h EX_USAGE*/
- exit(1);
+ exit(EX_USAGE);
case UNKWNSW:
case UNKWNSW:
- adios(NULL, "-%s unknown", cp);
+ adios(EX_USAGE, NULL, "-%s unknown", cp);
case HELPSW:
snprintf(buf, sizeof(buf), "%s [switches]",
invo_name);
print_help(buf, switches, 1);
case HELPSW:
snprintf(buf, sizeof(buf), "%s [switches]",
invo_name);
print_help(buf, switches, 1);
- exit(0);
+ exit(argc == 2 ? EX_OK : EX_USAGE);
case VERSIONSW:
print_version(invo_name);
case VERSIONSW:
print_version(invo_name);
- exit(0);
+ exit(argc == 2 ? EX_OK : EX_USAGE);
case FORMSW:
if (!(form = *argp++) || *form == '-')
case FORMSW:
if (!(form = *argp++) || *form == '-')
- adios(NULL, "missing argument to %s",
+ adios(EX_USAGE, NULL, "missing argument to %s",
argp[-2]);
continue;
}
}
if (form)
argp[-2]);
continue;
}
}
if (form)
- adios(NULL, "only one form at a time!");
+ adios(EX_USAGE, NULL, "only one form at a time!");
else
form = cp;
}
else
form = cp;
}
@@
-96,7
+96,7
@@
main(int argc, char **argv)
fmt_compile(fmtstr, &fmt);
fmt_dump(fmt);
fmt_compile(fmtstr, &fmt);
fmt_dump(fmt);
- return 0;
+ return EX_OK;
}
static void
}
static void