* pod2mdoc: polish main: * Correctly check the number of arguments.
@ 2014-07-11 9:05 schwarze
0 siblings, 0 replies; only message in thread
From: schwarze @ 2014-07-11 9:05 UTC (permalink / raw)
To: source
Log Message:
-----------
polish main:
* Correctly check the number of arguments.
* Show the usage() message if there are too many arguments.
* Mention the optional file argument in the usage() message.
Modified Files:
--------------
pod2mdoc:
pod2mdoc.c
Revision Data
-------------
Index: pod2mdoc.c
===================================================================
RCS file: /usr/vhosts/mdocml.bsd.lv/cvs/pod2mdoc/pod2mdoc.c,v
retrieving revision 1.24
retrieving revision 1.25
diff -Lpod2mdoc.c -Lpod2mdoc.c -u -p -r1.24 -r1.25
--- pod2mdoc.c
+++ pod2mdoc.c
@@ -1377,8 +1377,8 @@ main(int argc, char *argv[])
/* Accept only a single input file. */
- if (argc > 2)
- return(EXIT_FAILURE);
+ if (argc > 1)
+ goto usage;
else if (1 == argc)
fname = *argv;
@@ -1387,7 +1387,7 @@ main(int argc, char *argv[])
usage:
fprintf(stderr, "usage: %s [-d date] "
- "[-n title] [-s section]\n", name);
+ "[-n title] [-s section] [file]\n", name);
return(EXIT_FAILURE);
}
--
To unsubscribe send an email to source+unsubscribe@mdocml.bsd.lv
^ permalink raw reply [flat|nested] only message in thread
only message in thread, other threads:[~2014-07-11 9:05 UTC | newest]
Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2014-07-11 9:05 pod2mdoc: polish main: * Correctly check the number of arguments schwarze
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).