slit 0.0.2

Mashup of cut and awk with fewer features but easier to use
.DEFAULT_GOAL := build

binname ?= $(shell tq -o json Cargo.toml | jq -r '.package.name')

.PHONY: build
build: target/doc
	cargo build

.PHONY: install
install: target/release/$(binname)
	sudo install -D $< /usr/local/bin/$(binname)

.PHONY: test
test:
	cargo test -- --nocapture

target/release/$(binname): src/** Cargo.*
	cargo build --release

target/doc: Cargo.*
	cargo doc

README.md: Cargo.* src/**
	truncate -s 0 $@
	echo -e "# $(binname)\n" >> $@
	echo -e '```' >> $@
	cargo run -- --help >> $@
	echo -e '```\n' >> README.md

.PHONY: lint
lint:
	cargo +nightly clippy -- -Wclippy::pedantic