mirror of
https://codeberg.org/libreboot/lbmk.git
synced 2026-07-14 15:29:35 +02:00
config/git: import suckless sbase
i currently use the output of sha512sum in several places of xbmk, which is a bit unreliable in case output changes. other cases where i use util outputs in variables are probably reliable, because i'm using mostly posix utilities in those. to mitigate this, i now import suckless sbase, which has a reasonable sha512sum implementation. *every* binary it builds is being placed in build.list, because i'll probably start using more of them. for example, i may start modifying the "date" implementation, adding the GNU-specific options that i need as mentioned on init.sh i'm importing it in util/ because the sha512sum util is needed for verifying project sources, so if sbase itself is a "project source", that means we can into a chicken and egg bootstrapping problem. this is sbase at revision: 055cc1ae1b3a13c3d8f25af0a4a3316590efcd48 Signed-off-by: Leah Rowe <leah@libreboot.org>
This commit is contained in:
+116
@@ -0,0 +1,116 @@
|
||||
.Dd May 15, 2020
|
||||
.Dt NL 1
|
||||
.Os sbase
|
||||
.Sh NAME
|
||||
.Nm nl
|
||||
.Nd line numbering filter
|
||||
.Sh SYNOPSIS
|
||||
.Nm
|
||||
.Op Fl p
|
||||
.Op Fl b Ar type
|
||||
.Op Fl d Ar delim
|
||||
.Op Fl f Ar type
|
||||
.Op Fl h Ar type
|
||||
.Op Fl i Ar num
|
||||
.Op Fl l Ar num
|
||||
.Op Fl n Ar format
|
||||
.Op Fl s Ar sep
|
||||
.Op Fl v Ar num
|
||||
.Op Fl w Ar num
|
||||
.Op Ar file
|
||||
.Sh DESCRIPTION
|
||||
.Nm
|
||||
reads lines from
|
||||
.Ar file
|
||||
and writes them to stdout, numbering non-empty lines.
|
||||
If no
|
||||
.Ar file
|
||||
is given
|
||||
.Nm
|
||||
reads from stdin.
|
||||
.Pp
|
||||
.Nm
|
||||
treats the input text as a collection of logical pages divided into
|
||||
logical page sections.
|
||||
Each logical page consists of a header section, a body
|
||||
section and a footer section.
|
||||
Sections may be empty.
|
||||
The start of each section is indicated by a single delimiting line, one of:
|
||||
.Bl -column "\e:\e:\e: " "header " -offset indent
|
||||
.It Em "Line" Ta Em "Start of"
|
||||
.It \e:\e:\e: header
|
||||
.It \e:\e: body
|
||||
.It \e: footer
|
||||
.El
|
||||
.Pp
|
||||
If the input text contains no delimiting line then all of the input text
|
||||
belongs to a single logical page body section.
|
||||
.Sh OPTIONS
|
||||
.Bl -tag -width Ds
|
||||
.It Fl p
|
||||
Do not reset line number for logical pages.
|
||||
.It Fl h Ar type | Fl b Ar type | Fl f Ar type
|
||||
Define which lines to number in the head | body | footer section:
|
||||
.Bl -tag -width pstringXX
|
||||
.It a
|
||||
All lines.
|
||||
.It n
|
||||
No lines.
|
||||
.It t
|
||||
Only non-empty lines.
|
||||
This is the default.
|
||||
.It p Ns Ar expr
|
||||
Only lines matching
|
||||
.Ar expr
|
||||
according to
|
||||
.Xr regex 7 or
|
||||
.Xr re_format 7 .
|
||||
.El
|
||||
.It Fl d Ar delim
|
||||
Set
|
||||
.Ar delim
|
||||
as the delimiter for logical pages.
|
||||
If
|
||||
.Ar delim
|
||||
is only one character,
|
||||
.Nm
|
||||
appends ":" to it.
|
||||
The default is "\e:".
|
||||
.It Fl i Ar num
|
||||
Set the increment between numbered lines to
|
||||
.Ar num .
|
||||
.It Fl l Ar num
|
||||
Set the number of adjacent blank lines to be considered as one to
|
||||
.Ar num .
|
||||
The default is 1.
|
||||
.It Fl n Ar format
|
||||
Set the line number output
|
||||
.Ar format
|
||||
to one of:
|
||||
.Bl -tag -width pstringXX
|
||||
.It ln
|
||||
Left justified.
|
||||
.It rn
|
||||
Right justified.
|
||||
This is the default.
|
||||
.It rz
|
||||
Right justified with leading zeroes.
|
||||
.El
|
||||
.It Fl s Ar sep
|
||||
Use
|
||||
.Ar sep
|
||||
to separate line numbers and lines.
|
||||
The default is "\et".
|
||||
.It Fl v Ar num
|
||||
Start counting lines from
|
||||
.Ar num .
|
||||
The default is 1.
|
||||
.It Fl w Ar num
|
||||
Set the width of the line number to
|
||||
.Ar num .
|
||||
The default is 6.
|
||||
.El
|
||||
.Sh SEE ALSO
|
||||
.Xr pr 1
|
||||
.Sh STANDARDS
|
||||
POSIX.1-2013.
|
||||
Reference in New Issue
Block a user