diff --git a/DOC/AGENT_Context_Project.md b/DOC/AGENT_Context_Project.md index ae3430b..e333b09 100644 --- a/DOC/AGENT_Context_Project.md +++ b/DOC/AGENT_Context_Project.md @@ -689,7 +689,7 @@ Use conventional prefixes: `feat:`, `fix:`, `docs:`, `refactor:`, `chore:` | `bin/pos-bank` | 314 | Persistent command bank for saving and running shell commands | | `bin/pos-config` | 80 | Interactive editor for the tools' runtime config (reads # POS_CONFIG: registry) | | `bin/pos-tree` | 118 | Show the pos CLI command tree: categories, commands, and subcommands | -| `completions/pos.bash` | 318 | Dynamic bash completion | +| `completions/pos.bash` | 331 | Dynamic bash completion | | `apps/install.sh` | 171 | App install/uninstall picker/orchestrator | diff --git a/completions/pos.bash b/completions/pos.bash index ffebfc6..44a2295 100644 --- a/completions/pos.bash +++ b/completions/pos.bash @@ -115,7 +115,14 @@ _pos() { # ── Helpers ──────────────────────────────────────────────── _pos_complete_categories() { - COMPREPLY=($(compgen -W "${!cat_cmds[*]} config" -- "$cur")) + local solos=() + for cmd in "${all_cmds[@]}"; do + local cat_c="${cmd%%-*}" + if [ "$cat_c" = "$cmd" ] && [ -z "${cat_cmds[$cmd]:-}" ]; then + solos+=("$cmd") + fi + done + COMPREPLY=($(compgen -W "${!cat_cmds[*]} ${solos[*]}" -- "$cur")) } _pos_complete_subcats() { @@ -231,7 +238,13 @@ _pos() { 3) case "${words[1]}" in config) _pos_config_scopes ;; - *) _pos_complete_subcats ;; + *) + if [[ "${words[1]}" == *-* ]]; then + _pos_complete_subcats + else + _pos_complete_tool "${words[1]}" + fi + ;; esac ;; 4)