Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion bash_it.sh
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ BASH_IT_LOG_PREFIX="core: main: "
: "${BASH_IT:=${BASH_SOURCE%/*}}"
: "${BASH_IT_CUSTOM:=${BASH_IT}/custom}"
: "${CUSTOM_THEME_DIR:="${BASH_IT_CUSTOM}/themes"}"
: "${BASH_IT_BASHRC:=${BASH_SOURCE[${#BASH_SOURCE[@]} - 1]}}"
: "${BASH_IT_BASHRC:=${BASH_SOURCE[${#BASH_SOURCE[@]}-1]}}"

# Load composure first, so we support function metadata
# shellcheck source-path=SCRIPTDIR/vendor/github.com/erichs/composure
Expand Down
2 changes: 1 addition & 1 deletion completion/available/bash-it.completion.bash
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ function _bash-it() {
local cur prev verb file_type candidates suffix
COMPREPLY=()
cur="${COMP_WORDS[COMP_CWORD]}"
prev="${COMP_WORDS[COMP_CWORD - 1]}"
prev="${COMP_WORDS[COMP_CWORD-1]}"
verb="${COMP_WORDS[1]}"
file_type="${COMP_WORDS[2]:-}"
candidates=('disable' 'enable' 'help' 'migrate' 'reload' 'restart' 'preview' 'profile' 'doctor' 'search' 'show' 'update' 'version')
Expand Down
2 changes: 1 addition & 1 deletion completion/available/dmidecode.completion.bash
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ _bash-it-completion-helper-necessary dmidecode || :
_bash-it-completion-helper-sufficient dmidecode || return

function _dmidecode() {
local prev="${COMP_WORDS[COMP_CWORD - 1]}"
local prev="${COMP_WORDS[COMP_CWORD-1]}"

case $prev in
-s | --string | -t | --type)
Expand Down
2 changes: 1 addition & 1 deletion completion/available/docker-compose.completion.bash
Original file line number Diff line number Diff line change
Expand Up @@ -85,7 +85,7 @@ __docker_compose_map_key_of_current_option() {
key=${cur%=*}
glob_pos=$((cword - 1))
elif [ "$prev" = "=" ]; then
key=${words[$cword - 2]} # key=value case
key=${words[$cword-2]} # key=value case
glob_pos=$((cword - 3))
else
return
Expand Down
2 changes: 1 addition & 1 deletion completion/available/gem.completion.bash
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ url "https://rubygems.org/"

__gem_completion() {
local cur=${COMP_WORDS[COMP_CWORD]}
local prev=${COMP_WORDS[COMP_CWORD - 1]}
local prev=${COMP_WORDS[COMP_CWORD-1]}
case $prev in
install)
# list the remote gems and add to completion
Expand Down
2 changes: 1 addition & 1 deletion completion/available/notify-send.completion.bash
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ _bash-it-completion-helper-necessary notify-send || :
_bash-it-completion-helper-sufficient notify-send || return

function _notify-send() {
local prev="${COMP_WORDS[COMP_CWORD - 1]}"
local prev="${COMP_WORDS[COMP_CWORD-1]}"

case $prev in
-u | --urgency)
Expand Down
20 changes: 10 additions & 10 deletions completion/available/salt.completion.bash
Original file line number Diff line number Diff line change
Expand Up @@ -49,12 +49,12 @@ _salt() {
local cur prev opts _salt_grains _salt_coms pprev ppprev
COMPREPLY=()
cur="${COMP_WORDS[COMP_CWORD]}"
prev="${COMP_WORDS[COMP_CWORD - 1]}"
prev="${COMP_WORDS[COMP_CWORD-1]}"
if [ "${COMP_CWORD}" -gt 2 ]; then
pprev="${COMP_WORDS[COMP_CWORD - 2]}"
pprev="${COMP_WORDS[COMP_CWORD-2]}"
fi
if [ "${COMP_CWORD}" -gt 3 ]; then
ppprev="${COMP_WORDS[COMP_CWORD - 3]}"
ppprev="${COMP_WORDS[COMP_CWORD-3]}"
fi

opts="-h --help -d --doc --documentation --version --versions-report -c \
Expand Down Expand Up @@ -145,7 +145,7 @@ _saltkey() {
local cur prev opts prev pprev
COMPREPLY=()
cur="${COMP_WORDS[COMP_CWORD]}"
prev="${COMP_WORDS[COMP_CWORD - 1]}"
prev="${COMP_WORDS[COMP_CWORD-1]}"
opts="-c --config-dir= -h --help --version --versions-report -q --quiet \
-y --yes --gen-keys= --gen-keys-dir= --keysize= --key-logfile= \
-l --list= -L --list-all -a --accept= -A --accept-all \
Expand All @@ -154,10 +154,10 @@ _saltkey() {
--out=pprint --out=yaml --out=overstatestage --out=json --out=raw \
--out=highstate --out=key --out=txt --no-color --out-indent= "
if [ "${COMP_CWORD}" -gt 2 ]; then
pprev="${COMP_WORDS[COMP_CWORD - 2]}"
pprev="${COMP_WORDS[COMP_CWORD-2]}"
fi
if [ "${COMP_CWORD}" -gt 3 ]; then
ppprev="${COMP_WORDS[COMP_CWORD - 3]}"
ppprev="${COMP_WORDS[COMP_CWORD-3]}"
fi
if [[ "${cur}" == -* ]]; then
COMPREPLY=($(compgen -W "${opts}" -- "${cur}"))
Expand Down Expand Up @@ -232,16 +232,16 @@ _saltcall() {
local cur prev opts _salt_coms pprev ppprev
COMPREPLY=()
cur="${COMP_WORDS[COMP_CWORD]}"
prev="${COMP_WORDS[COMP_CWORD - 1]}"
prev="${COMP_WORDS[COMP_CWORD-1]}"
opts="-h --help -d --doc --documentation --version --versions-report \
-m --module-dirs= -g --grains --return= --local -c --config-dir= -l --log-level= \
--out=pprint --out=yaml --out=overstatestage --out=json --out=raw \
--out=highstate --out=key --out=txt --no-color --out-indent= "
if [ "${COMP_CWORD}" -gt 2 ]; then
pprev="${COMP_WORDS[COMP_CWORD - 2]}"
pprev="${COMP_WORDS[COMP_CWORD-2]}"
fi
if [ "${COMP_CWORD}" -gt 3 ]; then
ppprev="${COMP_WORDS[COMP_CWORD - 3]}"
ppprev="${COMP_WORDS[COMP_CWORD-3]}"
fi
if [[ "${cur}" == -* ]]; then
COMPREPLY=($(compgen -W "${opts}" -- "${cur}"))
Expand Down Expand Up @@ -284,7 +284,7 @@ _saltcp() {
local cur prev opts prefpart helper filt pprev ppprev
COMPREPLY=()
cur="${COMP_WORDS[COMP_CWORD]}"
prev="${COMP_WORDS[COMP_CWORD - 1]}"
prev="${COMP_WORDS[COMP_CWORD-1]}"
opts="-t --timeout= -s --static -b --batch= --batch-size= \
-h --help --version --versions-report -c --config-dir= \
-E --pcre -L --list -G --grain --grain-pcre -N --nodegroup \
Expand Down
8 changes: 4 additions & 4 deletions completion/available/sdkman.completion.bash
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ function _sdkman_complete() {
if [ "$COMP_CWORD" -eq 1 ]; then
while IFS='' read -r line; do COMPREPLY+=("$line"); done < <(compgen -W "install uninstall rm list ls use default home env current upgrade ug version broadcast help offline selfupdate update flush" -- "${COMP_WORDS[COMP_CWORD]}")
elif [ "$COMP_CWORD" -eq 2 ]; then
case "${COMP_WORDS[COMP_CWORD - 1]}" in
case "${COMP_WORDS[COMP_CWORD-1]}" in
"install" | "i" | "uninstall" | "rm" | "list" | "ls" | "use" | "u" | "default" | "d" | "home" | "h" | "current" | "c" | "upgrade" | "ug")
CANDIDATES="${SDKMAN_CANDIDATES_CSV//,/${IFS:0:1}}"
while IFS='' read -r line; do COMPREPLY+=("$line"); done < <(compgen -W "$CANDIDATES" -- "${COMP_WORDS[COMP_CWORD]}")
Expand All @@ -32,13 +32,13 @@ function _sdkman_complete() {

esac
elif [ "$COMP_CWORD" -eq 3 ]; then
case "${COMP_WORDS[COMP_CWORD - 2]}" in
case "${COMP_WORDS[COMP_CWORD-2]}" in
"uninstall" | "rm" | "use" | "u" | "default" | "d" | "home" | "h")
_sdkman_candidate_local_versions "${COMP_WORDS[COMP_CWORD - 1]}"
_sdkman_candidate_local_versions "${COMP_WORDS[COMP_CWORD-1]}"
while IFS='' read -r line; do COMPREPLY+=("$line"); done < <(compgen -W "$CANDIDATE_VERSIONS" -- "${COMP_WORDS[COMP_CWORD]}")
;;
"install" | "i")
_sdkman_candidate_all_versions "${COMP_WORDS[COMP_CWORD - 1]}"
_sdkman_candidate_all_versions "${COMP_WORDS[COMP_CWORD-1]}"
while IFS='' read -r line; do COMPREPLY+=("$line"); done < <(compgen -W "$CANDIDATE_VERSIONS" -- "${COMP_WORDS[COMP_CWORD]}")
;;
*) ;;
Expand Down
2 changes: 1 addition & 1 deletion completion/available/test_kitchen.completion.bash
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ __kitchen_instance_list() {

__kitchen_options() {
cur="${COMP_WORDS[COMP_CWORD]}"
prev="${COMP_WORDS[COMP_CWORD - 1]}"
prev="${COMP_WORDS[COMP_CWORD-1]}"
COMPREPLY=()

case $prev in
Expand Down
2 changes: 1 addition & 1 deletion completion/available/tmux.completion.bash
Original file line number Diff line number Diff line change
Expand Up @@ -66,7 +66,7 @@ _tmux() {
local i cmd cmd_index option option_index
COMPREPLY=()
cur="${COMP_WORDS[COMP_CWORD]}"
prev="${COMP_WORDS[COMP_CWORD - 1]}"
prev="${COMP_WORDS[COMP_CWORD-1]}"

if [[ "${prev}" == -f ]]; then
_tmux_filedir
Expand Down
8 changes: 4 additions & 4 deletions completion/available/vagrant.completion.bash
Original file line number Diff line number Diff line change
Expand Up @@ -56,7 +56,7 @@ __vagrantinvestigate() {

_vagrant() {
cur="${COMP_WORDS[COMP_CWORD]}"
prev="${COMP_WORDS[COMP_CWORD - 1]}"
prev="${COMP_WORDS[COMP_CWORD-1]}"
commands="box cloud destroy global-status halt help hostmanager init login package plugin port powershell provision push rdp reload resume scp snapshot ssh ssh-config status suspend up upload validate vbguest version winrm winrm-config"

if ((COMP_CWORD == 1)); then
Expand Down Expand Up @@ -123,7 +123,7 @@ _vagrant() {
fi

if ((COMP_CWORD == 3)); then
action="${COMP_WORDS[COMP_CWORD - 2]}"
action="${COMP_WORDS[COMP_CWORD-2]}"
case "$action" in
"up")
if [ "$prev" == "--no-provision" ]; then
Expand Down Expand Up @@ -155,8 +155,8 @@ _vagrant() {
fi

if ((COMP_CWORD == 4)); then
action="${COMP_WORDS[COMP_CWORD - 3]}"
prev="${COMP_WORDS[COMP_CWORD - 2]}"
action="${COMP_WORDS[COMP_CWORD-3]}"
prev="${COMP_WORDS[COMP_CWORD-2]}"
case "$action" in
"snapshot")
if [ "$prev" == "restore" ]; then
Expand Down
4 changes: 2 additions & 2 deletions completion/available/virtualbox.completion.bash
Original file line number Diff line number Diff line change
Expand Up @@ -155,7 +155,7 @@ _vboxmanage() {
local cur opts
COMPREPLY=()
cur="${COMP_WORDS[COMP_CWORD]}"
prev="${COMP_WORDS[COMP_CWORD - 1]}"
prev="${COMP_WORDS[COMP_CWORD-1]}"

# echo "cur: |$cur|"
# echo "prev: |$prev|"
Expand Down Expand Up @@ -206,7 +206,7 @@ _vboxmanage() {

for VM in $(__vboxmanage_list_vms); do
if [ "$VM" == "$prev" ]; then
pprev=${COMP_WORDS[COMP_CWORD - 2]}
pprev=${COMP_WORDS[COMP_CWORD-2]}
# echo "previous: $pprev"
case $pprev in
startvm)
Expand Down
2 changes: 1 addition & 1 deletion completion/available/vuejs.completion.bash
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ _bash-it-completion-helper-necessary vue || :
_bash-it-completion-helper-sufficient vue || return

function _vuejs() {
local prev="${COMP_WORDS[COMP_CWORD - 1]}"
local prev="${COMP_WORDS[COMP_CWORD-1]}"

case $prev in
create)
Expand Down
2 changes: 1 addition & 1 deletion plugins/available/aws.plugin.bash
Original file line number Diff line number Diff line change
Expand Up @@ -99,7 +99,7 @@ function __awskeys_comp {
local cur prev opts
COMPREPLY=()
cur="${COMP_WORDS[COMP_CWORD]}"
prev="${COMP_WORDS[COMP_CWORD - 1]}"
prev="${COMP_WORDS[COMP_CWORD-1]}"

opts="help list show export unset"

Expand Down
2 changes: 1 addition & 1 deletion plugins/available/z_autoenv.plugin.bash
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ autoenv_init() {
_file=${#_files[@]}
while ((_file > 0)); do
#shellcheck disable=SC1090
source "${_files[_file - __array_offset]}"
source "${_files[_file-__array_offset]}"
: $((_file -= 1))
done
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -54,11 +54,11 @@ function randomize_nwinkler {
#$underline_orange
#)

USERNAME_COLOR=${AVAILABLE_COLORS[$RANDOM % ${#AVAILABLE_COLORS[@]}]}
HOSTNAME_COLOR=${AVAILABLE_COLORS[$RANDOM % ${#AVAILABLE_COLORS[@]}]}
TIME_COLOR=${AVAILABLE_COLORS[$RANDOM % ${#AVAILABLE_COLORS[@]}]}
USERNAME_COLOR=${AVAILABLE_COLORS[$RANDOM%${#AVAILABLE_COLORS[@]}]}
HOSTNAME_COLOR=${AVAILABLE_COLORS[$RANDOM%${#AVAILABLE_COLORS[@]}]}
TIME_COLOR=${AVAILABLE_COLORS[$RANDOM%${#AVAILABLE_COLORS[@]}]}
THEME_CLOCK_COLOR=$TIME_COLOR
PATH_COLOR=${AVAILABLE_COLORS[$RANDOM % ${#AVAILABLE_COLORS[@]}]}
PATH_COLOR=${AVAILABLE_COLORS[$RANDOM%${#AVAILABLE_COLORS[@]}]}

echo "$USERNAME_COLOR,$HOSTNAME_COLOR,$TIME_COLOR,$PATH_COLOR," > "$RANDOM_COLOR_FILE"
}
Expand Down
Loading