Compare commits

...

10 Commits

Author SHA1 Message Date
Gurkirat Singh e38696a0ac
fix (completion): suppress 1091 in brew (#2130) 2023-02-23 10:38:04 -08:00
OMEGA_RAZER af11a50854
Allow for longer command min duration (#2198)
Allows for setting "COMMAND_DURATION_MIN_SECONDS" to more than 60 seconds without adding to prompt. Previously always showed with lengths over 60 seconds regardless of setting.
2023-02-22 08:24:30 -08:00
Gurkirat Singh 05ef68acbc
Implement yarn completion (#2190)
* feat (completion): add yarn completion
2023-02-22 08:20:45 -08:00
Gurkirat Singh 78f88406cf
Fix lint errors in multiple files (#2192)
* fix (plugins): enable interpretation of backslash escapes in colors
* fix (lint): disable SC2317 in install.sh
* fix (lint): SC2086 in agnoster theme
* fix (lint): remove exit from install.sh as it is already implemented in the calling function
2023-02-22 08:19:12 -08:00
BF feb468b517
bug: Use C style strings when checking for invalid alias characters (#2188)
* Use C style strings when checking for invalid alias characters

Before, the '\n' would be interpreted as 'n' meaning that any alias
who's command contained the letter 'n' would incorrect be skipped.

* No need to escape characters in this context

Escaping was just adding \ to the list multiple times

Co-authored-by: David Farrell <davidpfarrell+github@gmail.com>
2023-01-25 15:56:14 -08:00
Noah Gorny 66ae9b0de8
Remove libra chat reference
We will try to use Github Discussions now.
2022-12-06 00:22:27 +02:00
Noah Gorny 2e52d2a77c
Merge pull request #2109 from tbhaxor/feature/terraform-alias
Add terraform init alias
2022-12-06 00:15:40 +02:00
Noah Gorny 4c2e644db1
Merge pull request #2159 from bittner/patch-3
Add more aliases for `git branch`, use long form
2022-12-05 23:15:13 +02:00
Peter Bittner f0941e9ba2 Add more aliases for `git branch`, use long form
Git can list local branches, remote branches, and both of them together.
Let's use the long form of the options to make the aliases quicker to understand.

As agreed in PR #2159, we introduce gbl and replace gba/gbr by gbla/gblr.
gbl/gbla/gblr allow wildcard arguments for filtering branch names.
2022-12-05 11:01:57 +01:00
Gurkirat Singh 6ba527ff98 feature (alias): add terraform init alias 2022-03-06 11:41:27 +05:30
12 changed files with 1236 additions and 19 deletions

View File

@ -12,10 +12,14 @@ alias gav='git add -v'
# branch # branch
alias gb='git branch' alias gb='git branch'
alias gbD='git branch -D' alias gba='git branch --all'
alias gba='git branch -a'
alias gbd='git branch -d' alias gbd='git branch -d'
alias gbm='git branch -m' alias gbD='git branch -D'
alias gbl='git branch --list'
alias gbla='git branch --list --all'
alias gblr='git branch --list --remotes'
alias gbm='git branch --move'
alias gbr='git branch --remotes'
alias gbt='git branch --track' alias gbt='git branch --track'
alias gdel='git branch -D' alias gdel='git branch -D'

View File

@ -2,6 +2,7 @@
about-alias 'Aliases for Terraform and Terragrunt' about-alias 'Aliases for Terraform and Terragrunt'
alias tf='terraform' alias tf='terraform'
alias tfi='tf init'
alias tfv='terraform validate' alias tfv='terraform validate'
alias tfp='terraform plan' alias tfp='terraform plan'
alias tfa='terraform apply' alias tfa='terraform apply'

View File

@ -76,6 +76,7 @@ completion/available/system.completion.bash
completion/available/vault.completion.bash completion/available/vault.completion.bash
completion/available/vuejs.completion.bash completion/available/vuejs.completion.bash
completion/available/wpscan.completion.bash completion/available/wpscan.completion.bash
completion/available/yarn.completion.bash
# libraries # libraries
lib/appearance.bash lib/appearance.bash

View File

@ -50,7 +50,7 @@ function _bash-it-component-completion-callback-on-init-aliases() {
fi fi
# skip aliases to pipes, boolean control structures and other command lists # skip aliases to pipes, boolean control structures and other command lists
chars='\|\&\;\)\(\n\<\>' chars=$'|&;()<>\n'
if [[ "${alias_defn}" =~ [$chars] ]]; then if [[ "${alias_defn}" =~ [$chars] ]]; then
continue continue
fi fi

View File

@ -14,17 +14,17 @@ fi
_bash_it_homebrew_check || return 0 _bash_it_homebrew_check || return 0
if [[ -r "$BASH_IT_HOMEBREW_PREFIX/etc/bash_completion.d/brew" ]]; then if [[ -r "$BASH_IT_HOMEBREW_PREFIX/etc/bash_completion.d/brew" ]]; then
# shellcheck disable=1090 # shellcheck disable=1090,1091
source "$BASH_IT_HOMEBREW_PREFIX/etc/bash_completion.d/brew" source "$BASH_IT_HOMEBREW_PREFIX/etc/bash_completion.d/brew"
elif [[ -r "$BASH_IT_HOMEBREW_PREFIX/Library/Contributions/brew_bash_completion.sh" ]]; then elif [[ -r "$BASH_IT_HOMEBREW_PREFIX/Library/Contributions/brew_bash_completion.sh" ]]; then
# shellcheck disable=1090 # shellcheck disable=1090,1091
source "$BASH_IT_HOMEBREW_PREFIX/Library/Contributions/brew_bash_completion.sh" source "$BASH_IT_HOMEBREW_PREFIX/Library/Contributions/brew_bash_completion.sh"
elif [[ -f "$BASH_IT_HOMEBREW_PREFIX/completions/bash/brew" ]]; then elif [[ -f "$BASH_IT_HOMEBREW_PREFIX/completions/bash/brew" ]]; then
# For the git-clone based installation, see here for more info: # For the git-clone based installation, see here for more info:
# https://github.com/Bash-it/bash-it/issues/1458 # https://github.com/Bash-it/bash-it/issues/1458
# https://docs.brew.sh/Shell-Completion # https://docs.brew.sh/Shell-Completion
# shellcheck disable=1090 # shellcheck disable=1090,1091
source "$BASH_IT_HOMEBREW_PREFIX/completions/bash/brew" source "$BASH_IT_HOMEBREW_PREFIX/completions/bash/brew"
fi fi

View File

@ -0,0 +1,5 @@
# shellcheck shell=bash
about-completion "yarn cli completions"
# shellcheck disable=SC1090 source=../../vendor/github.com/dsifford/yarn-completion/yarn
source "${BASH_IT}/vendor/github.com/dsifford/yarn-completion/yarn"

View File

@ -4,7 +4,6 @@
![Docs Status](https://readthedocs.org/projects/bash-it/badge/) ![Docs Status](https://readthedocs.org/projects/bash-it/badge/)
![License](https://img.shields.io/github/license/Bash-it/bash-it) ![License](https://img.shields.io/github/license/Bash-it/bash-it)
![shell](https://img.shields.io/badge/Shell-Bash-blue) ![shell](https://img.shields.io/badge/Shell-Bash-blue)
[![Join the chat at https://web.libera.chat/?channel=#bash-it](https://img.shields.io/badge/chat-on%20Libera.Chat-brightgreen.svg)](https://web.libera.chat/?channel=#bash-it)
**Bash-it** is a collection of community Bash commands and scripts for Bash 3.2+. **Bash-it** is a collection of community Bash commands and scripts for Bash 3.2+.
(And a shameless ripoff of [oh-my-zsh](https://github.com/robbyrussell/oh-my-zsh) :smiley:) (And a shameless ripoff of [oh-my-zsh](https://github.com/robbyrussell/oh-my-zsh) :smiley:)

View File

@ -12,7 +12,6 @@ function _bash-it_show_usage() {
echo "--no-modify-config (-n): Do not modify existing config file" echo "--no-modify-config (-n): Do not modify existing config file"
echo "--append-to-config (-a): Keep existing config file and append bash-it templates at the end" echo "--append-to-config (-a): Keep existing config file and append bash-it templates at the end"
echo "--overwrite-backup (-f): Overwrite existing backup" echo "--overwrite-backup (-f): Overwrite existing backup"
exit 0
} }
# enable a thing # enable a thing

View File

@ -59,17 +59,17 @@ function _command_duration() {
command_duration=0 command_duration=0
fi fi
if ((command_duration > 0)); then if ((command_duration >= COMMAND_DURATION_MIN_SECONDS)); then
minutes=$((command_duration / 60)) minutes=$((command_duration / 60))
seconds=$((command_duration % 60)) seconds=$((command_duration % 60))
fi
_dynamic_clock_icon "${command_duration}" _dynamic_clock_icon "${command_duration}"
if ((minutes > 0)); then if ((minutes > 0)); then
printf "%s %s%dm %ds" "${COMMAND_DURATION_ICON:-}" "${COMMAND_DURATION_COLOR:-}" "$minutes" "$seconds" printf "%s %s%dm %ds" "${COMMAND_DURATION_ICON:-}" "${COMMAND_DURATION_COLOR:-}" "$minutes" "$seconds"
elif ((seconds >= COMMAND_DURATION_MIN_SECONDS)); then else
printf "%s %s%d.%01ds" "${COMMAND_DURATION_ICON:-}" "${COMMAND_DURATION_COLOR:-}" "$seconds" "$deciseconds" printf "%s %s%d.%01ds" "${COMMAND_DURATION_ICON:-}" "${COMMAND_DURATION_COLOR:-}" "$seconds" "$deciseconds"
fi fi
fi
} }
_bash_it_library_finalize_hook+=("safe_append_preexec '_command_duration_pre_exec'") _bash_it_library_finalize_hook+=("safe_append_preexec '_command_duration_pre_exec'")

View File

@ -8,13 +8,13 @@ function __() {
function __make_ansi() { function __make_ansi() {
next=$1 next=$1
shift shift
echo "\[\e[$("__$next" "$@")m\]" echo -e "\[\e[$("__$next" "$@")m\]"
} }
function __make_echo() { function __make_echo() {
next=$1 next=$1
shift shift
echo "\033[$("__$next" "$@")m" echo -e "\033[$("__$next" "$@")m"
} }
function __reset() { function __reset() {

View File

@ -182,7 +182,7 @@ prompt_segment() {
# declare -p codes # declare -p codes
if [[ $CURRENT_BG != NONE && $1 != "$CURRENT_BG" ]]; then if [[ $CURRENT_BG != NONE && $1 != "$CURRENT_BG" ]]; then
declare -a intermediate=("$(fg_color $CURRENT_BG)" "$(bg_color "$1")") declare -a intermediate=("$(fg_color "$CURRENT_BG")" "$(bg_color "$1")")
debug "pre prompt " "$(ansi intermediate[@])" debug "pre prompt " "$(ansi intermediate[@])"
PR="$PR $(ansi intermediate[@])$SEGMENT_SEPARATOR" PR="$PR $(ansi intermediate[@])$SEGMENT_SEPARATOR"
debug "post prompt " "$(ansi codes[@])" debug "post prompt " "$(ansi codes[@])"

1208
vendor/github.com/dsifford/yarn-completion/yarn generated vendored 100644

File diff suppressed because it is too large Load Diff