WIP: docs: fixed formatting of many manpages #86

Draft
emma wants to merge 27 commits from docs into main
Owner
No description provided.
emma added the
enhancement
label 2024-03-27 00:28:06 +00:00
emma self-assigned this 2024-03-27 00:28:06 +00:00
emma added 1 commit 2024-03-27 00:28:06 +00:00
emma requested review from trinity 2024-03-27 00:29:29 +00:00
emma requested review from silt 2024-03-27 00:29:29 +00:00
emma added 2 commits 2024-03-27 01:23:15 +00:00
trinity requested changes 2024-03-27 04:53:17 +00:00
trinity left a comment
Owner

Upon review I realize my man pages had a lot of errors and wrinkles. Your changes are in sum an improvement but I find some of them to be questionable.

Upon review I realize my man pages had a lot of errors and wrinkles. Your changes are in sum an improvement but I find some of them to be questionable.
docs/dj.1 Outdated
@ -61,1 +52,4 @@
Takes no arguments and pads with nuls.
.RE
.B -B
Owner

It would make more sense to order the options -ibscaAoBSHqd in explanation. Input, input options, alightment, output, output options, diagnostic options. Capitals before lowercases is especially confusing in the context of dj(1).

It would make more sense to order the options `-ibscaAoBSHqd` in explanation. Input, input options, alightment, output, output options, diagnostic options. Capitals before lowercases is especially confusing in the context of dj(1).
Author
Owner

I am still under the persuasion that we should order them alphabetically

I am still under the persuasion that we should order them alphabetically
Owner

I am still not.

I am still not.
Author
Owner

@silt what are your thoughts

@silt what are your thoughts
Owner

i think that in general, it makes sense to sort/group options logically, rather than alphabetically. when i go to a manpage to look at an option, options that are in some way related are far more useful to have close by than options that just happen to be alphabetical neighbors. the only benefit i see to alphabetical ordering is being able to quickly find a specific option in a long list of them, but that's not a good reason. quickly finding some text is what grep and its siblings are for.

i think that in general, it makes sense to sort/group options logically, rather than alphabetically. when i go to a manpage to look at an option, options that are in some way related are far more useful to have close by than options that just happen to be alphabetical neighbors. the only benefit i see to alphabetical ordering is being able to quickly find a specific option in a long list of them, but that's not a good reason. quickly finding some text is what `grep` and its siblings are for.
Author
Owner

@trinity what are your thoughts on the latest change I made?

@trinity what are your thoughts on the latest change I made?
Owner

Love it.

Love it.
docs/dj.1 Outdated
@ -69,0 +61,4 @@
.B -H
.RS
Prints diagnostics messages in an alternate manner as described in the
Owner

"in an alternate, human-readable format" would be better; the 'H' stands for Human.

"in an alternate, human-readable format" would be better; the 'H' stands for Human.
emma marked this conversation as resolved
docs/dj.1 Outdated
@ -71,2 +69,4 @@
.RS
Skips a number of bytes through the output before starting to write from
the input. If the input is a stream the bytes are read and discarded. If the
output is a stream, nul characters are printed.
Owner

"If the output is a stream, nul bytes are printed." Input is irrelevant here (this may be my own error).

"If the output is a stream, nul bytes are printed." Input is irrelevant here (this may be my own error).
emma marked this conversation as resolved
docs/dj.1 Outdated
@ -80,1 +76,3 @@
The
.RS
Takes one argument of one byte in length and pads the input buffer with
that byte in the event that a read doesnt fill the input buffer, and the
Owner

"and the"?..

-a pads the input buffer with the given byte in the event of an incomplete read from the input file. -A instead pads with the nul byte.

"and the"?.. `-a` pads the input buffer with the given byte in the event of an incomplete read from the input file. `-A` instead pads with the nul byte.
emma marked this conversation as resolved
docs/dj.1 Outdated
@ -85,0 +92,4 @@
.B -d
.RS
Prints all debug information, user-specified or otherwise, before program
Owner

Specifically prints information related to invocation.

Specifically prints information related to invocation.
Author
Owner

Please elaborate.

Please elaborate.
Owner

See src/dj.c:370 which is the only thing that happens when the debug level is greater than 2 (the default).

Here's the stderr of dj -d:

argv0=dj
in=<stdin>      ibs=1024        skip=0  align=ff       count=0
out=<stdout>    obs=1024        seek=0  debug= 3       noerror=0

align is shown to be ff here because the two's complement representation of its sentry value (-1) is 0b 1111 1111 1111 1111 and only the lower 8b are used for alignment, or allowed when taking a new value as an argument (thus the sentry value can never be chosen by the user), or shown in the debug output.

