From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from localhost (mandoc.bsd.lv [local]) by mandoc.bsd.lv (OpenSMTPD) with ESMTPA id c5521688 for ; Sun, 14 Jul 2019 13:16:44 -0500 (EST) Date: Sun, 14 Jul 2019 13:16:44 -0500 (EST) X-Mailinglist: mandoc-source Reply-To: source@mandoc.bsd.lv MIME-Version: 1.0 From: schwarze@mandoc.bsd.lv To: source@mandoc.bsd.lv Subject: mandoc: If messages are shown and output is printed without a pager, X-Mailer: activitymail 1.26, http://search.cpan.org/dist/activitymail/ Content-Type: text/plain; charset=utf-8 Message-ID: <862a03de2270deb0@mandoc.bsd.lv> Log Message: ----------- If messages are shown and output is printed without a pager, display a heads-up on stderr at the end because otherwise, users may easily miss the messages: because messages typically occur while parsing, they typically preceed the output. This is most useful with flag combinations like "-c -W all" but may also help in some unusual error scenarios. Inconvenient ordering of output originally pointed out by espie@ for the example situation that /tmp/ is not writeable. Modified Files: -------------- mandoc: main.c mandoc.h mandoc_msg.c Revision Data ------------- Index: mandoc.h =================================================================== RCS file: /home/cvs/mandoc/mandoc/mandoc.h,v retrieving revision 1.263 retrieving revision 1.264 diff -Lmandoc.h -Lmandoc.h -u -p -r1.263 -r1.264 --- mandoc.h +++ mandoc.h @@ -309,6 +309,7 @@ enum mandoclevel mandoc_msg_getrc(void) void mandoc_msg_setrc(enum mandoclevel); void mandoc_msg(enum mandocerr, int, int, const char *, ...) __attribute__((__format__ (__printf__, 4, 5))); +void mandoc_msg_summary(void); void mchars_alloc(void); void mchars_free(void); int mchars_num2char(const char *, size_t); Index: main.c =================================================================== RCS file: /home/cvs/mandoc/mandoc/main.c,v retrieving revision 1.329 retrieving revision 1.330 diff -Lmain.c -Lmain.c -u -p -r1.329 -r1.330 --- main.c +++ main.c @@ -727,7 +727,9 @@ out: signum = WSTOPSIG(status); } tag_unlink(); - } + } else if (curp.outtype != OUTT_LINT) + mandoc_msg_summary(); + return (int)mandoc_msg_getrc(); } Index: mandoc_msg.c =================================================================== RCS file: /home/cvs/mandoc/mandoc/mandoc_msg.c,v retrieving revision 1.7 retrieving revision 1.8 diff -Lmandoc_msg.c -Lmandoc_msg.c -u -p -r1.7 -r1.8 --- mandoc_msg.c +++ mandoc_msg.c @@ -355,3 +355,12 @@ mandoc_msg(enum mandocerr t, int line, i } fputc('\n', fileptr); } + +void +mandoc_msg_summary(void) +{ + if (fileptr != NULL && rc != MANDOCLEVEL_OK) + fprintf(fileptr, + "%s: see above the output for %s messages\n", + getprogname(), level_name[rc]); +} -- To unsubscribe send an email to source+unsubscribe@mandoc.bsd.lv