sdl2-config.1: Some remarks and a patch with editorial changes for this man page
Bjarni Ingi Gislason <[email protected]> Thu, 27 Mar 2025 22:53:52 +0000
| Newsgroups | gmane.comp.gnu.utils.bugs |
|---|---|
| Message-ID | <[email protected]> |
--uX/Bsh8SkSncfM6v
Content-Type: text/plain; charset=us-ascii
Content-Disposition: inline
Package: sharutils
Version: 1:4.15.2-11
Severity: minor
Tags: patch
* What led up to the situation?
Checking for defects with a new version
test-[g|n]roff -mandoc -t -K utf8 -rF0 -rHY=0 -rCHECKSTYLE=10 -ww -z < "man page"
[Use "grep -e ' $' -e '\\~$' <file>" to find obvious trailing spaces.]
["test-groff" is a script in the repository for "groff"; is not shipped]
(local copy and "troff" slightly changed by me).
[The fate of "test-nroff" was decided in groff bug #55941.]
* What was the outcome of this action?
an.tmac:<stdin>:59: misuse, warning: .BI is for at least 2 arguments, got 1
Use macro '.B' for one argument or split argument.
an.tmac:<stdin>:87: misuse, warning: .BI is for at least 2 arguments, got 1
Use macro '.B' for one argument or split argument.
* What outcome did you expect instead?
No output (no warnings).
-.-
General remarks and further material, if a diff-file exist, are in the
attachments.
-- System Information:
Debian Release: trixie/sid
APT prefers testing
APT policy: (500, 'testing')
Architecture: amd64 (x86_64)
Kernel: Linux 6.12.19-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 sharutils depends on:
ii libc6 2.41-6
sharutils recommends no packages.
Versions of packages sharutils suggests:
pn bsd-mailx | mailx <none>
pn sharutils-doc <none>
-- no debconf information
--uX/Bsh8SkSncfM6v
Content-Type: text/plain; charset=us-ascii
Content-Disposition: attachment; filename="chk_man.err.sdl2-config.1"
Input file is sdl2-config.1
Output from "mandoc -T lint sdl2-config.1": (shortened list)
1 input text line longer than 80 bytes: Print the linker fla...
-.-.
Output from "test-nroff -mandoc -t -ww -z sdl2-config.1": (shortened list)
2 Use macro '.B' for one argument or split argument.
2 .BI is for at least 2 arguments, got 1
-.-.
Change two HYPHEN-MINUSES (code 0x2D) to an em-dash (\(em),
if one is intended.
" \(em " creates a too big gap in the text (in "troff").
An en-dash is usually surrounded by a space,
while an em-dash is used without spaces.
"man" (1 byte characters in input) transforms an en-dash (\(en) to one
HYPHEN-MINUS,
and an em-dash to two HYPHEN-MINUSES without considering the space
around it.
If "--" are two single "-"
(begin of an option or end of options)
then use "\-\-".
sdl2-config.1:6:[\fB--prefix\fR[\fB=\fIDIR\fR]]
sdl2-config.1:7:[\fB--exec-prefix\fR[\fB=\fIDIR\fR]]
sdl2-config.1:8:[\fB--version\fR]
sdl2-config.1:9:[\fB--cflags\fR]
sdl2-config.1:10:[\fB--libs\fR]
sdl2-config.1:11:[\fB--static-libs\fR]
sdl2-config.1:52:.B --cflags
sdl2-config.1:57:.BR "${PKG_CONFIG:-pkg-config} --cflags sdl2" .
sdl2-config.1:59:.BI --exec-prefix\fR[=\fIDIR\fR]
sdl2-config.1:63:.BR "${PKG_CONFIG:-pkg-config} --variable=exec_prefix sdl2" .
sdl2-config.1:66:SDL was built with when computing the output for the --cflags, --libs and
sdl2-config.1:67:--static-libs options. This option must be specified before any of the options
sdl2-config.1:68:--cflags, --libs and --static-libs.
sdl2-config.1:71:.BI --define-variable=exec_prefix= DIR
sdl2-config.1:72:.BR "" [ --cflags | --libs "|...]"
sdl2-config.1:75:.B --libs
sdl2-config.1:79:.BR "${PKG_CONFIG:-pkg-config} --libs sdl2" .
sdl2-config.1:81:.B --static-libs
sdl2-config.1:85:.BR "${PKG_CONFIG:-pkg-config} --static --libs sdl2" .
sdl2-config.1:87:.BI --prefix\fR[=\fIDIR\fR]
sdl2-config.1:90:.BR "${PKG_CONFIG:-pkg-config} --variable=prefix sdl2" .
sdl2-config.1:93:was built with when computing the output for the --cflags, --libs and
sdl2-config.1:94:--static-libs options. This option is also used for the exec prefix if
sdl2-config.1:95:--exec-prefix was not specified. This option must be specified before any of
sdl2-config.1:96:the options --cflags, --libs and --static-libs.
sdl2-config.1:99:.BI --define-variable=prefix= DIR
sdl2-config.1:100:.BR "" [ --cflags | --libs "|...]"
sdl2-config.1:103:.B --version
sdl2-config.1:106:.B ${PKG_CONFIG:-pkg-config} --modversion
sdl2-config.1:110:gcc -o main.o $(sdl2-config --cflags) main.c
sdl2-config.1:115:gcc -o my_app $(sdl2-config --libs) main.o util.o
-.-.
Wrong distance (not two spaces) 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.
Mark a final abbreviation point as such by suffixing it with "\&".
Some sentences (etc.) do not begin on a new line.
Split (sometimes) lines after a punctuation mark; before a conjunction.
Lines with only one (or two) space(s) between sentences could be split,
so latter sentences begin on a new line.
Use
#!/usr/bin/sh
sed -e '/^\./n' \
-e 's/\([[:alpha:]]\)\. */\1.\n/g' $1
to split lines after a sentence period.
Check result with the difference between the formatted outputs.
See also the attachment "general.bugs"
130:Updated in 2013 by Manuel A. Fernandez Montecelo <[email protected]>.
-.-.
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.
Add "\:" to split the string for the output, "\<newline>" in the source.
Line 82, length 85
Print the linker flags that are necessary to statically link a program that uses SDL.
-.-.
Split a punctuation from a single argument, if a two-font macro is meant.
24:.B sdl2-config.
-.-.
Only one space character is after a possible end of sentence
(after a punctuation, that can end a sentence).
sdl2-config.1:130:Updated in 2013 by Manuel A. Fernandez Montecelo <[email protected]>.
-.-.
Put a subordinate sentence (after a comma) on a new line.
[List of affected lines removed.]
-.-
Remove quotes when there is a printable
but no space character between them
and the quotes are not for emphasis (markup),
for example as an argument to a macro.
sdl2-config.1:1:.TH sdl2-config 1 "2024-01-10" "SDL 2.0"
sdl2-config.1:72:.BR "" [ --cflags | --libs "|...]"
sdl2-config.1:100:.BR "" [ --cflags | --libs "|...]"
-.-.
Output from "test-groff -mandoc -t -K utf8 -rF0 -rHY=0 -rCHECKSTYLE=10 -ww -z ":
an.tmac:<stdin>:59: misuse, warning: .BI is for at least 2 arguments, got 1
Use macro '.B' for one argument or split argument.
an.tmac:<stdin>:87: misuse, warning: .BI is for at least 2 arguments, got 1
Use macro '.B' for one argument or split argument.
-.-.
Additionally:
Add '\&' after an ellipsis when it does not end a sentence.
-.-
Generally:
Split (sometimes) lines after a punctuation mark; before a conjunction.
--uX/Bsh8SkSncfM6v
Content-Type: text/plain; charset=us-ascii
Content-Disposition: attachment; filename="sdl2-config.1.diff"
--- sdl2-config.1 2025-03-27 21:55:50.099844606 +0000
+++ sdl2-config.1.new 2025-03-27 22:22:56.138121975 +0000
@@ -3,12 +3,12 @@
sdl2-config \- script to get information about the installed version of SDL
.SH SYNOPSIS
.B sdl2-config
-[\fB--prefix\fR[\fB=\fIDIR\fR]]
-[\fB--exec-prefix\fR[\fB=\fIDIR\fR]]
-[\fB--version\fR]
-[\fB--cflags\fR]
-[\fB--libs\fR]
-[\fB--static-libs\fR]
+[\fB\-\-prefix\fR[\fB=\fIDIR\fR]]
+[\fB\-\-exec-prefix\fR[\fB=\fIDIR\fR]]
+[\fB\-\-version\fR]
+[\fB\-\-cflags\fR]
+[\fB\-\-libs\fR]
+[\fB\-\-static-libs\fR]
.SH DESCRIPTION
.B sdl2-config
is a tool that is used to configure and determine the compiler and linker
@@ -21,7 +21,7 @@ In new code, consider using
or
.BR pkgconf (1)
instead of
-.B sdl2-config.
+.BR sdl2-config .
To support cross-compiling, if the environment variable
.B PKG_CONFIG
is set, its value should be used instead of the literal name
@@ -49,70 +49,71 @@ and optionally
.BR SDL2::SDL2main .
.SH OPTIONS
.TP
-.B --cflags
+.B \-\-cflags
Print the compiler flags that are necessary to compile a program or library
that uses SDL.
.IP
The pkg-config equivalent is
-.BR "${PKG_CONFIG:-pkg-config} --cflags sdl2" .
+.BR "${PKG_CONFIG:\-pkg-config} \-\-cflags sdl2" .
.TP
-.BI --exec-prefix\fR[=\fIDIR\fR]
+.BR \-\-exec-prefix [ = \fIDIR\fR]
If \fIDIR\fR is not specified, print the exec prefix of the current SDL
installation.
The pkg-config equivalent is
-.BR "${PKG_CONFIG:-pkg-config} --variable=exec_prefix sdl2" .
+.BR "${PKG_CONFIG:\-pkg-config} \-\-variable=exec_prefix sdl2" .
.IP
If \fIDIR\fR is specified, use it instead of the installation exec prefix that
-SDL was built with when computing the output for the --cflags, --libs and
---static-libs options. This option must be specified before any of the options
---cflags, --libs and --static-libs.
-The pkg-config equivalent is
-.B ${PKG_CONFIG:-pkg-config}
-.BI --define-variable=exec_prefix= DIR
-.BR "" [ --cflags | --libs "|...]"
+SDL was built with when computing the output for the \-\-cflags, \-\-libs and
+\-\-static-libs options. This option must be specified before any of the options
+\-\-cflags, \-\-libs and \-\-static-libs.
+The pkg-config equivalent is
+.B ${PKG_CONFIG:\-pkg-config}
+.BI \-\-define-variable=exec_prefix= DIR
+.BR "" [ \-\-cflags | \-\-libs "|...\&]"
.BR sdl2 .
.TP
-.B --libs
+.B \-\-libs
Print the linker flags that are necessary to link a program that uses SDL.
.IP
The pkg-config equivalent is
-.BR "${PKG_CONFIG:-pkg-config} --libs sdl2" .
+.BR "${PKG_CONFIG:\-pkg-config} \-\-libs sdl2" .
.TP
-.B --static-libs
-Print the linker flags that are necessary to statically link a program that uses SDL.
+.B \-\-static-libs
+Print the linker flags
+that are necessary to statically link a program that uses SDL.
.IP
The pkg-config equivalent is
-.BR "${PKG_CONFIG:-pkg-config} --static --libs sdl2" .
+.BR "${PKG_CONFIG:\-pkg-config} \-\-static \-\-libs sdl2" .
.TP
-.BI --prefix\fR[=\fIDIR\fR]
+.BR \-\-prefix [ = \fIDIR\fR]
If \fIDIR\fR is not specified, print the prefix of the current SDL installation.
The pkg-config equivalent is
-.BR "${PKG_CONFIG:-pkg-config} --variable=prefix sdl2" .
+.BR "${PKG_CONFIG:\-pkg-config} \-\-variable=prefix sdl2" .
.IP
If \fIDIR\fR is specified, use it instead of the installation prefix that SDL
-was built with when computing the output for the --cflags, --libs and
---static-libs options. This option is also used for the exec prefix if
---exec-prefix was not specified. This option must be specified before any of
-the options --cflags, --libs and --static-libs.
-The pkg-config equivalent is
-.B ${PKG_CONFIG:-pkg-config}
-.BI --define-variable=prefix= DIR
-.BR "" [ --cflags | --libs "|...]"
+was built with when computing the output for the \-\-cflags, \-\-libs and
+\-\-static-libs options. This option is also used for the exec prefix if
+\-\-exec-prefix was not specified. This option must be specified before any of
+the options \-\-cflags, \-\-libs and \-\-static-libs.
+The pkg-config equivalent is
+.B ${PKG_CONFIG:\-pkg-config}
+.BI \-\-define-variable=prefix= DIR
+.BR "" [ \-\-cflags | \-\-libs "|...\&]"
.BR sdl2 .
.TP
-.B --version
+.B \-\-version
Prints the currently installed version of SDL on standard output.
The pkg-config equivalent is
-.B ${PKG_CONFIG:-pkg-config} --modversion
+.B ${PKG_CONFIG:\-pkg-config} \-\-modversion
.BR sdl2 .
.SH EXAMPLES
.TP
-gcc -o main.o $(sdl2-config --cflags) main.c
+gcc \-o main.o $(sdl2-config \-\-cflags) main.c
is how you might use
.B sdl2-config
to compile a C source file for an executable program.
.TP
-gcc -o my_app $(sdl2-config --libs) main.o util.o
+gcc \-o my_app $(sdl2-config \-\-libs) main.o util.o
is how you might use
.B sdl2-config
to link compiled objects into an executable program.
@@ -127,6 +128,6 @@ The Simple DirectMedia Layer (SDL) libra
This manual page was written by Branden Robinson, originally for Progeny
Linux Systems, Inc., and the Debian Project.
.br
-Updated in 2013 by Manuel A. Fernandez Montecelo <[email protected]>.
+Updated in 2013 by Manuel A.\& Fernandez Montecelo <[email protected]>.
.br
Updated in 2024 by Simon McVittie.
--uX/Bsh8SkSncfM6v
Content-Type: text/plain; charset=us-ascii
Content-Disposition: attachment; filename="general.bugs"
Any program (person), that produces man pages, should check the output
for defects by using (both groff and nroff)
[gn]roff -mandoc -t -ww -b -z -K utf8 <man page>
The same goes for man pages that are used as an input.
For a style guide use
mandoc -T lint
-.-
Any "autogenerator" should check its products with the above mentioned
'groff', 'mandoc', and additionally with 'nroff ...'.
It should also check its input files for too long (> 80) lines.
This is just a simple quality control measure.
The "autogenerator" may have to be corrected to get a better man page,
the source file may, and any additional file may.
Common defects:
Not removing trailing spaces (in in- and output).
The reason for these trailing spaces should be found and eliminated.
"git" has a "tool" to point out whitespace,
see for example "git-apply(1)" and git-config(1)")
Not beginning each input sentence on a new line.
Line length and patch size should thus be reduced.
The script "reportbug" uses 'quoted-printable' encoding when a line is
longer than 1024 characters in an 'ascii' file.
See man-pages(7), item "semantic newline".
-.-
The difference between the formatted output of the original and patched file
can be seen with:
nroff -mandoc <file1> > <out1>
nroff -mandoc <file2> > <out2>
diff -d -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 from 'diff -d -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)
-.-
--uX/Bsh8SkSncfM6v--