Add a little more automation for the release

Add an awk script for automatically updating the help
text in README.md
This commit is contained in:
Thayne McCombs
2026-03-07 01:36:27 -07:00
parent ff1f66cceb
commit 160d00f8fe
2 changed files with 45 additions and 1 deletions
+4 -1
View File
@@ -5,6 +5,9 @@ necessary changes for the upcoming release.
## Version bump
This section can be done by running `scripts/version-bump.sh` with the new version
as an argument.
- [ ] Create a new branch for the required changes for this release.
- [ ] Update version in `Cargo.toml`. Run `cargo build` to update `Cargo.lock`.
Make sure to `git add` the `Cargo.lock` changes as well.
@@ -21,7 +24,7 @@ necessary changes for the upcoming release.
new version).
- [ ] Review `-h`, `--help`, and the `man` page.
- [ ] Run `fd -h` and copy the output to the *"Command-line options"* section in
the README
the README. This can be done by running `gawk -i inplace -f scripts/update-help.awk README.md`.
- [ ] Push all changes and wait for CI to succeed (before continuing with the
next section).
- [ ] Optional: manually test the new features and command-line options described
+41
View File
@@ -0,0 +1,41 @@
#!/usr/bin/gawk -f
BEGIN {
inSection = 0
inBlock = 0
}
/Command-line options/ { inSection=1 }
inSection && /^```/ {
inBlock=1
inSection=0
# print the starting fence then move to next line
print
next
}
inBlock && /^```/ {
cmd="cargo run --release --quiet -- -h"
# Output the results of fd -h
u=0
while (cmd | getline line) {
# Skip everything before the usage line
if (line ~ /^Usage/) {
u=1;
}
if (u) {
print line
}
}
status = close(cmd)
if (status) {
print "failed to generate help output" > "/dev/stderr"
exit 1
}
inBlock = 0
}
!inBlock