forked from bonsai/harakit
docs: fixed formatting of many manpages
This commit is contained in:
156
docs/dj.1
156
docs/dj.1
@@ -1,4 +1,5 @@
|
||||
.\" Copyright (c) 2024 DTB <trinity@trinity.moe>
|
||||
.\" Copyright (c) 2024 Emma Tebibyte <emma@tebibyte.media>
|
||||
.\"
|
||||
.\" This work is licensed under CC BY-SA 4.0. To see a copy of this license,
|
||||
.\" visit <http://creativecommons.org/licenses/by-sa/4.0/>.
|
||||
@@ -46,84 +47,117 @@ dj
|
||||
|
||||
.SH USAGE
|
||||
|
||||
The
|
||||
.B -i
|
||||
option takes a path as an argument to open and use in place of standard input.
|
||||
The
|
||||
.B -o
|
||||
option does the same in place of standard output. Dj does not truncate output
|
||||
files and instead writes over the bytes in the existing file.
|
||||
.PP
|
||||
The
|
||||
.B -b
|
||||
option takes a numeric argument as the size in bytes of the input buffer and
|
||||
the
|
||||
.B -A
|
||||
.RS
|
||||
Takes no arguments and pads with nuls.
|
||||
.RE
|
||||
|
||||
.B -B
|
||||
option does the same for the output buffer, the default for both being 1024
|
||||
bytes, or one kibibyte (KiB).
|
||||
.PP
|
||||
The
|
||||
.B -s
|
||||
option takes a numeric argument as the number of bytes to skip into the input
|
||||
before starting to read, and the
|
||||
.RS
|
||||
Does the same as
|
||||
.B -b
|
||||
but for the output buffer.
|
||||
.RE
|
||||
|
||||
.B -H
|
||||
.RS
|
||||
Prints diagnostics messages in an alternate manner as described in the
|
||||
DIAGNOSTICS section below.
|
||||
.RE
|
||||
|
||||
.B -S
|
||||
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
|
||||
output is a stream, nul characters are printed.
|
||||
.PP
|
||||
The
|
||||
.RE
|
||||
|
||||
.B -a
|
||||
option takes one argument of one byte in length and pads the input buffer with
|
||||
that byte in the event that a read doesn't fill the input buffer, and the
|
||||
.B -A
|
||||
option takes no arguments and pads with nuls.
|
||||
The
|
||||
.RS
|
||||
Takes one argument of one byte in length and pads the input buffer with
|
||||
that byte in the event that a read doesn’t fill the input buffer, and the
|
||||
.RE
|
||||
|
||||
.B -b
|
||||
.RS
|
||||
Takes a numeric argument as the size in bytes of the input buffer, with the
|
||||
default being 1024 bytes or one kibibyte (KiB).
|
||||
.RE
|
||||
|
||||
.B -c
|
||||
option specifies an amount of reads to make, and if 0 (the default) dj will
|
||||
.RS
|
||||
Specifies an amount of reads to make, and if 0 (the default) dj will
|
||||
continue reading until a partial or empty read.
|
||||
.PP
|
||||
.RE
|
||||
|
||||
.B -d
|
||||
.RS
|
||||
Prints all debug information, user-specified or otherwise, before program
|
||||
execution.
|
||||
.RE
|
||||
|
||||
.B -i
|
||||
.RS
|
||||
Takes a path as an argument to open and use in place of standard input.
|
||||
.RE
|
||||
|
||||
.B -n
|
||||
.RS
|
||||
Causes dj to exit on two consecutive empty reads instead of one.
|
||||
.RE
|
||||
|
||||
.B -o
|
||||
.RS
|
||||
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.
|
||||
.RE
|
||||
|
||||
.B -s
|
||||
.RS
|
||||
Takes a numeric argument as the number of bytes to skip into the input
|
||||
before starting to read.
|
||||
.RE
|
||||
|
||||
.B -q
|
||||
.RS
|
||||
Suppresses error messages which print when a read or write is partial or
|
||||
empty. When
|
||||
.B -q
|
||||
is specified twice suppresses diagnostic output entirely.
|
||||
.RE
|
||||
|
||||
.SH DIAGNOSTICS
|
||||
|
||||
On a partial or empty read, dj prints a diagnostic message (unless the
|
||||
.B -q
|
||||
option is specified) and exits (unless the
|
||||
.B -n
|
||||
option is specified, in which case only two consecutive empty reads will cause
|
||||
dj to exit).
|
||||
At exit, usage statistics are printed unless the option
|
||||
.B -q
|
||||
is specified a second time. The
|
||||
.B -H
|
||||
option will make these diagnostics human-readable.
|
||||
option is specified.
|
||||
|
||||
.SH DIAGNOSTICS
|
||||
By default statistics are printed for input and output to the standard error in
|
||||
the following format:
|
||||
|
||||
The
|
||||
.B -d
|
||||
option prints all information, user-specified or otherwise, before program
|
||||
execution.
|
||||
.PP
|
||||
When dj exits, by default statistics are printed for input and output to
|
||||
standard error in the following format:
|
||||
.PP
|
||||
.RS
|
||||
.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}
|
||||
.PP
|
||||
.RE
|
||||
|
||||
If the
|
||||
.B -H
|
||||
option is specified dj instead uses this following format:
|
||||
.PP
|
||||
option is specified, dj instead uses the following format:
|
||||
|
||||
.RS
|
||||
.R {records read} '+' {partial records read} '>' {records written}
|
||||
.R '+' {partial records written} ';' {bytes read} '>' {bytes written}
|
||||
.R {ASCII line feed}
|
||||
.PP
|
||||
The
|
||||
.B -q
|
||||
option suppresses error messages which print when a read or write is partial or
|
||||
empty and when used twice suppresses diagnostic output entirely.
|
||||
.PP
|
||||
In non-recoverable errors that don't pertain to dj's read-write cycle, a
|
||||
diagnostic message is printed and dj exits with the appropriate sysexits(3)
|
||||
.RE
|
||||
|
||||
In non-recoverable errors that don’t pertain to dj’s read-write cycle, a
|
||||
diagnostic message is printed and dj exits with the appropriate sysexits.h(3)
|
||||
status.
|
||||
|
||||
.SH BUGS
|
||||
@@ -136,7 +170,7 @@ 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.
|
||||
.PP
|
||||
|
||||
Many lowercase options have capitalized variants and vice-versa which can be
|
||||
confusing. Capitalized options tend to affect output or are more intense
|
||||
versions of lowercase options.
|
||||
@@ -146,15 +180,15 @@ versions of lowercase options.
|
||||
Dj was modeled after the dd utility specified in POSIX but adds additional
|
||||
features: typical option formatting, allowing seeks to be specified in bytes
|
||||
rather than in blocks, allowing arbitrary bytes as padding, and printing in a
|
||||
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
|
||||
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.
|
||||
|
||||
.SH COPYRIGHT
|
||||
|
||||
Copyright (C) 2023 DTB. License AGPLv3+: GNU AGPL version 3 or later
|
||||
Copyright © 2023 DTB. License AGPLv3+: GNU AGPL version 3 or later
|
||||
<https://gnu.org/licenses/agpl.html>.
|
||||
|
||||
.SH SEE ALSO
|
||||
|
||||
dd(1)
|
||||
dd(1p)
|
||||
|
||||
Reference in New Issue
Block a user