7 Commits

16 changed files with 27 additions and 26 deletions

View File

@@ -8,11 +8,10 @@
# permitted in any medium without royalty provided the copyright notice and this
# notice are preserved. This file is offered as-is, without any warranty.
.POSIX:
# The octal escape \043 is utilized twice in this file as make(1p) will
# interpret a hash in a rule as an inline comment.
# if using BSD make(1), remove these pragmas because they break it
.PRAGMA: posix_202x # future POSIX standard support à la pdpmake(1)
.PRAGMA: command_comment # breaks without this?
.POSIX:
DESTDIR ?= dist
PREFIX ?= /usr/local
@@ -32,9 +31,9 @@ CFLAGS += -I$(SYSEXITS)
.PHONY: all
all: 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:
# keep build/include until bindgen(1) has stdin support
# https://github.com/rust-lang/rust-bindgen/issues/2703
mkdir -p build/bin build/include build/lib build/o build/test
.PHONY: clean
@@ -67,9 +66,9 @@ build/o/libstrerror.rlib: build src/strerror.rs
$(RUSTC) $(RUSTFLAGS) --crate-type=lib -o $@ \
src/strerror.rs
# bandage solution until bindgen(1) gets stdin support
build/o/libsysexits.rlib: build $(SYSEXITS)sysexits.h
# bandage solution until bindgen(1) gets stdin support
printf '#define EXIT_FAILURE 1\n' | cat - $(SYSEXITS)sysexits.h \
printf '\043define EXIT_FAILURE 1\n' | cat - $(SYSEXITS)sysexits.h \
> build/include/sysexits.h
bindgen --default-macro-constant-type signed --use-core --formatter=none \
build/include/sysexits.h | $(RUSTC) $(RUSTFLAGS) --crate-type lib -o $@ -

10
README
View File

@@ -1,9 +1,11 @@
“Seek not to walk the path of the masters; seek what they sought.”
Matsuo Basho
The Bonsai core utilities are the result of the careful examination of the
current state of POSIX and Unix utilies. The Unix Philosophy, “do one thing and
do it well” is its core but these tools do not cling to the names of the past.
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 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
@@ -38,7 +40,7 @@ To test the utilities:
$ make test
To remove all untracked files:
To remove all build and distributable files:
$ make clean

View File

@@ -4,7 +4,7 @@
.\" 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/>.
.\"
.TH DJ 1 2024-06-17 "Bonsai Core Utilites 0.13.9"
.TH DJ 1 2024-06-17 "Bonsai Core Utilites 0.13.11"
.SH NAME
dj \(en disk jockey
.\"

View File

@@ -4,7 +4,7 @@
.\" 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/>.
.\"
.TH FALSE 1 2024-06-06 "Bonsai Core Utilites 0.13.9"
.TH FALSE 1 2024-06-06 "Bonsai Core Utilites 0.13.11"
.SH NAME
false \(en do nothing, unsuccessfully
.\"

View File

@@ -4,7 +4,7 @@
.\" 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/>.
.\"
.TH FOP 1 2024-06-17 "Bonsai Core Utilites 0.13.9"
.TH FOP 1 2024-06-17 "Bonsai Core Utilites 0.13.11"
.SH NAME
fop \(en field operator
.\"

View File

@@ -3,7 +3,7 @@
.\" 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/>.
.\"
.TH HRU 1 2024-06-17 "Bonsai Core Utilites 0.13.9"
.TH HRU 1 2024-06-17 "Bonsai Core Utilites 0.13.11"
.SH NAME
hru \(en human readable units
.\"

View File

@@ -4,7 +4,7 @@
.\" 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/>.
.\"
.TH INTCMP 1 2024-06-06 "Bonsai Core Utilites 0.13.9"
.TH INTCMP 1 2024-06-06 "Bonsai Core Utilites 0.13.11"
.SH NAME
intcmp \(en compare integers
.\"

View File

@@ -3,7 +3,7 @@
.\" 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/>.
.\"
.TH MM 1 2024-06-17 "Bonsai Core Utilites 0.13.9"
.TH MM 1 2024-06-17 "Bonsai Core Utilites 0.13.11"
.SH NAME
mm \(en middleman
.\"

View File

@@ -4,7 +4,7 @@
.\" 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/>.
.\"
.TH NPC 1 2024-06-17 "Bonsai Core Utilites 0.13.9"
.TH NPC 1 2024-06-17 "Bonsai Core Utilites 0.13.11"
.SH NAME
npc \(en show non-printing characters
.\"

View File

@@ -4,7 +4,7 @@
.\" 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/>.
.\"
.TH RPN 1 2024-06-17 "Bonsai Core Utilites 0.13.9"
.TH RPN 1 2024-06-17 "Bonsai Core Utilites 0.13.11"
.SH NAME
rpn \(en reverse polish notation evaluation
.\"

View File

@@ -4,7 +4,7 @@
.\" 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/>.
.\"
.TH SCRUT 1 2024-06-06 "Bonsai Core Utilites 0.13.9"
.TH SCRUT 1 2024-06-06 "Bonsai Core Utilites 0.13.11"
.SH NAME
scrut \(en scrutinize file properties
.SH SYNOPSIS

View File

@@ -4,7 +4,7 @@
.\" 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/>.
.\"
.TH STR 1 2024-06-17 "Bonsai Core Utilites 0.13.9"
.TH STR 1 2024-06-17 "Bonsai Core Utilites 0.13.11"
.SH NAME
str \(en test string arguments
.\"

View File

@@ -4,7 +4,7 @@
.\" 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/>.
.\"
.TH STRCMP 1 2024-06-17 "Bonsai Core Utilites 0.13.9"
.TH STRCMP 1 2024-06-17 "Bonsai Core Utilites 0.13.11"
.SH NAME
strcmp \(en compare strings
.\"

View File

@@ -4,7 +4,7 @@
.\" 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/>.
.\"
.TH SWAB 1 2024-06-17 "Bonsai Core Utilites 0.13.9"
.TH SWAB 1 2024-06-17 "Bonsai Core Utilites 0.13.11"
.SH NAME
swab \(en swap bytes
.\"

View File

@@ -4,7 +4,7 @@
.\" 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/>.
.\"
.TH TRUE 1 2024-06-06 "Bonsai Core Utilites 0.13.9"
.TH TRUE 1 2024-06-06 "Bonsai Core Utilites 0.13.11"
.SH NAME
true \(en do nothing, successfully
.\"

View File

@@ -32,7 +32,7 @@ use sysexits::{ EX_DATAERR, EX_IOERR, EX_UNAVAILABLE, EX_USAGE };
fn main() {
let argv = args().collect::<Vec<String>>();
let mut d = char::from(0x1E).to_string();
let mut d = '\u{1E}'.to_string();
let mut arg_parser = Parser::new(&argv, "d:");
while let Some(opt) = arg_parser.next() {