Bug#1078731: fstab-decode.8: Some remarks and editorial changes for this man page
Bjarni Ingi Gislason
bjarniig at simnet.is
Thu Aug 15 00:27:33 BST 2024
Package: sysvinit-utils
Version: 3.10-1
Severity: minor
Tags: patch
* What led up to the situation?
Checking for defects with
[test-]groff -mandoc -t -K utf8 -rF0 -rHY=0 -ww -b -z < "man page"
[test-groff is a script in the repository for "groff"] (local copy and
"troff" slightly changed by me).
* What was the outcome of this action?
troff: backtrace: file '<stdin>':30
troff:<stdin>:30: warning: trailing space in the line
* What outcome did you expect instead?
No output (no warnings).
-.-
General remarks and further material (declared as a "diff" file) are in the
attachments.
-- System Information:
Debian Release: trixie/sid
APT prefers testing
APT policy: (500, 'testing')
Architecture: amd64 (x86_64)
Kernel: Linux 6.10.3-amd64 (SMP w/2 CPU threads; PREEMPT)
Locale: LANG=is_IS.iso88591, LC_CTYPE=is_IS.iso88591 (charmap=ISO-8859-1), LANGUAGE not set
Shell: /bin/sh linked to /usr/bin/dash
Init: sysvinit (via /sbin/init)
Versions of packages sysvinit-utils depends on:
ii libc6 2.39-6
sysvinit-utils recommends no packages.
sysvinit-utils suggests no packages.
-- no debconf information
-------------- next part --------------
Any program (person), that produces man pages, should check its content for
defects by using
groff -mandoc -t -ww -b -z [ -K utf8 | k ] <man page>
The same goes for man pages that are used as an input.
For a style guide use
mandoc -T lint
-.-
So any generator should check its products with the above mentioned
'groff', 'mandoc', and additionally with 'nroff ...'.
This is just a simple quality control measure.
The generator may have to be corrected to get a better man page,
the source file may, and any additional file may.
Common errors:
Input text line longer than 80 bytes.
Not removing trailing spaces (in in- and output).
The reason for these trailing spaces should be found and eliminated.
Not beginning each input sentence on a new line.
Lines should thus be shorter.
-.-
nroff -mandoc <file1> > <out1>
nroff -mandoc <file2> > <out2>
diff -u <out1> <out2>
and for groff, using
"printf '%s\n%s\n' '.kern 0' '.ss 12 0' | groff -mandoc -Z - "
instead of "nroff -mandoc"
Add the option "-t", if the file contains a table.
Read the output of "diff -u" with "less -R" or similar.
-.-.
If "man" (man-db) is used to check the manual for warnings,
the following must be set:
The option "-warnings=w"
The environmental variable:
export MAN_KEEP_STDERR=yes (or any non-empty value)
or
(produce only warnings):
export MANROFFOPT="-ww -b -z"
export MAN_KEEP_STDERR=yes (or any non-empty value)
-.-.
Output from "mandoc -T lint fstab-decode.8": (possibly shortened list)
mandoc: fstab-decode.8:30:66: STYLE: whitespace at end of input line
-.-.
Remove space characters at the end of lines.
Use "git apply ... --whitespace=fix" to fix extra space issues, or use
global configuration "core.whitespace".
30:decodes escapes (such as newline characters and other whitespace)
-.-.
Use a macro to change to the italic font, instead of \fI, if
possible (see man-pages(7)).
26:\fBfstab-decode\fR \fICOMMAND\fR [\,\fIARGUMENT\fR \&.\|.\|.\&]
31:in the specified \fIARGUMENT\/\fRs and uses them to run \fICOMMAND\fR.
33:\fI/etc/fstab\fR, \fI/etc/mtab\fR and \fI/proc/mtab\fR.
55:Otherwise it exits with the status returned by \fICOMMAND\fR.
58:The following example reads \fIfstab\fR, finds all instances of VFAT filesystems
59:and prints their mount points (argument 2 in the \fIfstab\fR file).
-.-.
Wrong distance between sentences in the input file..
Separate the sentences and subordinate clauses; each begins on a new
line. See man-pages(7) ("Conventions for source file layout") and
"info groff" ("Input Conventions").
The best procedure is to always start a new sentence on a new line,
at least, if you are typing on a computer.
Remember coding: Only one command ("sentence") on each (logical) line.
E-mail: Easier to quote exactly the relevant lines.
Generally: Easier to edit the sentence.
Patches: Less unaffected text.
Search for two adjacent words is easier, when they belong to the same line,
and the same phrase.
The amount of space between sentences in the output can then be
controlled with the ".ss" request.
36:parameters to a command as a list of command line arguments. It turns output
44:Into one long list of parameters, "/root /mnt/remote-disk /home". This
45:can be useful when trying to work with multiple filesystems at once. For
46:instance, we can use it to unmount multiple NFS shares. This program also
61:it the list of VFAT mountpoints. This unmounts all VFAT partitions.
-.-.
Split lines longer than 80 characters into two or more lines.
Appropriate break points are the end of a sentence and a subordinate
clause; after punctuation marks.
Line 64, length 84
.B fstab-decode umount $(awk \[aq]$3 == \[dq]vfat\[dq] { print $2 }\[aq] /etc/fstab)
-.-.
Use a font macro that contains the italic correction (\,), like ".IR" or
".IB".
fstab-decode.8:26:\fBfstab-decode\fR \fICOMMAND\fR [\,\fIARGUMENT\fR \&.\|.\|.\&]
fstab-decode.8:26:\fBfstab-decode\fR \fICOMMAND\fR [\,\fIARGUMENT\fR \&.\|.\|.\&]
-.-.
Additional change:
Add '.fi' after the no-filling (.nf) text block.
-.-
Output from "test-groff -b -mandoc -rF0 -rHY=0 -K utf8 -t -ww -z ":
troff: backtrace: file '<stdin>':30
troff:<stdin>:30: warning: trailing space in the line
-------------- next part --------------
--- fstab-decode.8 2024-08-14 21:25:21.715252389 +0000
+++ fstab-decode.8.new 2024-08-14 23:16:40.257135102 +0000
@@ -23,45 +23,60 @@
fstab-decode \- run a command with fstab-encoded arguments
.SH SYNOPSIS
-\fBfstab-decode\fR \fICOMMAND\fR [\,\fIARGUMENT\fR \&.\|.\|.\&]
+.B fstab-decode
+.IR COMMAND " [" ARGUMENT " \&.\|.\|.\&]"
.SH DESCRIPTION
.B fstab-decode
-decodes escapes (such as newline characters and other whitespace)
-in the specified \fIARGUMENT\/\fRs and uses them to run \fICOMMAND\fR.
+decodes escapes (such as newline characters and other whitespace)
+in the specified
+.IR ARGUMENT s
+and uses them to run
+.IR COMMAND .
The argument escaping uses the same rules as path escaping in
-\fI/etc/fstab\fR, \fI/etc/mtab\fR and \fI/proc/mtab\fR.
+.IR /etc/fstab ", " /etc/mtab " and " /proc/mtab .
In essence \fBfstab-decode\fR can be used anytime we want to pass multiple
-parameters to a command as a list of command line arguments. It turns output
-like this:
+parameters to a command as a list of command line arguments.
+It turns output like this:
.nf
/root
/mnt/remote-disk
/home
+.fi
-Into one long list of parameters, "/root /mnt/remote-disk /home". This
-can be useful when trying to work with multiple filesystems at once. For
-instance, we can use it to unmount multiple NFS shares. This program also
-removes whitespace and other characters which might cause programs such
-as \fBmount\fR(8) or \fBumount\fR(8) to fail.
+Into one long list of parameters, "/root /mnt/remote-disk /home".
+This can be useful when trying to work with multiple filesystems at once.
+For instance, we can use it to unmount multiple NFS shares.
+This program also removes whitespace and
+other characters which might cause programs such as
+\fBmount\fR(8) or \fBumount\fR(8) to fail.
.SH EXIT STATUS
.B fstab-decode
exits with status 127 if
.I COMMAND
can't be run.
-Otherwise it exits with the status returned by \fICOMMAND\fR.
+Otherwise it exits with the status returned by
+.IR COMMAND .
.SH EXAMPLES
-The following example reads \fIfstab\fR, finds all instances of VFAT filesystems
-and prints their mount points (argument 2 in the \fIfstab\fR file).
-\fBfstab-decode\fR then runs the specified program, \fBumount\fR(8), and passes
-it the list of VFAT mountpoints. This unmounts all VFAT partitions.
+The following example reads
+.IR fstab ,
+finds all instances of VFAT filesystems
+and prints their mount points
+(argument 2 in the
+.I fstab
+file).
+.B fstab-decode
+then runs the specified program, \fBumount\fR(8), and passes
+it the list of VFAT mountpoints.
+This unmounts all VFAT partitions.
.nf
-.B fstab-decode umount $(awk \[aq]$3 == \[dq]vfat\[dq] { print $2 }\[aq] /etc/fstab)
+.B fstab-decode umount $(awk \[aq]$3 == \[dq]vfat\[dq] { print $2 }\[aq] \
+/etc/fstab)
.fi
.SH SEE ALSO
More information about the Debian-init-diversity
mailing list