source@mandoc.bsd.lv
 help / color / mirror / Atom feed
* mdocml: implement man(1) quirk: section argument without -s
@ 2014-08-22 18:07 schwarze
  0 siblings, 0 replies; only message in thread
From: schwarze @ 2014-08-22 18:07 UTC (permalink / raw)
  To: source

Log Message:
-----------
implement man(1) quirk: section argument without -s

Modified Files:
--------------
    mdocml:
        main.c

Revision Data
-------------
Index: main.c
===================================================================
RCS file: /usr/vhosts/mdocml.bsd.lv/cvs/mdocml/main.c,v
retrieving revision 1.184
retrieving revision 1.185
diff -Lmain.c -Lmain.c -u -p -r1.184 -r1.185
--- main.c
+++ main.c
@@ -21,6 +21,7 @@
 #include <sys/types.h>
 
 #include <assert.h>
+#include <ctype.h>
 #include <errno.h>
 #include <stdio.h>
 #include <stdint.h>
@@ -227,6 +228,8 @@ main(int argc, char *argv[])
 	if (show_usage)
 		usage(search.argmode);
 
+	/* Postprocess options. */
+
 	if (outmode == OUTMODE_DEF) {
 		switch (search.argmode) {
 		case ARG_FILE:
@@ -242,11 +245,24 @@ main(int argc, char *argv[])
 		}
 	}
 
+	/* Parse arguments. */
+
 	argc -= optind;
 	argv += optind;
 #if HAVE_SQLITE3
 	auxargv = NULL;
 #endif
+
+	/* Quirk for a man(1) section argument without -s. */
+
+	if (search.argmode == ARG_NAME &&
+	    argv[0] != NULL &&
+	    isdigit((unsigned char)argv[0][0]) &&
+	    (argv[0][1] == '\0' || !strcmp(argv[0], "3p"))) {
+		search.sec = argv[0];
+		argv++;
+		argc--;
+	}
 
 	rc = MANDOCLEVEL_OK;
 
--
 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-08-22 18:07 UTC | newest]

Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2014-08-22 18:07 mdocml: implement man(1) quirk: section argument without -s 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).