aboutsummaryrefslogtreecommitdiffstatshomepage
diff options
context:
space:
mode:
authorIngo Schwarze <schwarze@openbsd.org>2021-08-14 13:53:08 +0000
committerIngo Schwarze <schwarze@openbsd.org>2021-08-14 13:53:08 +0000
commite7b68c6d2c0067916b7389ffc4ae72b567852c95 (patch)
tree2656737fe04af34f333dda5216cf293e237b258f
parent2c155e88b6e2ca5d3f75e9b16fcff86b8059f886 (diff)
downloadmandoc-e7b68c6d2c0067916b7389ffc4ae72b567852c95.tar.gz
mandoc-e7b68c6d2c0067916b7389ffc4ae72b567852c95.tar.zst
mandoc-e7b68c6d2c0067916b7389ffc4ae72b567852c95.zip
print a BAGARG message if -T markdown is requested on man(7) input;
suggested by Michael Stapelberg at debian dot org
-rw-r--r--main.c5
-rw-r--r--mandoc.110
-rw-r--r--mandoc.h3
-rw-r--r--mandoc_msg.c1
4 files changed, 16 insertions, 3 deletions
diff --git a/main.c b/main.c
index a74af3fb..f0e2d873 100644
--- a/main.c
+++ b/main.c
@@ -1,4 +1,4 @@
-/* $Id: main.c,v 1.355 2021/06/02 18:28:19 schwarze Exp $ */
+/* $Id: main.c,v 1.356 2021/08/14 13:53:08 schwarze Exp $ */
/*
* Copyright (c) 2010-2012, 2014-2021 Ingo Schwarze <schwarze@openbsd.org>
* Copyright (c) 2008-2012 Kristaps Dzonsons <kristaps@bsd.lv>
@@ -968,6 +968,9 @@ parse(struct mparse *mp, int fd, const char *file,
case OUTT_PS:
terminal_man(outst->outdata, meta);
break;
+ case OUTT_MARKDOWN:
+ mandoc_msg(MANDOCERR_MAN_TMARKDOWN, 0, 0, NULL);
+ break;
default:
break;
}
diff --git a/mandoc.1 b/mandoc.1
index 669cf9fb..f7490963 100644
--- a/mandoc.1
+++ b/mandoc.1
@@ -15,7 +15,7 @@
.\" ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF
.\" OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
.\"
-.Dd $Mdocdate: July 4 2021 $
+.Dd $Mdocdate: August 14 2021 $
.Dt MANDOC 1
.Os
.Sh NAME
@@ -2371,6 +2371,14 @@ The
.Fl O Cm tag
option was specified but the tag was not found in any of the displayed
manual pages.
+.It Sy "\-Tmarkdown unsupported for man(7) input"
+.Pq man
+The
+.Fl T Cm markdown
+option was specified but an input file uses the
+.Xr man 7
+language.
+No output is produced for that input file.
.El
.Sh SEE ALSO
.Xr apropos 1 ,
diff --git a/mandoc.h b/mandoc.h
index ff76e71f..9837ff2a 100644
--- a/mandoc.h
+++ b/mandoc.h
@@ -1,4 +1,4 @@
-/* $Id: mandoc.h,v 1.273 2021/08/10 12:55:03 schwarze Exp $ */
+/* $Id: mandoc.h,v 1.274 2021/08/14 13:53:08 schwarze Exp $ */
/*
* Copyright (c) 2012-2021 Ingo Schwarze <schwarze@openbsd.org>
* Copyright (c) 2010, 2011, 2014 Kristaps Dzonsons <kristaps@bsd.lv>
@@ -257,6 +257,7 @@ enum mandocerr {
MANDOCERR_BADVAL_BAD, /* bad argument value */
MANDOCERR_BADVAL_DUPE, /* duplicate argument value */
MANDOCERR_TAG, /* no such tag */
+ MANDOCERR_MAN_TMARKDOWN, /* -Tmarkdown unsupported for man(7) input */
MANDOCERR_SYSERR, /* ===== start of system errors ===== */
diff --git a/mandoc_msg.c b/mandoc_msg.c
index 8867bb4b..beec5059 100644
--- a/mandoc_msg.c
+++ b/mandoc_msg.c
@@ -257,6 +257,7 @@ static const char *const type_message[MANDOCERR_MAX] = {
"bad option value",
"duplicate option value",
"no such tag",
+ "-Tmarkdown unsupported for man(7) input",
/* system errors */
NULL,