From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from wonkity.com (wonkity.com [67.158.26.137]); by fantadrom.bsd.lv (OpenSMTPD) with ESMTP id cb58bed4; for ; Tue, 7 Jul 2015 12:23:33 -0500 (EST) Received: from wonkity.com (localhost [127.0.0.1]) by wonkity.com (8.14.9/8.14.9) with ESMTP id t67HNQRc099933 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-GCM-SHA384 bits=256 verify=NO) for ; Tue, 7 Jul 2015 11:23:26 -0600 (MDT) (envelope-from wblock@wonkity.com) Received: from localhost (wblock@localhost) by wonkity.com (8.14.9/8.14.9/Submit) with ESMTP id t67HNOWn099928 for ; Tue, 7 Jul 2015 11:23:26 -0600 (MDT) (envelope-from wblock@wonkity.com) Date: Tue, 7 Jul 2015 11:23:24 -0600 (MDT) From: Warren Block To: discuss@mdocml.bsd.lv Subject: Identifying doc formats Message-ID: User-Agent: Alpine 2.20 (BSF 67 2015-01-07) X-Mailinglist: mdocml-discuss Reply-To: discuss@mdocml.bsd.lv MIME-Version: 1.0 Content-Type: multipart/mixed; BOUNDARY="3512871622-1525115020-1436289806=:91939" X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.4.3 (wonkity.com [127.0.0.1]); Tue, 07 Jul 2015 11:23:26 -0600 (MDT) This message is in MIME format. The first part should be readable text, while the remaining parts are likely unreadable without MIME-aware tools. --3512871622-1525115020-1436289806=:91939 Content-Type: text/plain; format=flowed; charset=US-ASCII Can mandoc just detect and display the input format? file(1) says both tcpdump.1 and ls.1 in FreeBSD are "troff or preprocessor input, ASCII text", although one is man and the other is mdoc. In a related note, the mandoc man page is a bit confusing about the input format option. The synopsis says that input formats are [-mformat] That implies--to me, at least--that it would be used as -mmdoc or -mman But... % mandoc -mman tcpdump.1 man: Bad argument % mandoc -man tcpdump.1 (works) This seems to imply that the input formats could really be "doc", "an", and "andoc", and that's obviously not right. The existing option might also assume that any future input formats will start with an "m". That could be the way the code checks for the option internally, but think big. This diff, also attached, is less confusing to me: --- mandoc.1.orig 2015-07-07 11:10:38.756334000 -0600 +++ mandoc.1 2015-07-07 11:16:08.358326000 -0600 @@ -23,7 +23,7 @@ .Sh SYNOPSIS .Nm mandoc .Op Fl V -.Op Fl m Ns Ar format +.Op Fl mdoc Ns | Ns Fl man Ns | Ns Fl mandoc .Op Fl O Ns Ar option .Op Fl T Ns Ar output .Op Fl W Ns Ar level @@ -49,7 +49,7 @@ .Pp The arguments are as follows: .Bl -tag -width Ds -.It Fl m Ns Ar format +.It Fl mdoc Ns | Ns Fl man Ns | Ns Fl mandoc Input format. See .Sx Input Formats This renders as: SYNOPSIS mandoc [-V] [-mdoc|-man|-mandoc] [-Ooption] [-Toutput] [-Wlevel] [file ...] DESCRIPTION The mandoc utility formats UNIX manual pages for display. By default, mandoc reads mdoc(7) or man(7) text from stdin, implying -mandoc, and produces -Tascii output. The arguments are as follows: -mdoc|-man|-mandoc Input format. See Input Formats for available formats. Defaults to -mandoc. Thanks! --3512871622-1525115020-1436289806=:91939 Content-Type: text/plain; charset=US-ASCII; name=mandoc-formats.diff Content-Transfer-Encoding: BASE64 Content-ID: Content-Description: Content-Disposition: attachment; filename=mandoc-formats.diff LS0tIG1hbmRvYy4xLm9yaWcJMjAxNS0wNy0wNyAxMToxMDozOC43NTYzMzQw MDAgLTA2MDANCisrKyBtYW5kb2MuMQkyMDE1LTA3LTA3IDExOjE2OjA4LjM1 ODMyNjAwMCAtMDYwMA0KQEAgLTIzLDcgKzIzLDcgQEANCiAuU2ggU1lOT1BT SVMNCiAuTm0gbWFuZG9jDQogLk9wIEZsIFYNCi0uT3AgRmwgbSBOcyBBciBm b3JtYXQNCisuT3AgRmwgbWRvYyBOcyB8IE5zIEZsIG1hbiBOcyB8IE5zIEZs IG1hbmRvYw0KIC5PcCBGbCBPIE5zIEFyIG9wdGlvbg0KIC5PcCBGbCBUIE5z IEFyIG91dHB1dA0KIC5PcCBGbCBXIE5zIEFyIGxldmVsDQpAQCAtNDksNyAr NDksNyBAQA0KIC5QcA0KIFRoZSBhcmd1bWVudHMgYXJlIGFzIGZvbGxvd3M6 DQogLkJsIC10YWcgLXdpZHRoIERzDQotLkl0IEZsIG0gTnMgQXIgZm9ybWF0 DQorLkl0IEZsIG1kb2MgTnMgfCBOcyBGbCBtYW4gTnMgfCBOcyBGbCBtYW5k b2MNCiBJbnB1dCBmb3JtYXQuDQogU2VlDQogLlN4IElucHV0IEZvcm1hdHMN Cg== --3512871622-1525115020-1436289806=:91939-- -- To unsubscribe send an email to discuss+unsubscribe@mdocml.bsd.lv