From 50aa65617a056a02d88b8f5a269bad1566d5ea8d Mon Sep 17 00:00:00 2001 From: Jordan Bancino Date: Wed, 15 Feb 2023 16:00:36 +0000 Subject: [PATCH] Fix some bugs in the man page index generation. --- tools/bin/man-table | 25 ++++++++++++++----------- tools/bin/td | 1 + 2 files changed, 15 insertions(+), 11 deletions(-) diff --git a/tools/bin/man-table b/tools/bin/man-table index ede9878..ffc0697 100755 --- a/tools/bin/man-table +++ b/tools/bin/man-table @@ -9,21 +9,24 @@ printf "" find man -type f -name '*.[1-9]' | while IFS= read -r file; do base=$(basename "$file") - name=$(echo "$base" | cut -d '.' -f 1) - section=$(echo "$base" | cut -d '.' -f 2) + name=$(echo "$base" | rev | cut -d '.' -f 2- | rev) + section=$(echo "$base" | rev | cut -d '.' -f 1) description=$(grep '^\.Nd' "$file" | cut -d ' ' -f 2-) prefix=$(echo "$name" | cut -d '-' -f 1) - if [ "$prefix" = "telodendria" ]; then - if [ "$1" = "dev" ]; then - continue - fi - else - if [ "$1" = "user" ]; then - continue - fi - fi + case "$prefix" in + "telodendria"*) + if [ "$1" = "dev" ]; then + continue + fi + ;; + *) + if [ "$1" = "user" ]; then + continue + fi + ;; + esac printf "" printf "$name($section)" diff --git a/tools/bin/td b/tools/bin/td index 3f04156..432bfa5 100644 --- a/tools/bin/td +++ b/tools/bin/td @@ -76,6 +76,7 @@ setsubst() { done echo "s|\\\${[a-zA-Z_]*}||g" + echo "s|'''|'|g" ) > "$SED" sed -f "$SED" $@