Use standard getopt(3) error message.
Submitted by: jilles Approved by: kib (mentor)
This commit is contained in:
parent
ab07718555
commit
3c2ded8bbc
@ -52,7 +52,7 @@ main(int argc, char *argv[])
|
||||
int i;
|
||||
|
||||
ibuf = obuf = ebuf = NULL;
|
||||
while ((i = getopt(argc, argv, ":e:i:o:")) != -1) {
|
||||
while ((i = getopt(argc, argv, "e:i:o:")) != -1) {
|
||||
switch (i) {
|
||||
case 'e':
|
||||
ebuf = optarg;
|
||||
@ -63,13 +63,8 @@ main(int argc, char *argv[])
|
||||
case 'o':
|
||||
obuf = optarg;
|
||||
break;
|
||||
case ':':
|
||||
warnx("Missing argument for option -%c", optopt);
|
||||
usage(1);
|
||||
break;
|
||||
case '?':
|
||||
default:
|
||||
warnx("Unknown option: %c", optopt);
|
||||
usage(1);
|
||||
break;
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user