See [src/dj.c:370](https://git.tebibyte.media/bonsai/coreutils/src/branch/main/src/dj.c#L370) which is the only thing that happens when the `debug` level is greater than `2` (the default). Here's the stderr of `dj -d`: ``` argv0=dj in=<stdin> ibs=1024 skip=0 align=ff count=0 out=<stdout> obs=1024 seek=0 debug= 3 noerror=0 ``` `align` is shown to be `ff` here because the two's complement representation of its sentry value (`-1`) is `0b 1111 1111 1111 1111` and only the lower 8b are used for alignment, or allowed when taking a new value as an argument (thus the sentry value can never be chosen by the user), or shown in the debug output.
emma marked this conversation as resolved
docs/dj.1 Outdated
@ -85,0 +98,4 @@
.B -i
.RS
Takes a path as an argument to open and use in place of standard input.
Owner

- can be used to mean standard input or standard output. This may be noted elsewhere but is relevant here as well.

`-` can be used to mean standard input or standard output. This may be noted elsewhere but is relevant here as well.
emma marked this conversation as resolved
@ -85,0 +103,4 @@
.B -n
.RS
Causes dj to exit on two consecutive empty reads instead of one.
Owner

Causes dj to give failed reads or writes a second try.

Causes dj to give failed reads or writes a second try.
emma marked this conversation as resolved
docs/dj.1 Outdated
@ -85,0 +111,4 @@
Does the same as
.B -i
but in place of standard output. Dj does not truncate output
files and instead writes over the bytes in the existing file.
Owner

I think this would be more appropriate in a BUGS or CAVEATS section, perhaps with a "See BUGS" in the "-o" option.

I think this would be more appropriate in a BUGS or CAVEATS section, perhaps with a "See BUGS" in the "-o" option.
emma marked this conversation as resolved
docs/dj.1 Outdated
@ -85,0 +117,4 @@
.B -s
.RS
Takes a numeric argument as the number of bytes to skip into the input
before starting to read.
Owner

If standard input is used, the bytes are read and discarded.

If standard input is used, the bytes are read and discarded.
emma marked this conversation as resolved
@ -85,0 +125,4 @@
Suppresses error messages which print when a read or write is partial or
empty. When
.B -q
is specified twice suppresses diagnostic output entirely.
Owner

It should be mentioned that -q and -d respectively decrement and increment the debug level of the program.

It should be mentioned that `-q` and `-d` respectively decrement and increment the debug level of the program.
emma marked this conversation as resolved
docs/dj.1 Outdated
@ -151,1 +180,3 @@
use.
The dd(1p) utility specified in POSIX was the basis of this program.
It includes additional features: typical option formatting, allowing seeks to be
Owner

What is "it"?

What is "it"?
emma marked this conversation as resolved
docs/dj.1 Outdated
@ -152,0 +183,4 @@
specified in bytes rather than in blocks, allowing arbitrary bytes as padding,
and printing in a format thats easy to parse for machines. It also neglects
character conversion. This may have been the original intent of dd(1p) but it is
irrelevant to its modern use as a disk utility.
Owner

"its modern use". Its modern use is more as a file utility in some contexts (doas dd of=/root/accessible/only, dd bs=bytes count=1) and a disk utility (doas dd of=/dev/disk, dd if=/dev/hd bs=512 count=1 of=disktable) in other contexts - distinguished by user stress. dd(1p) is no more a disk utility than any other UNIX utility and probably not even a great tool for the job (a 512B buffer sucks for disk image writing - it's way too small!).

It varies greatly per user per context so leaving it ambiguous would be best.

"its modern use". Its modern use is more as a file utility in some contexts (`doas dd of=/root/accessible/only`, `dd bs=bytes count=1`) and a disk utility (`doas dd of=/dev/disk`, `dd if=/dev/hd bs=512 count=1 of=disktable`) in other contexts - distinguished by user stress. dd(1p) is no more a disk utility than any other UNIX utility and probably not even a great tool for the job (a 512B buffer *sucks* for disk image writing - it's way too small!). It varies greatly per user per context so leaving it ambiguous would be best.
emma marked this conversation as resolved
@ -15,2 +15,2 @@
False does nothing regardless of operands or standard input.
False will always return an exit code of 1.
Do nothing regardless of operands or standard input.
An exit code of 1 will always be returned.
Owner

Better: "Do nothing, unsuccessfully."

Better: "Do nothing, unsuccessfully."
Author
Owner

I’m worried that slogan would force us under the GNU Free Documentation license as it is from the GNU man page for their implementation of false(1).

I’m worried that slogan would force us under the GNU Free Documentation license as it is from the GNU man page for their implementation of `false(1)`.
Author
Owner

@trinity did you have any thoughts on this?

@trinity did you have any thoughts on this?
Owner

I think you're right here.

I think you're right here.
trinity marked this conversation as resolved
docs/intcmp.1 Outdated
@ -20,3 +20,3 @@
.SH DESCRIPTION
Intcmp compares integers.
Compare integers.
Owner

This infinitive present tense for descriptions feels off and I think this is a good example of why. "Compare integers" - who, what, when, where, why, how? It's easy to reference but more difficult to puzzle out for the casual reader.

This infinitive present tense for descriptions feels off and I think this is a good example of why. "Compare integers" - who, what, when, where, why, how? It's easy to reference but more difficult to puzzle out for the casual reader.
emma marked this conversation as resolved
@ -33,0 +29,4 @@
.B -g
or
.B -l
, only adjacent integers in the argument sequence can be equal.
Owner

Every comparison only compares with the integers next to it.

Every comparison only compares with the integers next to it.
Author
Owner

Please elaborate on what is wrong here.

Please elaborate on what is wrong here.
Owner

See src/intcmp.c:62:

	do{	r = c;
		c = strtol(argv[i], &argv[i], 10);
		if(*argv[i] != '\0' || errno != 0){
			fprintf(stderr, "%s: argument #%d: Invalid integer\n",
				argv[0], (int)i);
			return EX_USAGE;
		}

		if(i == optind)
			continue;

		/* rule enforcement; if a mode isn't permitted and the numbers
		 * correspond to it, return 1 */
		if(		(!(mode & EQUAL) && r == c)
				|| (!(mode & GREATER) && r > c)
				|| (!(mode & LESS) && r < c))
			return 1;
	}while(++i < argc);

c is the current integer, r is the reference integer to which c is compared. Only adjacent integers are ever compared. Equality is always cohingent on adjacency; perhaps argv [1] and [3] can be equal in 1 == 1 == 1 whereas 1 >= 2 >= 1 is an invalid equation, but that's just the function of the comparisons there.

See [src/intcmp.c:62](https://git.tebibyte.media/bonsai/coreutils/src/branch/main/src/intcmp.c#L62): ```c do{ r = c; c = strtol(argv[i], &argv[i], 10); if(*argv[i] != '\0' || errno != 0){ fprintf(stderr, "%s: argument #%d: Invalid integer\n", argv[0], (int)i); return EX_USAGE; } if(i == optind) continue; /* rule enforcement; if a mode isn't permitted and the numbers * correspond to it, return 1 */ if( (!(mode & EQUAL) && r == c) || (!(mode & GREATER) && r > c) || (!(mode & LESS) && r < c)) return 1; }while(++i < argc); ``` `c` is the current integer, `r` is the reference integer to which `c` is compared. Only adjacent integers are ever compared. Equality is always cohingent on adjacency; perhaps argv [1] and [3] can be equal in `1 == 1 == 1` whereas `1 >= 2 >= 1` is an invalid equation, but that's just the function of the comparisons there.
Author
Owner

I’m not really sure what I need to change here, then.

I’m not really sure what I need to change here, then.
Owner

"Permits adjacent integers to be equal to each other" is sufficient to describe the full functionality.

"Permits adjacent integers to be equal to each other" is sufficient to describe the full functionality.
emma marked this conversation as resolved
@ -48,3 +66,3 @@
There are multiple ways to express compound comparisons; “less than or equal
to” can be -le or -el, for example.
.PP
Owner

Is this replacement portable?

Is this replacement portable?
Author
Owner

I could not find reference to .PP in roff(7).

I could not find reference to `.PP` in `roff(7)`.
Owner

Huh. Now that you mention it, I can't either.

Huh. Now that you mention it, I can't either.
trinity marked this conversation as resolved
docs/mm.1 Outdated
@ -39,2 +28,2 @@
standard output. Standard output itself can be specified by giving the
path '-'. Standard error itself can be specified with the
.RS
Opens subsequent outputs for appending rather than updating.
Owner

s/subsequent//. I realize options are only supported prior to positional arguments.

`s/subsequent//`. I realize options are only supported prior to positional arguments.
emma marked this conversation as resolved
docs/mm.1 Outdated
@ -43,2 +33,2 @@
.PP
The
.RS
Set the output to the standard error.
Owner

Use standard error as an output.

Use standard error as an output.
emma marked this conversation as resolved
docs/mm.1 Outdated
@ -61,3 +68,3 @@
.SH BUGS
Mm does not truncate existing files, which may lead to unexpected results.
Existing files are not truncated, which may lead to unexpected results.
Owner

This is inconsistent with the changes made to the dj(1) man page, possibly to my original man pages but I haven't checked.

This is inconsistent with the changes made to the dj(1) man page, possibly to my original man pages but I haven't checked.
emma marked this conversation as resolved
docs/mm.1 Outdated
@ -67,1 +74,3 @@
Mm was modeled after the cat and tee utilities specified in POSIX.
The cat(1p) and tee(1p) programs specified in POSIX provide equivalent
functionality. The separation of the two sets of functionality into separate
APIs seemed unncessary.
Owner

cat(1p) and tee(1p) don't provide equivalent functionality; cat(1p) doesn't specify a way to ignore SIGINT and tee(1p) doesn't specify a way to ensure output is unbuffered.

Perhaps sh -ec 'trap SIGINT true; cat' would ignore SIGINT with cat(1p) and sh(1p), and sh -c 'dd bs=1 >>file' would append, unbuffered, to file. But I'm not sure if sh(1p)'s trap` works like this, and I don't know if it buffers file redirections, and these are still only achievable with the addition of sh(1p).

cat(1p) and tee(1p) don't provide equivalent functionality; cat(1p) doesn't specify a way to ignore SIGINT and tee(1p) doesn't specify a way to ensure output is unbuffered. Perhaps `sh -ec 'trap SIGINT true; cat'` would ignore `SIGINT` with cat(1p) and sh(1p), and `sh -c 'dd bs=1 >>file' would append, unbuffered, to `file`. But I'm not sure if sh(1p)'s `trap` works like this, and I don't know if it buffers file redirections, and these are still only achievable with the addition of sh(1p).
emma marked this conversation as resolved
docs/npc.1 Outdated
@ -25,0 +21,4 @@
The program reads from standard input and writes to standard output, replacing
non-printing characters with printable equivalents. Control characters print as
a carat (“^”) followed by the character “@” through “_” corresponding to the
Owner

These were single quoted to indicate, following C conventions, specifically that they are ASCII bytes and not strings.

These were single quoted to indicate, following C conventions, specifically that they are ASCII bytes and not strings.
emma marked this conversation as resolved
docs/str.1 Outdated
@ -20,3 +20,2 @@
Str tests each character in an arbitrary quantity of string arguments against
the function of the same name within ctype(3).
Test string arguments against each other.
Owner

Against... each other?

Against... each other?
emma marked this conversation as resolved
docs/str.1 Outdated
@ -38,1 +39,3 @@
('').
Originally, there was an isvalue type as an extension to ctype.h(3), but it
was removed in favor of using strcmp(1) to compare strings against the empty
string ('').
Owner

I think we can remove this as I am probably the only one that used isvalue.

I think we can remove this as I am probably the only one that used `isvalue`.
emma marked this conversation as resolved
docs/strcmp.1 Outdated
@ -39,2 +39,2 @@
Unicode strings may need to be normalized if the intent is to check visual
similarity and not byte similarity.
The program will exit unsuccessfully if the given strings are not identical;
therefore, unicode strings may need to be normalized if the intent is to check
Owner

Unicode is a proper noun.

Unicode is a proper noun.
emma marked this conversation as resolved
emma added 10 commits 2024-03-27 06:18:19 +00:00
trinity requested changes 2024-03-27 16:58:17 +00:00
trinity left a comment
Owner

Just some nitpicks and one goof on my end.

Just some nitpicks and one goof on my end.
docs/dj.1 Outdated
@ -48,0 +51,4 @@
.RS
If the output is a stream, nul bytes are printed. In other words, it does what
.B -a
does but with null bytes instead.
Owner

Nul bytes; "nul" as in ASCII NUL, as in the zero byte ('\0').

Nul bytes; "nul" as in ASCII NUL, as in the zero byte (`'\0'`).
Author
Owner

But in writing it is a null byte, because it is a byte that is null. The NUL representation is used in the context of displaying control characters.

But in writing it is a [null byte](https://en.wikipedia.org/wiki/Null_character), because it is a byte that is null. The NUL representation is used in the context of displaying control characters.
Owner

While that is true, nul with a single L is used to refer to an eight-bit (theoretically, maybe even a seven-bit) zero value given in text encoding. Null with two Ls is often used to refer to the null (zero) memory address, which is typically somewhere between 16 and 48 bits. While the word "null" itself just refers to a zero value, "nul" implies a length in bits that "null" leaves ambiguous. Because otherwise they function identically I prefer to refer to any instance of the byte or character '\0' as nul regardless of use.

There are also contexts where dd(1p) pads with ' ' (a literal 0x20 if I recall my ASCII). If someone is unreasonably knowledgeable regarding particular dd(1p) usages, calling it a "nul" byte because it is a single ASCII character may make it clear for them that our alignment is an analogue to dd(1p)'s conv=sync without, in the dj(1) man page), discussing in depth a tool that is not dj(1).

While that is true, nul with a single L is used to refer to an eight-bit (theoretically, maybe even a seven-bit) zero value given in text encoding. Null with two Ls is often used to refer to the null (zero) memory address, which is typically somewhere between 16 and 48 bits. While the word "null" itself just refers to a zero value, "nul" implies a length in bits that "null" leaves ambiguous. Because otherwise they function identically I prefer to refer to any instance of the byte or character `'\0'` as nul regardless of use. There are also contexts where dd(1p) pads with `' '` (a literal `0x20` if I recall my ASCII). If someone is unreasonably knowledgeable regarding particular dd(1p) usages, calling it a "nul" byte because it is a single ASCII character may make it clear for them that our alignment is an analogue to dd(1p)'s `conv=sync` without, in the dj(1) man page), discussing in depth a tool that is not dj(1).
Author
Owner

Null with two Ls is often used to refer to the null (zero) memory address, which is typically somewhere between 16 and 48 bits.

But is it not clear if it is a null byte (which is 8 bits in length)?

> Null with two Ls is often used to refer to the null (zero) memory address, which is typically somewhere between 16 and 48 bits. But is it not clear if it is a null *byte* (which is 8 bits in length)?
Owner

"Null byte" makes sense but "nul byte" makes sense faster and indicates specifically the ASCII zero value versus an arbitrarily-sized ("byte" is sadly not always specific enough) value.

"Null byte" makes sense but "nul byte" makes sense faster and indicates specifically the ASCII zero value versus an arbitrarily-sized ("byte" is sadly not always specific enough) value.
Author
Owner

The problem is that null is a word and nul is a representation in practice.

The problem is that null is a word and nul is a representation in practice.
Owner

I think I'm willing to cede this hill.

I think I'm willing to cede this hill.
trinity marked this conversation as resolved
docs/dj.1 Outdated
@ -70,2 +71,3 @@
option skips a number of bytes through the output before starting to write from
.RS
Skips a number of bytes through the output before starting to write from
the input. If the input is a stream the bytes are read and discarded. If the
Owner

-S only configures the output.

`-S` only configures the output.
Author
Owner

Please elaborate.

Please elaborate.
Owner

Whether or not the input is a stream is irrelevant to the function of the option -S.

Whether or not the input is a stream is irrelevant to the function of the option `-S`.
emma marked this conversation as resolved
docs/dj.1 Outdated
@ -85,0 +129,4 @@
.SH STANDARD INPUT
The standard input shall be used as an input if one or more of the input files
is “-”.
Owner

Or by default.

Or by default.
emma marked this conversation as resolved
docs/mm.1 Outdated
@ -39,2 +28,2 @@
standard output. Standard output itself can be specified by giving the
path '-'. Standard error itself can be specified with the
.RS
Opens outputs for appending rather than updating.
Owner

I know I corrected this but upon further reflection I have to fix this: -a opens subsequent outputs for appending, because outputs aren't specified positionally but optionally and therefore invocations like mm -o - -o start -ao append do open standard output and start for writing to the start and open append for appending. I was mistaken.

I know I corrected this but upon further reflection I have to fix this: `-a` opens *subsequent* outputs for appending, because outputs aren't specified positionally but optionally and therefore invocations like `mm -o - -o start -ao append` do open standard output and `start` for writing to the start and open `append` for appending. I was mistaken.
emma marked this conversation as resolved
docs/mm.1 Outdated
@ -45,0 +37,4 @@
.B -i
.RS
Opens a path as an input. Without any inputs specified mm will use the
standard input.
Owner

"-" will use standard input or standard output.

`"-"` will use standard input or standard output.
emma marked this conversation as resolved
docs/mm.1 Outdated
@ -66,2 +78,3 @@
Mm was modeled after the cat and tee utilities specified in POSIX.
The cat(1p) and tee(1p) programs specified in POSIX together provide nearly
equivalent functionality. The separation of the two sets of functionality into
Owner

"similar functionality".

"similar functionality".
emma marked this conversation as resolved
emma added 4 commits 2024-03-29 22:25:45 +00:00
emma added 3 commits 2024-03-29 22:30:50 +00:00
emma added 1 commit 2024-03-29 22:48:10 +00:00
emma requested review from trinity 2024-04-10 01:47:49 +00:00
trinity requested changes 2024-04-10 03:05:51 +00:00
trinity left a comment
Owner

Increasingly rarer nitpicks.

Increasingly rarer nitpicks.
docs/dj.1 Outdated
@ -96,0 +76,4 @@
.B -a
.RS
Takes one argument of one byte in length and pads the input buffer with it in
Owner

Could you change ^.*length to "Accepts a single literal byte"?

Could you change `^.*length` to "Accepts a single literal byte"?
emma marked this conversation as resolved
docs/dj.1 Outdated
@ -96,0 +88,4 @@
.B -c
.RS
Specifies an amount of reads to make, and if 0 (the default) dj will
Owner

It would be better if this was two sentences - ". If zero,".

It would be better if this was two sentences - "`. If zero,`".
emma marked this conversation as resolved
docs/dj.1 Outdated
@ -107,4 +147,4 @@
.R {records read} {ASCII unit separator} {partial records read}
.R {ASCII record separator} {records written} {ASCII unit separator}
.R {partial records written} {ASCII group separator} {bytes read}
.R {ASCII record separator} {bytes written} {ASCII file separator}
Owner

I don't know if this should be noted in the man page but this diagnostic output is intended to be machine readable to make scripting easier. I've found dd(1p) to be not only needlessly verbose but also a pain in the ass in this regard.

I really like dj(1)'s -H. It made debugging very easy. Though I would be happy to be corrected with an even better output format.

I don't know if this should be noted in the man page but this diagnostic output is intended to be machine readable to make scripting easier. I've found dd(1p) to be not only needlessly verbose but also a pain in the ass in this regard. I really like dj(1)'s `-H`. It made debugging very easy. Though I would be happy to be corrected with an even better output format.
emma marked this conversation as resolved
@ -116,3 +157,4 @@
.RS
.R {records read} '+' {partial records read} '>' {records written}
.R '+' {partial records written} ';' {bytes read} '>' {bytes written}
.R {ASCII line feed}
Owner

Though this output prioritizes human readability it was also meant to be machine readable in case that was necessary. I couldn't imagine why and I hope it never would be, but if it is, it's easy.

Though this output prioritizes human readability it was also meant to be machine readable in case that was necessary. I couldn't imagine why and I hope it never would be, but if it is, it's easy.
emma marked this conversation as resolved
@ -20,3 +20,3 @@
.SH DESCRIPTION
Intcmp compares integers.
Compare integers to each other.
Owner

With what else would the integers be compared?

With what else would the integers be compared?
Author
Owner
https://git.tebibyte.media/bonsai/coreutils/pulls/86#issuecomment-4120
Owner

This infinitive present tense for descriptions feels off and I think this is a good example of why. "Compare integers" - who, what, when, where, why, how? It's easy to reference but more difficult to puzzle out for the casual reader.

Rare self own. I think my much younger, more foolhardy self of March 2024 is overly cocky here; all that is necessary is to know that intcmp (who) compares integers (what) (and the rest of the man page is why, how). My problem was specifically with the infinitive. Next time I will be less arrogant.

> This infinitive present tense for descriptions feels off and I think this is a good example of why. "Compare integers" - who, what, when, where, why, how? It's easy to reference but more difficult to puzzle out for the casual reader. Rare self own. I think my much younger, more foolhardy self of March 2024 is overly cocky here; all that is necessary is to know that *intcmp* (who) *compares integers* (what) (and the rest of the man page is why, how). My problem was specifically with the infinitive. Next time I will be less arrogant.
Author
Owner

To be fair to me, this is not an infinitive, it is the second-person conjugation of the verb. The infinitive would be “to compare integers”, but it reads “[you] compare integers”. This phrasing is in line with many other man page descriptions I have read and I find it to be the best solution to the problem of program names being hard to fit into grammar (to capitalize or not to capitalize).

To be fair to me, this is not an infinitive, it is the second-person conjugation of the verb. The infinitive would be “to compare integers”, but it reads “[you] compare integers”. This phrasing is in line with many other man page descriptions I have read and I find it to be the best solution to the problem of program names being hard to fit into grammar (to capitalize or not to capitalize).
Owner

This phrasing is in line with many other man page descriptions I have read and I find it to be the best solution to the problem of program names being hard to fit into grammar (to capitalize or not to capitalize).

I don't know if this is exactly what you were trying to convey but I understand now - it's the same tense (and you are right, I was mistaken about it being infinitive :P) as the program names themselves. I like that.

> This phrasing is in line with many other man page descriptions I have read and I find it to be the best solution to the problem of program names being hard to fit into grammar (to capitalize or not to capitalize). I don't know if this is exactly what you were trying to convey but I understand now - it's the same tense (and you are right, I was mistaken about it being infinitive :P) as the program names themselves. I like that.
trinity marked this conversation as resolved
emma added 5 commits 2024-04-18 14:48:12 +00:00
emma changed title from docs: fixed formatting of many manpages to WIP: docs: fixed formatting of many manpages 2024-04-24 21:00:58 +00:00
emma added 1 commit 2024-04-29 02:43:42 +00:00
trinity reviewed 2024-04-29 10:26:16 +00:00
@ -65,1 +56,3 @@
The
.RS
Takes a numeric argument as the size in bytes of the input buffer, with the
default being 1024 bytes or one kibibyte (KiB).
Owner

Perhaps that this is a kibibyte shouldn't be noted here. It may give the false impression that one could specify a SI prefix, e.g. dj -b 1KiB.

Perhaps that this is a kibibyte shouldn't be noted here. It may give the false impression that one could specify a SI prefix, e.g. `dj -b 1KiB`.
trinity reviewed 2024-04-29 10:33:29 +00:00
@ -94,0 +100,4 @@
If the output is a stream, null bytes are printed. This option is equivalent to
specifying
.B -a
with a null byte instead of a character.
Owner

"-a but with null bytes; pads the input buffer with null bytes in the event of an incomplete read.

It's impossible to specify a null byte instead of a character. This may imply that doing so is possible.

"**-a** but with null bytes; pads the input buffer with null bytes in the event of an incomplete read. It's impossible to specify a null byte instead of a character. This may imply that doing so is possible.
Owner

(There is the workaround of having an empty argument; if I recall the sh(1p) builtin read supports this at least with its -b option - I remember this because an article trended on Hacker News recently where the crux of the issue was that the writer didn't understand nul termination. I might consided using that here but it would be as much of a special case code-wise as -A is.)

(There is the workaround of having an empty argument; if I recall the sh(1p) builtin `read` supports this at least with its `-b` option - I remember this because [an article trended on Hacker News recently](https://news.ycombinator.com/item?id=40166099) where the crux of the issue was that the writer didn't understand nul termination. I might consided using that here but it would be as much of a special case code-wise as `-A` is.)
Owner

Option descriptions should start on the same line as the options themselves. See ls(1) for an example of what I mean.

Option descriptions should start on the same line as the options themselves. See `ls(1)` for an example of what I mean.
Owner

Again, comparing the manpages with ls(1), we use far too many newlines to separate items. There should only be one newline before a header, including the first header (NAME).

Correct:

LS(1)                            User Commands                           LS(1)

NAME
       ls - list directory contents

SYNOPSIS
       ls [OPTION]... [FILE]...

DESCRIPTION
       List information about the FILEs (the current directory by default).
       Sort entries alphabetically if none of -cftuvSUX nor --sort is
       specified.

Whatever we're doing:

dj(1)                       General Commands Manual                      dj(1)




NAME
       dj – disk jockey


SYNOPSIS
       dj (-AdHnq) (-a [byte]) (-c [count])

       (-i [ input file ]) (-b [ input block size ]) (-s [ input offset ])

       (-o [ output file ]) (-B [ output block size ]) (-S [ output offset ])

Again, comparing the manpages with `ls(1)`, we use far too many newlines to separate items. There should only be one newline before a header, including the first header (`NAME`). Correct: ```man LS(1) User Commands LS(1) NAME ls - list directory contents SYNOPSIS ls [OPTION]... [FILE]... DESCRIPTION List information about the FILEs (the current directory by default). Sort entries alphabetically if none of -cftuvSUX nor --sort is specified. ``` Whatever we're doing: ```man dj(1) General Commands Manual dj(1) NAME dj – disk jockey SYNOPSIS dj (-AdHnq) (-a [byte]) (-c [count]) (-i [ input file ]) (-b [ input block size ]) (-s [ input offset ]) (-o [ output file ]) (-B [ output block size ]) (-S [ output offset ]) ```
silt reviewed 2024-05-08 03:22:36 +00:00
@ -56,2 +51,2 @@
.PP
The
.RS
Takes a file path as an argument to open and use as an input.
Owner

This could probably be rephrased for clarity. It's not hard to read this as the argument being the thing that gets opened, rather than the file specified by the path within that argument. Obviously that reading makes no sense, but I still think it could be rephrased.

This could probably be rephrased for clarity. It's not hard to read this as the argument being the thing that gets opened, rather than the file specified by the path within that argument. Obviously that reading makes no sense, but I still think it could be rephrased.
silt reviewed 2024-05-08 03:22:56 +00:00
@ -69,0 +67,4 @@
.B -o
.RS
Takes a file path as an argument to open and use as an output.
Owner
See https://git.tebibyte.media/bonsai/coreutils/pulls/86/files#issuecomment-4463
silt reviewed 2024-05-08 03:27:35 +00:00
@ -73,2 +81,2 @@
.PP
The
.RS
Skips a number of bytes through the output before starting to write from
Owner

Should clarify the difference between skipping n bytes and seeking to the nth byte.

cc @trinity

Should clarify the difference between skipping *n* bytes and seeking to the *n*th byte. cc @trinity
Owner

The former. I'd have to think about how to word it.

The former. I'd have to think about how to word it.
silt reviewed 2024-05-08 03:28:46 +00:00
@ -92,2 +93,2 @@
.B -q
is specified a second time. The
.RS
Specifies a number of reads to make. If set to zero (the default), reading will
Owner

@emma and I spoke verbally about this; fae wants to rewrite this to be less clunky.

@emma and I spoke verbally about this; fae wants to rewrite this to be less clunky.
silt reviewed 2024-05-08 03:29:56 +00:00
@ -81,1 +89,4 @@
of an incomplete read from the input file.
.RE
.B -c
Owner

Reminder to @emma to swap the positions of -c and -A.

Reminder to @emma to swap the positions of `-c` and `-A`.
silt reviewed 2024-05-08 03:32:30 +00:00
@ -96,0 +129,4 @@
.SH STANDARD INPUT
The standard input shall be used as an input if no inputs are specified one or
Owner

The standard input shall be used as an input if no inputs are specified or if one or

> The standard input shall be used as an input if no inputs are specified **or if** one or
silt reviewed 2024-05-08 03:33:17 +00:00
@ -106,1 +137,3 @@
.PP
On a partial or empty read, a diagnostic message is printed (unless the
.B -q
option is specified) and the program exits (unless the
Owner

error: unmatched parenthesis on line 139

error: unmatched parenthesis on line 139
Owner

Good catch.

Good catch.
silt reviewed 2024-05-08 03:33:58 +00:00
@ -107,0 +140,4 @@
.B -n
option is specified.
By default statistics are printed for input and output to the standard error in
Owner

By default, statistics are printed for input and output to the standard error in

Note the added comma.

> By default, statistics are printed for input and output to the standard error in Note the added comma.
silt reviewed 2024-05-08 03:36:45 +00:00
@ -128,0 +164,4 @@
If the
.B -d
option is specified, debug output will be printed at the beginning of execution.
This debug information contains information regarding how the program was
Owner

Merge this line with the above line.

Merge this line with the above line.
silt reviewed 2024-05-08 03:41:32 +00:00
@ -128,2 +179,4 @@
diagnostic message is printed and the program exits with the appropriate
sysexits.h(3) status.
.SH BUGS
Owner

If -n is specified along with a count, actual byte output may

Removed superfluous word.

> If -n is specified along with a count, actual byte output may Removed superfluous word.
silt reviewed 2024-05-08 03:42:10 +00:00
@ -96,0 +118,4 @@
.B -n
.RS
Retries failed reads once more before exiting.
Owner

Default is 1, but a number can be specified. This should be made clear here.

Default is 1, but a number can be specified. This should be made clear here.
Owner

A number can be specified for -n in dj(1)?

A number can be specified for -n in dj(1)?
Author
Owner
<https://git.tebibyte.media/bonsai/coreutils/pulls/86/files#issuecomment-4481>
Owner

That meant using -n and -c in tandem.

That meant using `-n` and `-c` in tandem.
silt reviewed 2024-05-08 03:43:10 +00:00
@ -136,25 +189,29 @@ expected (the product of the count multiplied by the input block size). If the
or
.B -A
options are used this could make data written nonsensical.
Owner

options are used, this could make data written nonsensical.

Added comma.

> options are used, this could make data written nonsensical. Added comma.
silt reviewed 2024-05-08 03:44:40 +00:00
@ -138,3 +191,3 @@
options are used this could make data written nonsensical.
.PP
Many lowercase options have capitalized variants and vice-versa which can be
Owner

@emma says that this should be moved to CAVEATS.

@emma says that this should be moved to `CAVEATS`.
silt reviewed 2024-05-08 03:45:51 +00:00
@ -148,0 +203,4 @@
This program was based on the dd(1p) utility as specified in POSIX. While
character conversion may have been the original intent of dd(1p), it is
irrelevant to its modern use. Because of this, it eschews character conversion
and adds typical option formatting, allowing seeks to be specified in bytes
Owner

Again, seeking vs skipping. We need to land on one of them and stick to it, and make the behavior clear.

Again, seeking vs skipping. We need to land on one of them and stick to it, and make the behavior clear.
silt reviewed 2024-05-08 03:46:12 +00:00
@ -147,1 +203,3 @@
features: typical option formatting, allowing seeks to be specified in bytes
This program was based on the dd(1p) utility as specified in POSIX. While
character conversion may have been the original intent of dd(1p), it is
irrelevant to its modern use. Because of this, it eschews character conversion
Owner

Clarify the "it" here.

Clarify the "it" here.
silt reviewed 2024-05-08 03:48:00 +00:00
@ -149,3 +208,1 @@
format that's easy to parse for machines. It also neglects character
conversion, which may be dd's original intent but is irrelevant to its modern
use.
format thats easy to parse for machines.
Owner

format that’s easy for machines to parse.

> format that’s easy for machines to parse.
This pull request is marked as a work in progress.
This branch is out-of-date with the base branch
You can also view command line instructions.

Step 1:

From your project repository, check out a new branch and test the changes.
git checkout -b docs main
git pull origin docs

Step 2:

Merge the changes and update on Forgejo.
git checkout main
git merge --no-ff docs
git push origin main
Sign in to join this conversation.
No reviewers
No Milestone
No project
No Assignees
3 Participants
Notifications
Due Date
The due date is invalid or out of range. Please use the format 'yyyy-mm-dd'.

No due date set.

Dependencies

No dependencies set.

Reference: bonsai/coreutils#86
No description provided.