From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from smtp-2.sys.kth.se (smtp-2.sys.kth.se [130.237.32.160]) by krisdoz.my.domain (8.14.5/8.14.5) with ESMTP id pBONKPmN010750 for ; Sat, 24 Dec 2011 18:20:26 -0500 (EST) Received: from mailscan-1.sys.kth.se (mailscan-1.sys.kth.se [130.237.32.91]) by smtp-2.sys.kth.se (Postfix) with ESMTP id 2E5C814EA6B for ; Sun, 25 Dec 2011 00:20:19 +0100 (CET) X-Virus-Scanned: by amavisd-new at kth.se Received: from smtp-2.sys.kth.se ([130.237.32.160]) by mailscan-1.sys.kth.se (mailscan-1.sys.kth.se [130.237.32.91]) (amavisd-new, port 10024) with LMTP id OWMFBrI-S6LN for ; Sun, 25 Dec 2011 00:20:16 +0100 (CET) X-KTH-Auth: kristaps [81.198.4.39] X-KTH-mail-from: kristaps@bsd.lv X-KTH-rcpt-to: tech@mdocml.bsd.lv Received: from macky.local (unknown [81.198.4.39]) by smtp-2.sys.kth.se (Postfix) with ESMTP id D90A614EA6A for ; Sun, 25 Dec 2011 00:20:15 +0100 (CET) Message-ID: <4EF65E2F.5070009@bsd.lv> Date: Sun, 25 Dec 2011 01:20:15 +0200 From: Kristaps Dzonsons User-Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10.6; rv:8.0) Gecko/20111105 Thunderbird/8.0 X-Mailinglist: mdocml-tech Reply-To: tech@mdocml.bsd.lv MIME-Version: 1.0 To: tech@mdocml.bsd.lv Subject: Re: implement mandocdb -t References: <20111224164653.GD15148@iris.usta.de> In-Reply-To: <20111224164653.GD15148@iris.usta.de> Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit Hi Ingo, I have a few issues with this patch -- not the intent or code, but rather with the consistency of the verbosity and warnings. First, for consistency, all warnings/errors should follow "CAUSE: REASON" -- including those in the getopt() switch. Thus, "conflicting options" messages should be prefixed by the offending switch case and "Too many arguments" should begin with "-C". Second, verbosity. I think we should settle this now. BSD.lv only has a single `-v' and I think this should stay as such ("%s: added to index" or "%s: removed from index" (or whatever the message is)). This is completely clear and is also valuable to the user. Noting keywords added or removed is unnecessary when you consider that mandocdb(8) isn't there to debug the keywords of individual manuals: it's there to index them. Regarding errors, the existences of (and not reasons for) mandoc(3) parse errors are printed to stderr ("parse failed"). For catpages, I think it's unnecessary to print anything more than the same. After all, it's not like the operator can do anything about the page, no? Just give the same error regardless the reason. Maybe an extra kick like "%s: parse failed (not a manpage?)". Moving on to the warnings (wrong sections, architectures, etc.). This shouldn't be a `-v', as this isn't a verbose message, it's a warning. Maybe we can pull in `-W' from mandoc(1)? I don't think these should be printed by default, as they don't affect parse status. An extra "warning" flag is both consistent with other utilities and doesn't confuse the utility of `-v'. Another option is to print the warnings by default, but use `-q' to silence them. But that's also confusing because one `-q' silences warnings, but `-qq' silences parse errors also? Ugh... If we follow this logic, then `-t' is much clearer, as it does nothing but run in `add' mode without changing the database. (Isn't this usually termed `-n', as with make(1)? Sigh.) However, the `-W' flag (or whatever it becomes) could be turned on by default just like `-Tlint' turns on `-Wall' in mandoc(1). `-v' would be unaffected and meaningless as no files are actually added or removed. Thoughts? Kristaps -- To unsubscribe send an email to tech+unsubscribe@mdocml.bsd.lv