[hackers] [sbase] sed.1: add some missing info

From: Andrea Calligaris <ac89.hk.public_AT_gmail.com>
Date: Thu, 29 Feb 2024 21:05:36 +0100

There are some features that are coded already, might as well document them.
---
 sed.1 | 22 ++++++++++++++++++++--
 1 file changed, 20 insertions(+), 2 deletions(-)
diff --git a/sed.1 b/sed.1
index 962370e..8b3fe06 100644
--- a/sed.1
+++ b/sed.1
_AT_@ -50,16 +50,32 @@ Append the commands from
 to the list of editing commands.
 .El
 .Sh EXTENDED DESCRIPTION
-Editing commands take the form
+Editing commands take the form:
 .Pp
 [address[,address]]function
+.Pp
+Commands can be separated by ';' or by a new line.
+.Pp
+Multiple functions for the specified address (or address-range) can be enclosed
+in blocks with '{' and '}':
+.Pp
+[address[,address]] { function ; function }
+.Pp
 .Ss Addresses
 Addresses are either blank, a positive decimal integer denoting a line
 number, the character '$' denoting the last line of input, or a regular
-expression.
+expression (in the format
+.No / Ns
+.Ar regexp Ns /).
 A command with no addresses matches every line, one address matches
 individual lines, and two addresses matches a range of lines from the
 first to the second address inclusive.
+.Pp
+The character '!' may be appended after the addresses,
+in which case the function is executed only if the addresses
+.Em don't
+match.
+.Pp
 .Ss Functions
 .Bl -tag -width Ds
 .It Ar a Op Ar text
_AT_@ -152,6 +168,8 @@ Replace each occurrence of a character from set 1 with the corresponding
 character from set 2.
 .It Ar :label
 Create a label for b and t commands.
+.It Ar #comment
+The comment extends until the next newline.
 .It Ar =
 Write current input line number to output.
 .El
-- 
2.34.1
Received on Thu Feb 29 2024 - 21:05:36 CET

This archive was generated by hypermail 2.3.0 : Thu Feb 29 2024 - 21:36:36 CET