Merge branch 'main' into dj
This commit is contained in:
commit
3b5ddede98
13
Makefile
13
Makefile
@ -29,12 +29,12 @@ RUSTLIBS = --extern getopt=build/o/libgetopt.rlib \
|
|||||||
CFLAGS += -I$(SYSEXITS)
|
CFLAGS += -I$(SYSEXITS)
|
||||||
|
|
||||||
.PHONY: all
|
.PHONY: all
|
||||||
all: dj false fop hru intcmp mm npc rpn scrut str strcmp swab true
|
all: docs dj false fop hru intcmp mm npc rpn scrut str strcmp swab true
|
||||||
|
|
||||||
# keep build/include until bindgen(1) has stdin support
|
# keep build/include until bindgen(1) has stdin support
|
||||||
# https://github.com/rust-lang/rust-bindgen/issues/2703
|
# https://github.com/rust-lang/rust-bindgen/issues/2703
|
||||||
build:
|
build:
|
||||||
mkdir -p build/bin build/include build/lib build/o build/test
|
mkdir -p build/bin build/docs build/include build/lib build/o build/test
|
||||||
|
|
||||||
.PHONY: clean
|
.PHONY: clean
|
||||||
clean:
|
clean:
|
||||||
@ -43,7 +43,7 @@ clean:
|
|||||||
dist: all
|
dist: all
|
||||||
mkdir -p $(DESTDIR)/$(PREFIX)/bin $(DESTDIR)/$(PREFIX)/share/man/man1
|
mkdir -p $(DESTDIR)/$(PREFIX)/bin $(DESTDIR)/$(PREFIX)/share/man/man1
|
||||||
cp build/bin/* $(DESTDIR)/$(PREFIX)/bin
|
cp build/bin/* $(DESTDIR)/$(PREFIX)/bin
|
||||||
cp docs/*.1 $(DESTDIR)/$(PREFIX)/$(MANDIR)/man1
|
cp build/docs/*.1 $(DESTDIR)/$(PREFIX)/$(MANDIR)/man1
|
||||||
|
|
||||||
.PHONY: install
|
.PHONY: install
|
||||||
install: dist
|
install: dist
|
||||||
@ -54,6 +54,13 @@ test: build
|
|||||||
tests/posix-compat.sh
|
tests/posix-compat.sh
|
||||||
$(RUSTC) --test src/getopt-rs/lib.rs -o build/test/getopt
|
$(RUSTC) --test src/getopt-rs/lib.rs -o build/test/getopt
|
||||||
|
|
||||||
|
.PHONY: docs
|
||||||
|
docs: docs/ build
|
||||||
|
for file in docs/*; do original="$$(sed -n '/^\.TH/p' <"$$file")"; \
|
||||||
|
title="$$(printf '%s\n' "$$original" | sed \
|
||||||
|
"s/X\.X\.X/$$(git describe --tags --long | cut -d'-' -f1)/g")"; \
|
||||||
|
sed "s/$$original/$$title/g" <"$$file" >"build/$$file"; done
|
||||||
|
|
||||||
.PHONY: rustlibs
|
.PHONY: rustlibs
|
||||||
rustlibs: build/o/libsysexits.rlib build/o/libgetopt.rlib \
|
rustlibs: build/o/libsysexits.rlib build/o/libgetopt.rlib \
|
||||||
build/o/libstrerror.rlib
|
build/o/libstrerror.rlib
|
||||||
|
23
README
23
README
@ -1,28 +1,27 @@
|
|||||||
“Seek not to walk the path of the masters; seek what they sought.”
|
“Seek not to walk the path of the masters; seek what they sought.”
|
||||||
– Matsuo Basho
|
– Matsuo Basho
|
||||||
|
|
||||||
The Bonsai core utilities are a replacement for standard POSIX utilities which
|
The Bonsai harakit utilities are a replacement for standard POSIX utilities
|
||||||
aim to fill its niche while expanding on their capabilities. These new tools are
|
which aim to fill its niche while expanding on their capabilities. These new
|
||||||
the result of the careful examination of the current state of POSIX and Unix
|
tools are the result of the careful examination of the current state of POSIX
|
||||||
utilies. The Unix Philosophy of “do one thing and do it well” are their core but
|
and Unix utilies. The Unix Philosophy of “do one thing and do it well” are their
|
||||||
they avoid clinging to the past.
|
core but they avoid clinging to the past.
|
||||||
|
|
||||||
The era of the original Unix tools has been long and fruitful, but they have
|
The era of the original Unix tools has been long and fruitful, but they have
|
||||||
their flaws. The new, non-POSIX era of this project started with frustration
|
their flaws. This project originated from frustrations with the way certain
|
||||||
with the way certain tools work and how other projects that extend POSIX don’t
|
tools work and how other projects that extend POSIX don’t make anything better.
|
||||||
make anything better.
|
|
||||||
|
|
||||||
This project will not follow in the footsteps of GNU; extensions of POSIX will
|
This project will not follow in the footsteps of GNU; extensions of POSIX will
|
||||||
not be found here. GNU extensions are a gateway to the misuse of the shell. The
|
not be found here. GNU extensions are a gateway to the misuse of the shell. The
|
||||||
Bonsai core utilities will intentionally discourage use of the shell for
|
harakit utilities will intentionally discourage use of the shell for purposes
|
||||||
purposes beyond its scope.
|
beyond its scope.
|
||||||
|
|
||||||
See docs/ for more on the specific utilities currently implemented.
|
See docs/ for more on the specific utilities currently implemented.
|
||||||
|
|
||||||
Building
|
Building
|
||||||
|
|
||||||
The coreutils require a POSIX-compliant environment to compile, including a C
|
Harakit utilities require a POSIX-compliant environment to compile, including a
|
||||||
compiler and preprocessor (cc(1) and cpp(1) by default), an edition 2023 Rust
|
C compiler and preprocessor (cc(1) and cpp(1) by default), an edition 2023 Rust
|
||||||
compiler (rustc(1) by default), bindgen(1), and a POSIX-compliant make(1)
|
compiler (rustc(1) by default), bindgen(1), and a POSIX-compliant make(1)
|
||||||
utility.
|
utility.
|
||||||
|
|
||||||
|
@ -4,7 +4,7 @@
|
|||||||
.\" This work is licensed under CC BY-SA 4.0. To see a copy of this license,
|
.\" 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/>.
|
.\" visit <http://creativecommons.org/licenses/by-sa/4.0/>.
|
||||||
.\"
|
.\"
|
||||||
.TH FALSE 1 2024-06-06 "Bonsai Core Utilites 0.13.11"
|
.TH FALSE 1 2024-06-06 "Harakit X.X.X"
|
||||||
.SH NAME
|
.SH NAME
|
||||||
false \(en do nothing, unsuccessfully
|
false \(en do nothing, unsuccessfully
|
||||||
.\"
|
.\"
|
||||||
|
@ -4,7 +4,7 @@
|
|||||||
.\" This work is licensed under CC BY-SA 4.0. To see a copy of this license,
|
.\" 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/>.
|
.\" visit <http://creativecommons.org/licenses/by-sa/4.0/>.
|
||||||
.\"
|
.\"
|
||||||
.TH FOP 1 2024-06-17 "Bonsai Core Utilites 0.13.11"
|
.TH FOP 1 2024-06-17 "Harakit X.X.X"
|
||||||
.SH NAME
|
.SH NAME
|
||||||
fop \(en field operator
|
fop \(en field operator
|
||||||
.\"
|
.\"
|
||||||
|
@ -3,7 +3,7 @@
|
|||||||
.\" This work is licensed under CC BY-SA 4.0. To see a copy of this license,
|
.\" 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/>.
|
.\" visit <http://creativecommons.org/licenses/by-sa/4.0/>.
|
||||||
.\"
|
.\"
|
||||||
.TH HRU 1 2024-06-17 "Bonsai Core Utilites 0.13.11"
|
.TH HRU 1 2024-06-17 "Harakit X.X.X"
|
||||||
.SH NAME
|
.SH NAME
|
||||||
hru \(en human readable units
|
hru \(en human readable units
|
||||||
.\"
|
.\"
|
||||||
|
@ -4,7 +4,7 @@
|
|||||||
.\" This work is licensed under CC BY-SA 4.0. To see a copy of this license,
|
.\" 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/>.
|
.\" visit <http://creativecommons.org/licenses/by-sa/4.0/>.
|
||||||
.\"
|
.\"
|
||||||
.TH INTCMP 1 2024-06-06 "Bonsai Core Utilites 0.13.11"
|
.TH INTCMP 1 2024-06-06 "Harakit X.X.X"
|
||||||
.SH NAME
|
.SH NAME
|
||||||
intcmp \(en compare integers
|
intcmp \(en compare integers
|
||||||
.\"
|
.\"
|
||||||
|
@ -3,7 +3,7 @@
|
|||||||
.\" This work is licensed under CC BY-SA 4.0. To see a copy of this license,
|
.\" 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/>.
|
.\" visit <http://creativecommons.org/licenses/by-sa/4.0/>.
|
||||||
.\"
|
.\"
|
||||||
.TH MM 1 2024-06-17 "Bonsai Core Utilites 0.13.11"
|
.TH MM 1 2024-06-17 "Harakit X.X.X"
|
||||||
.SH NAME
|
.SH NAME
|
||||||
mm \(en middleman
|
mm \(en middleman
|
||||||
.\"
|
.\"
|
||||||
|
@ -4,7 +4,7 @@
|
|||||||
.\" This work is licensed under CC BY-SA 4.0. To see a copy of this license,
|
.\" 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/>.
|
.\" visit <http://creativecommons.org/licenses/by-sa/4.0/>.
|
||||||
.\"
|
.\"
|
||||||
.TH NPC 1 2024-06-17 "Bonsai Core Utilites 0.13.11"
|
.TH NPC 1 2024-06-17 "Harakit X.X.X"
|
||||||
.SH NAME
|
.SH NAME
|
||||||
npc \(en show non-printing characters
|
npc \(en show non-printing characters
|
||||||
.\"
|
.\"
|
||||||
|
@ -4,7 +4,7 @@
|
|||||||
.\" This work is licensed under CC BY-SA 4.0. To see a copy of this license,
|
.\" 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/>.
|
.\" visit <http://creativecommons.org/licenses/by-sa/4.0/>.
|
||||||
.\"
|
.\"
|
||||||
.TH RPN 1 2024-06-17 "Bonsai Core Utilites 0.13.11"
|
.TH RPN 1 2024-06-17 "Harakit X.X.X"
|
||||||
.SH NAME
|
.SH NAME
|
||||||
rpn \(en reverse polish notation evaluation
|
rpn \(en reverse polish notation evaluation
|
||||||
.\"
|
.\"
|
||||||
|
@ -4,7 +4,7 @@
|
|||||||
.\" This work is licensed under CC BY-SA 4.0. To see a copy of this license,
|
.\" 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/>.
|
.\" visit <http://creativecommons.org/licenses/by-sa/4.0/>.
|
||||||
.\"
|
.\"
|
||||||
.TH SCRUT 1 2024-06-06 "Bonsai Core Utilites 0.13.11"
|
.TH SCRUT 1 2024-06-06 "Harakit X.X.X"
|
||||||
.SH NAME
|
.SH NAME
|
||||||
scrut \(en scrutinize file properties
|
scrut \(en scrutinize file properties
|
||||||
.SH SYNOPSIS
|
.SH SYNOPSIS
|
||||||
|
@ -4,7 +4,7 @@
|
|||||||
.\" This work is licensed under CC BY-SA 4.0. To see a copy of this license,
|
.\" 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/>.
|
.\" visit <http://creativecommons.org/licenses/by-sa/4.0/>.
|
||||||
.\"
|
.\"
|
||||||
.TH STR 1 2024-06-17 "Bonsai Core Utilites 0.13.11"
|
.TH STR 1 2024-06-17 "Harakit X.X.X"
|
||||||
.SH NAME
|
.SH NAME
|
||||||
str \(en test string arguments
|
str \(en test string arguments
|
||||||
.\"
|
.\"
|
||||||
|
@ -4,7 +4,7 @@
|
|||||||
.\" This work is licensed under CC BY-SA 4.0. To see a copy of this license,
|
.\" 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/>.
|
.\" visit <http://creativecommons.org/licenses/by-sa/4.0/>.
|
||||||
.\"
|
.\"
|
||||||
.TH STRCMP 1 2024-06-17 "Bonsai Core Utilites 0.13.11"
|
.TH STRCMP 1 2024-06-17 "Harakit X.X.X"
|
||||||
.SH NAME
|
.SH NAME
|
||||||
strcmp \(en compare strings
|
strcmp \(en compare strings
|
||||||
.\"
|
.\"
|
||||||
|
@ -4,7 +4,7 @@
|
|||||||
.\" This work is licensed under CC BY-SA 4.0. To see a copy of this license,
|
.\" 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/>.
|
.\" visit <http://creativecommons.org/licenses/by-sa/4.0/>.
|
||||||
.\"
|
.\"
|
||||||
.TH SWAB 1 2024-06-17 "Bonsai Core Utilites 0.13.11"
|
.TH SWAB 1 2024-06-17 "Harakit X.X.X"
|
||||||
.SH NAME
|
.SH NAME
|
||||||
swab \(en swap bytes
|
swab \(en swap bytes
|
||||||
.\"
|
.\"
|
||||||
|
@ -4,7 +4,7 @@
|
|||||||
.\" This work is licensed under CC BY-SA 4.0. To see a copy of this license,
|
.\" 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/>.
|
.\" visit <http://creativecommons.org/licenses/by-sa/4.0/>.
|
||||||
.\"
|
.\"
|
||||||
.TH TRUE 1 2024-06-06 "Bonsai Core Utilites 0.13.11"
|
.TH TRUE 1 2024-06-06 "Harakit X.X.X"
|
||||||
.SH NAME
|
.SH NAME
|
||||||
true \(en do nothing, successfully
|
true \(en do nothing, successfully
|
||||||
.\"
|
.\"
|
||||||
|
Loading…
Reference in New Issue
Block a user