mirror of
https://github.com/ohmyzsh/ohmyzsh.git
synced 2026-02-06 02:51:32 +01:00
Replace _tofu completion with official tofu completion command
This commit is contained in:
parent
a289779ecd
commit
9634a024a3
2 changed files with 7 additions and 548 deletions
|
|
@ -1,9 +1,14 @@
|
|||
# set up the tofu completion (compatible for zsh)
|
||||
autoload -Uz bashcompinit && bashcompinit
|
||||
complete -C tofu tofu
|
||||
|
||||
# tofu prompt functions
|
||||
function tofu_prompt_info() {
|
||||
# dont show 'default' workspace in home dir
|
||||
[[ "$PWD" != ~ ]] || return
|
||||
# to keep compatibility with opentofu, the data dir names .terraform in OpenTofu
|
||||
[[ -d .terraform && -r .terraform/environment ]] || return
|
||||
|
||||
|
||||
local workspace="$(< .terraform/environment)"
|
||||
echo "${ZSH_THEME_TOFU_PROMPT_PREFIX-[}${workspace:gs/%/%%}${ZSH_THEME_TOFU_PROMPT_SUFFIX-]}"
|
||||
}
|
||||
|
|
@ -14,7 +19,6 @@ function tofu_version_prompt_info() {
|
|||
echo "${ZSH_THEME_TOFU_VERSION_PROMPT_PREFIX-[}${tofu_version:gs/%/%%}${ZSH_THEME_TOFU_VERSION_PROMPT_SUFFIX-]}"
|
||||
}
|
||||
|
||||
|
||||
alias tt='tofu'
|
||||
alias tta='tofu apply'
|
||||
alias ttc='tofu console'
|
||||
|
|
@ -28,4 +32,4 @@ alias tts='tofu state'
|
|||
alias ttsh='tofu show'
|
||||
alias ttr='tofu refresh'
|
||||
alias ttt='tofu test'
|
||||
alias ttws='tofu workspace'
|
||||
alias ttws='tofu workspace'
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue