From 9ba8bc4b64433063a16690b8ce0255cff03d7141 Mon Sep 17 00:00:00 2001 From: DTB Date: Mon, 4 Dec 2023 20:23:03 -0700 Subject: [PATCH] rot(1) and rot13(1) documentation --- rot/rot.1 | 36 ++++++++++++++++++++++++++++++++++++ rot/rot13.1 | 27 ++++++++++++--------------- 2 files changed, 48 insertions(+), 15 deletions(-) create mode 100644 rot/rot.1 diff --git a/rot/rot.1 b/rot/rot.1 new file mode 100644 index 0000000..5f68526 --- /dev/null +++ b/rot/rot.1 @@ -0,0 +1,36 @@ +.TH ROT 1 + +.SH NAME + +rot \(en caesar-rotate text + +.SH SYNOPSIS + +rot +.RB ( rotation ) + +.SH DESCRIPTION + +Rot writes to standard output each character from standard input, rotated +around the Alphabet the given number of times. +.PP +If the rotation is unspecified, the default is 13 places, functionally +equivalent to rot13(1). + +.SH DECRYPTION + +A character rotated 26 places around the Alphabet is the same as the initial +character, so to decrypt rotated text, rotate the text an additional amount of +places so as to make the summed rotation equal to 26 places. + +.SH DIAGNOSTICS + +Rot will exit with the appropriate status from sysexits(3). + +.SH COPYRIGHT + +Public domain. + +.SH SEE ALSO + +caesar(1), rot13(1) diff --git a/rot/rot13.1 b/rot/rot13.1 index 9ba070b..3985327 100644 --- a/rot/rot13.1 +++ b/rot/rot13.1 @@ -2,26 +2,23 @@ .SH NAME -rot13 \- decrypt/encrypt 13-degree caesar-rotated text +rot13 \(en encrypt or 13-degree caesar-rotated text .SH DESCRIPTION -.B rot13 -is a filter program that writes to standard output each Alphabet character from standard input, rotated 13 places. -Non-Alphabet characters are ignored. +Rot13 writes to standard output each character from standard input, rotated +around the Alphabet 13 places. +.PP +Non-Alphabet characters are left unchanged. + +.SH DECRYPTION + +A character rotated 13 places around the Alphabet can be rotated again the same +number of places to be decrypted. .SH DIAGNOSTICS -.B rot13 -will exit with the appropriate status from sysexits(3) if executed improperly. -Otherwise, -.B rot13 -will always exit with status 0, unless there are any unforeseen errors, in which case it will crash without grace. - - -.SH BUGS - -Not Unicode compatible. +Rot13 will exit with the appropriate status from sysexits(3). .SH COPYRIGHT @@ -29,4 +26,4 @@ Public domain. .SH SEE ALSO -caesar(1) +caesar(1), rot(1)