-
Notifications
You must be signed in to change notification settings - Fork 2.3k
completions: clear and consistent log messages #2063
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Merged
seefood
merged 12 commits into
Bash-it:master
from
gaelicWizard:lib/completion/components
Aug 24, 2025
+353
−186
Merged
Changes from all commits
Commits
Show all changes
12 commits
Select commit
Hold shift + click to select a range
7677401
lib/completion
gaelicWizard cb963c5
lib/completion: `_bash-it-completion-helper-necessary()` et al
gaelicWizard d74a5bd
completions: add to `clean_files.txt`
gaelicWizard 371190b
completions: `shellcheck`
gaelicWizard 74eee45
completions: clear and consistent log messages
gaelicWizard ba71005
completion/dmidecode: `shellcheck`
gaelicWizard f83526b
completion/notify-send: `shellcheck`
gaelicWizard 69d9d2b
completion/vuejs: `shellcheck`
gaelicWizard 2528592
completion/export
gaelicWizard 1c2b0bc
completion/dirs
gaelicWizard d5cbbcf
Merge branch 'master' into lib/completion/components
seefood 0c792ef
Merge branch 'master' into lib/completion/components
seefood File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -1,4 +1,4 @@ | ||
| # shellcheck shell=bash | ||
| about-completion "apm completion" | ||
| # shellcheck disable=SC1090 | ||
| source "${BASH_IT}"/vendor/github.com/vigo/apm-bash-completion/apm | ||
| # shellcheck source-path=SCRIPTDIR/../../vendor/github.com/vigo/apm-bash-completion | ||
| source "${BASH_IT?}/vendor/github.com/vigo/apm-bash-completion/apm" |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -1,5 +1,10 @@ | ||
| # shellcheck shell=bash | ||
| if _command_exists awless; then | ||
| # shellcheck disable=SC1090 | ||
| source <(awless completion bash) | ||
| fi | ||
|
|
||
| # Make sure awless is installed | ||
| _bash-it-completion-helper-necessary awless || return | ||
|
|
||
| # Don't handle completion if it's already managed | ||
| _bash-it-completion-helper-sufficient awless || return | ||
|
|
||
| # shellcheck disable=SC1090 | ||
| source <(awless completion bash) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -1,5 +1,9 @@ | ||
| # shellcheck shell=bash | ||
|
|
||
| if _command_exists aws_completer; then | ||
| complete -C "$(command -v aws_completer)" aws | ||
| fi | ||
| # Make sure aws is installed | ||
| _bash-it-completion-helper-necessary aws aws_completer || return | ||
|
|
||
| # Don't handle completion if it's already managed | ||
| _bash-it-completion-helper-sufficient aws || return | ||
|
|
||
| complete -C aws_completer aws |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -1,6 +1,10 @@ | ||
| # shellcheck shell=bash | ||
| # cargo (Rust package manager) completion | ||
| about-completion "cargo (Rust package manager) completion" | ||
|
|
||
| if _binary_exists rustup && _binary_exists cargo; then | ||
| eval "$(rustup completions bash cargo)" | ||
| fi | ||
| # Make sure cargo is installed | ||
| _bash-it-completion-helper-necessary rustup cargo || return | ||
|
|
||
| # Don't handle completion if it's already managed | ||
| _bash-it-completion-helper-sufficient cargo || return | ||
|
|
||
| eval "$(rustup completions bash cargo)" |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -1,7 +1,10 @@ | ||
| # shellcheck shell=bash | ||
| cite "about-completion" | ||
| about-completion "Hashicorp consul completion" | ||
|
|
||
| if _command_exists consul; then | ||
| complete -C "$(command -v consul)" consul | ||
| fi | ||
| # Make sure consul is installed | ||
| _bash-it-completion-helper-necessary consul || return | ||
|
|
||
| # Don't handle completion if it's already managed | ||
| _bash-it-completion-helper-sufficient consul || return | ||
|
|
||
| complete -C consul consul |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -1,2 +1,4 @@ | ||
| # shellcheck shell=bash | ||
| _log_warning 'Bash completion for "crystal" is now covered by "system". This completion can be disabled.' | ||
|
|
||
| _log_warning 'Bash completion for "crystal" is now covered by "system".' | ||
| _disable-completion "crystal" |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -1,6 +1,7 @@ | ||
| # shellcheck shell=bash | ||
| # shellcheck disable=SC1090 | ||
|
|
||
| if test -s "${BASH_IT?}/vendor/github.com/gaelicWizard/bash-progcomp/defaults.completion.bash"; then | ||
| source "$_" | ||
| if [[ -s "${BASH_IT?}/vendor/github.com/gaelicWizard/bash-progcomp/defaults.completion.bash" ]]; then | ||
| # shellcheck source-path=SCRIPTDIR/../../vendor/github.com/gaelicWizard/bash-progcomp | ||
| source "${BASH_IT?}/vendor/github.com/gaelicWizard/bash-progcomp/defaults.completion.bash" | ||
| fi |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -1,16 +1,13 @@ | ||
| # shellcheck shell=bash | ||
| # Bash completion support for the 'dirs' plugin (commands G, R). | ||
| about-completion "Bash completion support for the 'dirs' plugin (commands G, R)." | ||
|
|
||
| _dirs-complete() { | ||
| local CURRENT_PROMPT="${COMP_WORDS[COMP_CWORD]}" | ||
|
|
||
| # parse all defined shortcuts from ~/.dirs | ||
| if [ -r "$HOME/.dirs" ]; then | ||
| # shellcheck disable=SC2207 | ||
| COMPREPLY=($(compgen -W "$(grep -v '^#' ~/.dirs | sed -e 's/\(.*\)=.*/\1/')" -- "${CURRENT_PROMPT}")) | ||
| function _dirs-complete() { | ||
| # parse all defined shortcuts ${BASH_IT_DIRS_BKS} | ||
| if [[ -s "${BASH_IT_DIRS_BKS:-/dev/null}" ]]; then | ||
| IFS=$'\n' read -d '' -ra COMPREPLY < <(grep -v '^#' "${BASH_IT_DIRS_BKS?}" | sed -e 's/\(.*\)=.*/\1/') | ||
| fi | ||
|
|
||
| return 0 | ||
| } | ||
|
|
||
| complete -o default -o nospace -F _dirs-complete G R | ||
| complete -o default -o nospace -F _dirs-complete -X '!&*' G R |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -1,22 +1,25 @@ | ||
| # shellcheck shell=bash | ||
|
|
||
| function __dmidecode_completion() { | ||
| # shellcheck disable=SC2155 | ||
| local prev=$(_get_pword) | ||
| # shellcheck disable=SC2155 | ||
| local curr=$(_get_cword) | ||
| # Make sure dmidecode is installed | ||
| _bash-it-completion-helper-necessary dmidecode || : | ||
|
|
||
| # Don't handle completion if it's already managed | ||
| _bash-it-completion-helper-sufficient dmidecode || return | ||
|
|
||
| function _dmidecode() { | ||
| local prev="${COMP_WORDS[COMP_CWORD - 1]}" | ||
|
|
||
| case $prev in | ||
| -s | --string | -t | --type) | ||
| OPTS=$(dmidecode "$prev" 2>&1 | grep -E '^ ' | sed 's/ *//g') | ||
| # shellcheck disable=SC2207 | ||
| COMPREPLY=($(compgen -W "$OPTS" -- "$curr")) | ||
| COMPREPLY=("${OPTS[@]}") | ||
| ;; | ||
| dmidecode) | ||
| # shellcheck disable=SC2207 | ||
| COMPREPLY=($(compgen -W "-d --dev-mem -h --help -q --quiet -s --string -t --type -H --handle -u --dump{,-bin} --from-dump --no-sysfs --oem-string -V --version" -- "$curr")) | ||
| COMPREPLY=("-d" "--dev-mem" "-h" "--help" "-q" "--quiet" "-s" "--string" "-t" "--type" "-H" "--handle" "-u" "--dump" "-dump-bin" "--from-dump" "--no-sysfs" "--oem-string" "-V" "--version") | ||
| ;; | ||
| esac | ||
| } | ||
|
|
||
| complete -F __dmidecode_completion dmidecode | ||
| complete -F _dmidecode -X '!&*' dmidecode | ||
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -1,24 +1,32 @@ | ||
| # shellcheck shell=bash | ||
| cite "about-completion" | ||
| about-completion "docker completion" | ||
|
|
||
| # Make sure docker is installed | ||
| _command_exists docker || return | ||
| _bash-it-completion-helper-necessary docker || : | ||
|
|
||
| # Don't handle completion if it's already managed | ||
| _completion_exists docker && return | ||
| _bash-it-completion-helper-sufficient docker || return | ||
|
|
||
| _docker_bash_completion_paths=( | ||
| # MacOS | ||
| # MacOS App | ||
| '/Applications/Docker.app/Contents/Resources/etc/docker.bash-completion' | ||
| # Linux | ||
| # Command Line | ||
| '/usr/share/bash-completion/completions/docker' | ||
| ) | ||
|
|
||
| for fn in "${_docker_bash_completion_paths[@]}"; do | ||
| if [ -r "$fn" ]; then | ||
| # Load the first completion file found | ||
| _docker_bash_completion_found=false | ||
| for _comp_path in "${_docker_bash_completion_paths[@]}"; do | ||
| if [[ -r "$_comp_path" ]]; then | ||
| _docker_bash_completion_found=true | ||
| # shellcheck disable=SC1090 | ||
| source "$fn" | ||
| source "$_comp_path" | ||
| break | ||
| fi | ||
| done | ||
|
|
||
| # Cleanup | ||
| if [[ "${_docker_bash_completion_found}" == false ]]; then | ||
| _log_warning "no completion files found - please try enabling the 'system' completion instead." | ||
| fi | ||
| unset "${!_docker_bash_completion@}" |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -1,3 +1,4 @@ | ||
| # shellcheck shell=bash | ||
| _log_warning 'Bash completion for "drush" is now deprecated, as it used code with incompatible license. | ||
| Please disable this completion and use the instructions from "drush" developers instead.' | ||
| _disable-completion "drush" |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -1,3 +1,4 @@ | ||
| # shellcheck shell=bash | ||
|
|
||
| complete -o nospace -S = -W "$(printenv | awk -F= "{print \$1}")" export | ||
| _log_warning 'Bash completion for "export" is now covered by "system".' | ||
| _disable-completion "export" |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -1,5 +1,9 @@ | ||
| # shellcheck shell=bash | ||
|
|
||
| if _command_exists flutter; then | ||
| eval "$(flutter bash-completion)" | ||
| fi | ||
| # Make sure flutter is installed | ||
| _bash-it-completion-helper-necessary flutter || return | ||
|
|
||
| # Don't handle completion if it's already managed | ||
| _bash-it-completion-helper-sufficient flutter || return | ||
|
|
||
| eval "$(flutter bash-completion)" |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -1,9 +1,10 @@ | ||
| # shellcheck shell=bash | ||
| cite "about-completion" | ||
| about-completion "GitHub CLI completion" | ||
|
|
||
| if _binary_exists gh; then | ||
| # If gh already completed, stop | ||
| _completion_exists gh && return | ||
| eval "$(gh completion --shell=bash)" | ||
| fi | ||
| # Make sure gh is installed | ||
| _bash-it-completion-helper-necessary gh || return | ||
|
|
||
| # Don't handle completion if it's already managed | ||
| _bash-it-completion-helper-sufficient gh || return | ||
|
|
||
| eval "$(gh completion --shell=bash)" |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -1,7 +1,10 @@ | ||
| # shellcheck shell=bash | ||
| cite "about-completion" | ||
| about-completion "helm (Kubernetes Package Manager) completion" | ||
|
|
||
| if _command_exists helm; then | ||
| eval "$(helm completion bash)" | ||
| fi | ||
| # Make sure helm is installed | ||
| _bash-it-completion-helper-necessary helm || return | ||
|
|
||
| # Don't handle completion if it's already managed | ||
| _bash-it-completion-helper-sufficient helm || return | ||
|
|
||
| eval "$(helm completion bash)" |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -1,3 +1,4 @@ | ||
| # shellcheck shell=bash | ||
| _log_warning 'Bash completion for "homesick" is now deprecated, as it used unlicensed code. | ||
| Please disable this completion and use the instructions from "homesick" bash completion developers instead.' | ||
| _disable-completion "homesick" |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -1,7 +1,10 @@ | ||
| # shellcheck shell=bash | ||
| cite "about-completion" | ||
| about-completion "jungle(AWS cli tool) completion" | ||
|
|
||
| if _command_exists jungle; then | ||
| eval "$(_JUNGLE_COMPLETE=source jungle)" | ||
| fi | ||
| # Make sure jungle is installed | ||
| _bash-it-completion-helper-necessary jungle || return | ||
|
|
||
| # Don't handle completion if it's already managed | ||
| _bash-it-completion-helper-sufficient jungle || return | ||
|
|
||
| eval "$(_JUNGLE_COMPLETE=source jungle)" |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -1,5 +1,9 @@ | ||
| # shellcheck shell=bash | ||
|
|
||
| if _command_exists kind; then | ||
| eval "$(kind completion bash)" | ||
| fi | ||
| # Make sure kind is installed | ||
| _bash-it-completion-helper-necessary kind || return | ||
|
|
||
| # Don't handle completion if it's already managed | ||
| _bash-it-completion-helper-sufficient kind || return | ||
|
|
||
| eval "$(kind completion bash)" |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -1,5 +1,10 @@ | ||
| # shellcheck shell=bash | ||
| if _command_exists kontena; then | ||
| # shellcheck disable=SC1090 | ||
| source "$(kontena whoami --bash-completion-path)" | ||
| fi | ||
|
|
||
| # Make sure kontena is installed | ||
| _bash-it-completion-helper-necessary kontena || return | ||
|
|
||
| # Don't handle completion if it's already managed | ||
| _bash-it-completion-helper-sufficient kontena || return | ||
|
|
||
| # shellcheck disable=SC1090 | ||
| source "$(kontena whoami --bash-completion-path)" |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -1,7 +1,10 @@ | ||
| # shellcheck shell=bash | ||
| cite "about-completion" | ||
| about-completion "kubectl (Kubernetes CLI) completion" | ||
|
|
||
| if _binary_exists kubectl; then | ||
| eval "$(kubectl completion bash)" | ||
| fi | ||
| # Make sure kubectl is installed | ||
| _bash-it-completion-helper-necessary kubectl || return | ||
|
|
||
| # Don't handle completion if it's already managed | ||
| _bash-it-completion-helper-sufficient kubectl || return | ||
|
|
||
| eval "$(kubectl completion bash)" |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -1,6 +1,10 @@ | ||
| # shellcheck shell=bash | ||
| # minikube (Local Kubernetes) completion | ||
| about-completion "minikube (Local Kubernetes) completion" | ||
|
|
||
| if _command_exists minikube; then | ||
| eval "$(minikube completion bash)" | ||
| fi | ||
| # Make sure minikube is installed | ||
| _bash-it-completion-helper-necessary minikube || return | ||
|
|
||
| # Don't handle completion if it's already managed | ||
| _bash-it-completion-helper-sufficient minikube || return | ||
|
|
||
| eval "$(minikube completion bash)" |
Oops, something went wrong.
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Is this correct? The assignment to
OPTSis performed with the scalar formOPTS=$(...).Also, I think
OPTSshould be localized within this function.