fix: show Command Bank in main pos menu; fix pos bank run crash
gates / consistency-and-conventions (push) Successful in 27s
gates / consistency-and-conventions (push) Successful in 27s
- bin/pos: _pos_category_list now emits category-less tools (pos-bank, pos-config, pos-tree) as sorted menu entries with an empty subcommand column, deduped against real categories (pos-ai). bank previously never appeared in the bare 'pos' menu. - bin/pos-bank: fixed invalid 'local name="" -a cli_params=()' at cmd_run (line 150) — bash rejected '-a' after an assignment, crashing every 'pos bank run' with 'local: -a: not a valid identifier'. Split into 'local name=""' + 'local -a cli_params=()'. - tests/t-bank.sh: added B12-B14 covering cmd_run (no-params, missing-command, param substitution) — would have caught the crash. - AGENT_TODO.md: bank feature moved to Done.
This commit is contained in:
@@ -28,6 +28,9 @@ _pos_commands() {
|
||||
# ── Category list (sorted, filename-derived) ─────────────────────
|
||||
# Nested sub-tools (pos-<cat>-<a>-<b> where pos-<cat>-<a> exists) are
|
||||
# omitted from the cheat-sheet line — they are shown under their parent tool.
|
||||
# Category-less tools (pos-bank, pos-config, pos-tree) are emitted as their
|
||||
# own line with an empty subcommand column; a name already present as a
|
||||
# category (pos-ai vs the ai category built from pos-ai-*) is NOT duplicated.
|
||||
_pos_category_list() {
|
||||
local -A cats=()
|
||||
local cmd cat f
|
||||
@@ -35,7 +38,10 @@ _pos_category_list() {
|
||||
[ -x "$f" ] || continue
|
||||
cmd="${f##*/pos-}"
|
||||
cat="${cmd%%-*}"
|
||||
[ "$cat" = "$cmd" ] && continue
|
||||
if [ "$cat" = "$cmd" ]; then
|
||||
cats["$cmd"]="${cats[$cmd]:-}"
|
||||
continue
|
||||
fi
|
||||
cats["$cat"]+="${cmd#*-} "
|
||||
done
|
||||
local c subs joined s s2 top=() is_nested
|
||||
@@ -208,6 +214,8 @@ EXAMPLES
|
||||
|
||||
pos tree Show the command tree (categories + subcommands)
|
||||
|
||||
pos bank run <name> Run a saved command from the bank
|
||||
|
||||
pos docker vbox create lab1 Create disposable Docker VM
|
||||
pos docker vbox create lab1 --dir . Create VM using current directory
|
||||
pos docker vbox enter lab1 Shell into a Docker VM
|
||||
|
||||
Reference in New Issue
Block a user