#!/usr/bin/env sh
printf "
"
printf ""
printf "Man Page | "
printf "Description | "
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)
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
printf ""
printf "$name($section) | "
printf "$description | "
printf "
"
done
printf "
"