13 #define CEIL(x, y) (((x) + (y) - 1) / (y))
14 #define MIN(x, y) (((x) < (y)) ? (x) : (y))
15 #define MAX(x, y) (((x) > (y)) ? (x) : (y))
16 #define VERBOSE(level, statement...) do { if (level <= verbose) { statement; } } while(0)
20 char *progname
= NULL
;
27 FILE *fd
= ret
? stderr
: stdout
;
28 fprintf (fd
, "usage: %s\n", progname
);
29 fprintf (fd
, " -h : help message\n");
30 fprintf (fd
, " -v : verbose level (%d)\n", verbose
);
37 int main (int argc
, char *argv
[])
43 while ((c
= getopt(argc
, argv
, "hv:")) != EOF
) {
46 verbose
= atoi (optarg
);
53 if (argc
- optind
!= 0) {
54 fprintf (stderr
, "%s: invalid option -- %s\n", progname
, argv
[optind
]);
58 printf ("work in progress...\n");
64 // test: skel.exe -h | awk '/usage:/ { rc=1 } END { exit (1-rc) }'
65 // test: skel.exe -_ 2> /dev/null | awk 'END { if (NR == 0) { exit(0) } else exit (1) }'
66 // test: skel.exe -_ 2>&1 | awk '/usage:/ { rc=1 } END { exit (1-rc) }'
68 /* vim: set ts=4 sw=4 et */