From: Kristaps Dzonsons <kristaps@bsd.lv>
To: tech@mdocml.bsd.lv
Subject: Re: implement mandocdb -t
Date: Sun, 25 Dec 2011 01:20:15 +0200 [thread overview]
Message-ID: <4EF65E2F.5070009@bsd.lv> (raw)
In-Reply-To: <20111224164653.GD15148@iris.usta.de>
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
next prev parent reply other threads:[~2011-12-24 23:20 UTC|newest]
Thread overview: 4+ messages / expand[flat|nested] mbox.gz Atom feed top
2011-12-24 16:46 Ingo Schwarze
2011-12-24 23:20 ` Kristaps Dzonsons [this message]
2011-12-25 0:38 ` Ingo Schwarze
2011-12-25 0:56 ` Kristaps Dzonsons
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=4EF65E2F.5070009@bsd.lv \
--to=kristaps@bsd.lv \
--cc=tech@mdocml.bsd.lv \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).