fix: pos tree truncated when a category's last tool has no subcommands

This commit is contained in:
Your Name
2026-08-09 18:41:26 +00:00
parent c0693b0093
commit 6e437cace8
2 changed files with 4 additions and 2 deletions
+3 -1
View File
@@ -97,7 +97,9 @@ render() {
;;
tool)
printf '%s%s%-*s# %s\n' "$prefix" "$conn" "$((maxw+1))" "pos ${path//\// }" "$desc"
[ -n "${children[$path]:-}" ] && render "$path" "$nextpref" $((lvl+1))
if [ -n "${children[$path]:-}" ]; then
render "$path" "$nextpref" $((lvl+1))
fi
;;
sub)
printf '%s%s%s\n' "$prefix" "$conn" "pos ${path//\// }"