From 8b400d8a6251115d449d6930245e0dda0457ef95 Mon Sep 17 00:00:00 2001 From: emma Date: Sun, 23 Jun 2024 23:34:23 -0600 Subject: [PATCH 1/2] Makefile, docs: rename --- README | 23 +++++++++++------------ docs/dj.1 | 2 +- docs/false.1 | 2 +- docs/fop.1 | 2 +- docs/hru.1 | 2 +- docs/intcmp.1 | 2 +- docs/mm.1 | 2 +- docs/npc.1 | 2 +- docs/rpn.1 | 2 +- docs/scrut.1 | 2 +- docs/str.1 | 2 +- docs/strcmp.1 | 2 +- docs/swab.1 | 2 +- docs/true.1 | 2 +- 14 files changed, 24 insertions(+), 25 deletions(-) diff --git a/README b/README index 68be16c..fdb05fb 100644 --- a/README +++ b/README @@ -1,28 +1,27 @@ “Seek not to walk the path of the masters; seek what they sought.” – Matsuo Basho -The Bonsai core utilities are a replacement for standard POSIX utilities which -aim to fill its niche while expanding on their capabilities. These new tools are -the result of the careful examination of the current state of POSIX and Unix -utilies. The Unix Philosophy of “do one thing and do it well” are their core but -they avoid clinging to the past. +The Bonsai harakit utilities are a replacement for standard POSIX utilities +which aim to fill its niche while expanding on their capabilities. These new +tools are the result of the careful examination of the current state of POSIX +and Unix utilies. The Unix Philosophy of “do one thing and do it well” are their +core but they avoid clinging to the past. 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 -with the way certain tools work and how other projects that extend POSIX don’t -make anything better. +their flaws. This project originated from frustrations with the way certain +tools work and how other projects that extend POSIX don’t make anything better. 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 -Bonsai core utilities will intentionally discourage use of the shell for -purposes beyond its scope. +harakit utilities will intentionally discourage use of the shell for purposes +beyond its scope. See docs/ for more on the specific utilities currently implemented. Building -The coreutils require a POSIX-compliant environment to compile, including a C -compiler and preprocessor (cc(1) and cpp(1) by default), an edition 2023 Rust +Harakit utilities require a POSIX-compliant environment to compile, including a +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) utility. diff --git a/docs/dj.1 b/docs/dj.1 index 7d28ac8..5cf2368 100644 --- a/docs/dj.1 +++ b/docs/dj.1 @@ -4,7 +4,7 @@ .\" This work is licensed under CC BY-SA 4.0. To see a copy of this license, .\" visit . .\" -.TH DJ 1 2024-06-17 "Bonsai Core Utilites 0.13.11" +.TH DJ 1 2024-06-17 "Harakit 0.13.11" .SH NAME dj \(en disk jockey .\" diff --git a/docs/false.1 b/docs/false.1 index 5b582dd..1d6691b 100644 --- a/docs/false.1 +++ b/docs/false.1 @@ -4,7 +4,7 @@ .\" This work is licensed under CC BY-SA 4.0. To see a copy of this license, .\" visit . .\" -.TH FALSE 1 2024-06-06 "Bonsai Core Utilites 0.13.11" +.TH FALSE 1 2024-06-06 "Harakit 0.13.11" .SH NAME false \(en do nothing, unsuccessfully .\" diff --git a/docs/fop.1 b/docs/fop.1 index f7afa54..2d54720 100644 --- a/docs/fop.1 +++ b/docs/fop.1 @@ -4,7 +4,7 @@ .\" This work is licensed under CC BY-SA 4.0. To see a copy of this license, .\" visit . .\" -.TH FOP 1 2024-06-17 "Bonsai Core Utilites 0.13.11" +.TH FOP 1 2024-06-17 "Harakit 0.13.11" .SH NAME fop \(en field operator .\" diff --git a/docs/hru.1 b/docs/hru.1 index 346f200..eb0ce5e 100644 --- a/docs/hru.1 +++ b/docs/hru.1 @@ -3,7 +3,7 @@ .\" This work is licensed under CC BY-SA 4.0. To see a copy of this license, .\" visit . .\" -.TH HRU 1 2024-06-17 "Bonsai Core Utilites 0.13.11" +.TH HRU 1 2024-06-17 "Harakit 0.13.11" .SH NAME hru \(en human readable units .\" diff --git a/docs/intcmp.1 b/docs/intcmp.1 index 315cda2..19c2c75 100644 --- a/docs/intcmp.1 +++ b/docs/intcmp.1 @@ -4,7 +4,7 @@ .\" This work is licensed under CC BY-SA 4.0. To see a copy of this license, .\" visit . .\" -.TH INTCMP 1 2024-06-06 "Bonsai Core Utilites 0.13.11" +.TH INTCMP 1 2024-06-06 "Harakit 0.13.11" .SH NAME intcmp \(en compare integers .\" diff --git a/docs/mm.1 b/docs/mm.1 index 3ca0722..0f1b97b 100644 --- a/docs/mm.1 +++ b/docs/mm.1 @@ -3,7 +3,7 @@ .\" This work is licensed under CC BY-SA 4.0. To see a copy of this license, .\" visit . .\" -.TH MM 1 2024-06-17 "Bonsai Core Utilites 0.13.11" +.TH MM 1 2024-06-17 "Harakit 0.13.11" .SH NAME mm \(en middleman .\" diff --git a/docs/npc.1 b/docs/npc.1 index 51cb851..03890fb 100644 --- a/docs/npc.1 +++ b/docs/npc.1 @@ -4,7 +4,7 @@ .\" This work is licensed under CC BY-SA 4.0. To see a copy of this license, .\" visit . .\" -.TH NPC 1 2024-06-17 "Bonsai Core Utilites 0.13.11" +.TH NPC 1 2024-06-17 "Harakit 0.13.11" .SH NAME npc \(en show non-printing characters .\" diff --git a/docs/rpn.1 b/docs/rpn.1 index 7d3b477..f937889 100644 --- a/docs/rpn.1 +++ b/docs/rpn.1 @@ -4,7 +4,7 @@ .\" This work is licensed under CC BY-SA 4.0. To see a copy of this license, .\" visit . .\" -.TH RPN 1 2024-06-17 "Bonsai Core Utilites 0.13.11" +.TH RPN 1 2024-06-17 "Harakit 0.13.11" .SH NAME rpn \(en reverse polish notation evaluation .\" diff --git a/docs/scrut.1 b/docs/scrut.1 index 1e17f7e..541dcf2 100644 --- a/docs/scrut.1 +++ b/docs/scrut.1 @@ -4,7 +4,7 @@ .\" This work is licensed under CC BY-SA 4.0. To see a copy of this license, .\" visit . .\" -.TH SCRUT 1 2024-06-06 "Bonsai Core Utilites 0.13.11" +.TH SCRUT 1 2024-06-06 "Harakit 0.13.11" .SH NAME scrut \(en scrutinize file properties .SH SYNOPSIS diff --git a/docs/str.1 b/docs/str.1 index 6f01125..c4d68cc 100644 --- a/docs/str.1 +++ b/docs/str.1 @@ -4,7 +4,7 @@ .\" This work is licensed under CC BY-SA 4.0. To see a copy of this license, .\" visit . .\" -.TH STR 1 2024-06-17 "Bonsai Core Utilites 0.13.11" +.TH STR 1 2024-06-17 "Harakit 0.13.11" .SH NAME str \(en test string arguments .\" diff --git a/docs/strcmp.1 b/docs/strcmp.1 index 2ff08f6..781fc92 100644 --- a/docs/strcmp.1 +++ b/docs/strcmp.1 @@ -4,7 +4,7 @@ .\" This work is licensed under CC BY-SA 4.0. To see a copy of this license, .\" visit . .\" -.TH STRCMP 1 2024-06-17 "Bonsai Core Utilites 0.13.11" +.TH STRCMP 1 2024-06-17 "Harakit 0.13.11" .SH NAME strcmp \(en compare strings .\" diff --git a/docs/swab.1 b/docs/swab.1 index 1c75705..708a59b 100644 --- a/docs/swab.1 +++ b/docs/swab.1 @@ -4,7 +4,7 @@ .\" This work is licensed under CC BY-SA 4.0. To see a copy of this license, .\" visit . .\" -.TH SWAB 1 2024-06-17 "Bonsai Core Utilites 0.13.11" +.TH SWAB 1 2024-06-17 "Harakit 0.13.11" .SH NAME swab \(en swap bytes .\" diff --git a/docs/true.1 b/docs/true.1 index ebf8916..15a4667 100644 --- a/docs/true.1 +++ b/docs/true.1 @@ -4,7 +4,7 @@ .\" This work is licensed under CC BY-SA 4.0. To see a copy of this license, .\" visit . .\" -.TH TRUE 1 2024-06-06 "Bonsai Core Utilites 0.13.11" +.TH TRUE 1 2024-06-06 "Harakit 0.13.11" .SH NAME true \(en do nothing, successfully .\" From 0fc9a6b533d740214b4364a52bbebe86f81c7dee Mon Sep 17 00:00:00 2001 From: emma Date: Sun, 23 Jun 2024 23:47:29 -0600 Subject: [PATCH 2/2] Makefile, docs: programmatically generate version for docs (i got tired of doing it myself) --- Makefile | 13 ++++++++++--- docs/dj.1 | 2 +- docs/false.1 | 2 +- docs/fop.1 | 2 +- docs/hru.1 | 2 +- docs/intcmp.1 | 2 +- docs/mm.1 | 2 +- docs/npc.1 | 2 +- docs/rpn.1 | 2 +- docs/scrut.1 | 2 +- docs/str.1 | 2 +- docs/strcmp.1 | 2 +- docs/swab.1 | 2 +- docs/true.1 | 2 +- 14 files changed, 23 insertions(+), 16 deletions(-) diff --git a/Makefile b/Makefile index 7756c56..9ecbedb 100644 --- a/Makefile +++ b/Makefile @@ -29,12 +29,12 @@ RUSTLIBS = --extern getopt=build/o/libgetopt.rlib \ CFLAGS += -I$(SYSEXITS) .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 # https://github.com/rust-lang/rust-bindgen/issues/2703 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 clean: @@ -43,7 +43,7 @@ clean: dist: all mkdir -p $(DESTDIR)/$(PREFIX)/bin $(DESTDIR)/$(PREFIX)/share/man/man1 cp build/bin/* $(DESTDIR)/$(PREFIX)/bin - cp docs/*.1 $(DESTDIR)/$(PREFIX)/$(MANDIR)/man1 + cp build/docs/*.1 $(DESTDIR)/$(PREFIX)/$(MANDIR)/man1 .PHONY: install install: dist @@ -54,6 +54,13 @@ test: build tests/posix-compat.sh $(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 rustlibs: build/o/libsysexits.rlib build/o/libgetopt.rlib \ build/o/libstrerror.rlib diff --git a/docs/dj.1 b/docs/dj.1 index 5cf2368..7031ccf 100644 --- a/docs/dj.1 +++ b/docs/dj.1 @@ -4,7 +4,7 @@ .\" This work is licensed under CC BY-SA 4.0. To see a copy of this license, .\" visit . .\" -.TH DJ 1 2024-06-17 "Harakit 0.13.11" +.TH DJ 1 2024-06-17 "Harakit X.X.X" .SH NAME dj \(en disk jockey .\" diff --git a/docs/false.1 b/docs/false.1 index 1d6691b..b940909 100644 --- a/docs/false.1 +++ b/docs/false.1 @@ -4,7 +4,7 @@ .\" This work is licensed under CC BY-SA 4.0. To see a copy of this license, .\" visit . .\" -.TH FALSE 1 2024-06-06 "Harakit 0.13.11" +.TH FALSE 1 2024-06-06 "Harakit X.X.X" .SH NAME false \(en do nothing, unsuccessfully .\" diff --git a/docs/fop.1 b/docs/fop.1 index 2d54720..d777c68 100644 --- a/docs/fop.1 +++ b/docs/fop.1 @@ -4,7 +4,7 @@ .\" This work is licensed under CC BY-SA 4.0. To see a copy of this license, .\" visit . .\" -.TH FOP 1 2024-06-17 "Harakit 0.13.11" +.TH FOP 1 2024-06-17 "Harakit X.X.X" .SH NAME fop \(en field operator .\" diff --git a/docs/hru.1 b/docs/hru.1 index eb0ce5e..6929d51 100644 --- a/docs/hru.1 +++ b/docs/hru.1 @@ -3,7 +3,7 @@ .\" This work is licensed under CC BY-SA 4.0. To see a copy of this license, .\" visit . .\" -.TH HRU 1 2024-06-17 "Harakit 0.13.11" +.TH HRU 1 2024-06-17 "Harakit X.X.X" .SH NAME hru \(en human readable units .\" diff --git a/docs/intcmp.1 b/docs/intcmp.1 index 19c2c75..034a4fd 100644 --- a/docs/intcmp.1 +++ b/docs/intcmp.1 @@ -4,7 +4,7 @@ .\" This work is licensed under CC BY-SA 4.0. To see a copy of this license, .\" visit . .\" -.TH INTCMP 1 2024-06-06 "Harakit 0.13.11" +.TH INTCMP 1 2024-06-06 "Harakit X.X.X" .SH NAME intcmp \(en compare integers .\" diff --git a/docs/mm.1 b/docs/mm.1 index 0f1b97b..2ff9f44 100644 --- a/docs/mm.1 +++ b/docs/mm.1 @@ -3,7 +3,7 @@ .\" This work is licensed under CC BY-SA 4.0. To see a copy of this license, .\" visit . .\" -.TH MM 1 2024-06-17 "Harakit 0.13.11" +.TH MM 1 2024-06-17 "Harakit X.X.X" .SH NAME mm \(en middleman .\" diff --git a/docs/npc.1 b/docs/npc.1 index 03890fb..3e7af39 100644 --- a/docs/npc.1 +++ b/docs/npc.1 @@ -4,7 +4,7 @@ .\" This work is licensed under CC BY-SA 4.0. To see a copy of this license, .\" visit . .\" -.TH NPC 1 2024-06-17 "Harakit 0.13.11" +.TH NPC 1 2024-06-17 "Harakit X.X.X" .SH NAME npc \(en show non-printing characters .\" diff --git a/docs/rpn.1 b/docs/rpn.1 index f937889..8c8cd84 100644 --- a/docs/rpn.1 +++ b/docs/rpn.1 @@ -4,7 +4,7 @@ .\" This work is licensed under CC BY-SA 4.0. To see a copy of this license, .\" visit . .\" -.TH RPN 1 2024-06-17 "Harakit 0.13.11" +.TH RPN 1 2024-06-17 "Harakit X.X.X" .SH NAME rpn \(en reverse polish notation evaluation .\" diff --git a/docs/scrut.1 b/docs/scrut.1 index 541dcf2..56383b8 100644 --- a/docs/scrut.1 +++ b/docs/scrut.1 @@ -4,7 +4,7 @@ .\" This work is licensed under CC BY-SA 4.0. To see a copy of this license, .\" visit . .\" -.TH SCRUT 1 2024-06-06 "Harakit 0.13.11" +.TH SCRUT 1 2024-06-06 "Harakit X.X.X" .SH NAME scrut \(en scrutinize file properties .SH SYNOPSIS diff --git a/docs/str.1 b/docs/str.1 index c4d68cc..22ffea1 100644 --- a/docs/str.1 +++ b/docs/str.1 @@ -4,7 +4,7 @@ .\" This work is licensed under CC BY-SA 4.0. To see a copy of this license, .\" visit . .\" -.TH STR 1 2024-06-17 "Harakit 0.13.11" +.TH STR 1 2024-06-17 "Harakit X.X.X" .SH NAME str \(en test string arguments .\" diff --git a/docs/strcmp.1 b/docs/strcmp.1 index 781fc92..0ad21b2 100644 --- a/docs/strcmp.1 +++ b/docs/strcmp.1 @@ -4,7 +4,7 @@ .\" This work is licensed under CC BY-SA 4.0. To see a copy of this license, .\" visit . .\" -.TH STRCMP 1 2024-06-17 "Harakit 0.13.11" +.TH STRCMP 1 2024-06-17 "Harakit X.X.X" .SH NAME strcmp \(en compare strings .\" diff --git a/docs/swab.1 b/docs/swab.1 index 708a59b..72f0f19 100644 --- a/docs/swab.1 +++ b/docs/swab.1 @@ -4,7 +4,7 @@ .\" This work is licensed under CC BY-SA 4.0. To see a copy of this license, .\" visit . .\" -.TH SWAB 1 2024-06-17 "Harakit 0.13.11" +.TH SWAB 1 2024-06-17 "Harakit X.X.X" .SH NAME swab \(en swap bytes .\" diff --git a/docs/true.1 b/docs/true.1 index 15a4667..97af65b 100644 --- a/docs/true.1 +++ b/docs/true.1 @@ -4,7 +4,7 @@ .\" This work is licensed under CC BY-SA 4.0. To see a copy of this license, .\" visit . .\" -.TH TRUE 1 2024-06-06 "Harakit 0.13.11" +.TH TRUE 1 2024-06-06 "Harakit X.X.X" .SH NAME true \(en do nothing, successfully .\"