feat(terraform): add flag auto-completion for subcommand aliases#769
feat(terraform): add flag auto-completion for subcommand aliases#769senderic wants to merge 2 commits into
Conversation
Implement auto-completion support for terraform aliases (`t`, `tapply`, `tplan`, `tinit`, `tfmt`). - Since the terraform CLI binary (`complete -C`) does not support flag completion out of the box, intercept completions starting with `-` to provide static suggestions for common flags of the relevant subcommand. - Fallback to delegating completions to the registered terraform specification, carefully translating context arguments (shifting `cur`/`prev`), parsing quoted complete paths, and properly restoring shell completion environments.
PR Summary by QodoAdd flag completion for terraform alias subcommands
AI Description
Diagram
High-Level Assessment
Files changed (1)
|
Code Review by Qodo
1.
|
Address review feedback for the terraform alias completion function: - Add an early guard to return 1 when COMP_CWORD is 0, preventing pointing at the wrong expanded word during command token completion. - Verify the existence of the delegated completion function (real_func) using [_omb_util_function_exists](cci:1://file:///home/g56147/.oh-my-bash/lib/utils.sh:118:0-120:1) before executing it. - Remove the unused local variable `prev` to clean up dead code.
Implement auto-completion support for terraform aliases (
t,tapply,tplan,tinit,tfmt).complete -C) does not support flag completion out of the box, intercept completions starting with-to provide static suggestions for common flags of the relevant subcommand.cur/prev), parsing quoted complete paths, and properly restoring shell completion environments.