[prev in list] [next in list] [prev in thread] [next in thread] 

List:       mandoc-source
Subject:    mdocml: implement man(1) quirk: section argument without -s
From:       schwarze () mdocml ! bsd ! lv
Date:       2014-08-22 18:07:15
Message-ID: 201408221807.s7MI7FND026440 () krisdoz ! my ! domain
[Download RAW message or body]

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

[prev in list] [next in list] [prev in thread] [next in thread] 

Configure | About | News | Add a list | Sponsored by KoreLogic