1
0
mirror of https://github.com/ohmyzsh/ohmyzsh.git synced 2026-02-13 05:59:46 +08:00

Compare commits

...

2 Commits

Author SHA1 Message Date
mnv
00b9b62385
refactor(bzr): simplify and improve code (#12716) 2024-10-02 15:30:32 +02:00
za
dae5a41159
feat(opentofu): add apply -auto-approve alias (#12714) 2024-10-02 10:49:31 +02:00
3 changed files with 31 additions and 25 deletions

View File

@ -1,10 +1,14 @@
## Bazaar integration
## Just works with the GIT integration just add $(bzr_prompt_info) to the PROMPT
## Just works with the GIT integration. Add $(bzr_prompt_info) to the PROMPT
function bzr_prompt_info() {
BZR_CB=`bzr nick 2> /dev/null | grep -v "ERROR" | cut -d ":" -f2 | awk -F / '{print "bzr::"$1}'`
if [ -n "$BZR_CB" ]; then
BZR_DIRTY=""
[[ -n `bzr status` ]] && BZR_DIRTY=" %{$fg[red]%} * %{$fg[green]%}"
echo "$ZSH_THEME_SCM_PROMPT_PREFIX$BZR_CB$BZR_DIRTY$ZSH_THEME_GIT_PROMPT_SUFFIX"
fi
local bzr_branch
bzr_branch=$(bzr nick 2>/dev/null) || return
if [[ -n "$bzr_branch" ]]; then
local bzr_dirty=""
if [[ -n $(bzr status 2>/dev/null) ]]; then
bzr_dirty=" %{$fg[red]%}*%{$reset_color%}"
fi
printf "%s%s%s%s" "$ZSH_THEME_SCM_PROMPT_PREFIX" "bzr::${bzr_branch##*:}" "$bzr_dirty" "$ZSH_THEME_GIT_PROMPT_SUFFIX"
fi
}

View File

@ -15,23 +15,24 @@ plugins=(... opentofu)
## Aliases
| Alias | Command |
|--------|-----------------------|
| `tt` | `tofu` |
| `tta` | `tofu apply` |
| `ttc` | `tofu console` |
| `ttd` | `tofu destroy` |
| `ttf` | `tofu fmt` |
| `ttfr` | `tofu fmt -recursive` |
| `tti` | `tofu init` |
| `tto` | `tofu output` |
| `ttp` | `tofu plan` |
| `ttv` | `tofu validate` |
| `tts` | `tofu state` |
| `ttsh` | `tofu show` |
| `ttr` | `tofu refresh` |
| `ttt` | `tofu test` |
| `ttws` | `tofu workspace` |
| Alias | Command |
|--------|------------------------------|
| `tt` | `tofu` |
| `tta` | `tofu apply` |
| `ttaa` | `tofu apply -auto-approve` |
| `ttc` | `tofu console` |
| `ttd` | `tofu destroy` |
| `ttf` | `tofu fmt` |
| `ttfr` | `tofu fmt -recursive` |
| `tti` | `tofu init` |
| `tto` | `tofu output` |
| `ttp` | `tofu plan` |
| `ttv` | `tofu validate` |
| `tts` | `tofu state` |
| `ttsh` | `tofu show` |
| `ttr` | `tofu refresh` |
| `ttt` | `tofu test` |
| `ttws` | `tofu workspace` |
## Prompt functions

View File

@ -29,6 +29,7 @@ function tofu_version_prompt_info() {
alias tt='tofu'
alias tta='tofu apply'
alias ttaa='tofu apply -auto-approve'
alias ttc='tofu console'
alias ttd='tofu destroy'
alias ttf='tofu fmt'