Skip to content
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

Bring to compliance all the completions #2284

Merged
merged 23 commits into from
Feb 1, 2025
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
23 commits
Select commit Hold shift + click to select a range
4424b89
bring to compliance: virtualbox.completion
seefood Jan 29, 2025
fc623c5
bring to compliance: tmux.completion
seefood Jan 29, 2025
e0ceb94
bring to compliance: maven.completion
seefood Jan 29, 2025
aaf21e4
bring to compliance: terraform.completion
seefood Jan 29, 2025
840c8fd
bring to compliance: test_kitchen.completion
seefood Jan 29, 2025
b7e7557
bring to compliance: git_flow.completion
seefood Jan 29, 2025
9c2edda
bring to compliance: git_flow_avh.completion
seefood Jan 29, 2025
761054d
clean up AWS plugin
Jan 26, 2025
fbd0429
Cleanup all remaining plugins
Jan 27, 2025
d3a68c8
last details
Jan 27, 2025
0386181
bring to compliance: rake.completion
seefood Feb 1, 2025
16fcc2a
bring to compliance: projects.completion
seefood Feb 1, 2025
ba6afac
bring to compliance: nvm.completion
seefood Feb 1, 2025
2f70354
bring to compliance: ng.completion
seefood Feb 1, 2025
937d1af
bring to compliance: kind.completion
seefood Feb 1, 2025
8160145
bring to compliance: gulp.completion
seefood Feb 1, 2025
4e263f6
bring to compliance: grunt.completion
seefood Feb 1, 2025
db985f0
bring to compliance: hub.completion
seefood Feb 1, 2025
3722758
bring to compliance: invoke.completion
seefood Feb 1, 2025
6a2d699
bring to compliance: ssh.completion
seefood Feb 1, 2025
9c78f5c
Update completion/available/maven.completion.bash
seefood Feb 1, 2025
f4f3b14
Last few fixes after consulting Koichi-san.
seefood Feb 1, 2025
9f3cf40
Merge branch 'ira/cleanup6-completions' of github.com:Bash-it/bash-it…
seefood Feb 1, 2025
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
57 changes: 1 addition & 56 deletions clean_files.txt
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@
# root directories
#
aliases/
completions/
docs/
hooks/
lib/
Expand All @@ -32,62 +33,6 @@ clean_files.txt
install.sh
lint_clean_files.sh

# completions
#
completion/available/aliases.completion.bash
completion/available/apm.completion.bash
completion/available/awless.completion.bash
completion/available/awscli.completion.bash
completion/available/bash-it.completion.bash
completion/available/brew.completion.bash
completion/available/bundler.completion.bash
completion/available/capistrano.completion.bash
completion/available/cargo.completion.bash
completion/available/composer.completion.bash
completion/available/conda.completion.bash
completion/available/consul.completion.bash
completion/available/dart.completion.bash
completion/available/dirs.completion.bash
completion/available/django.completion.bash
completion/available/dmidecode.completion.bash
completion/available/docker-compose.completion.bash
completion/available/docker-machine.completion.bash
completion/available/docker.completion.bash
completion/available/dotnet.completion.bash
completion/available/export.completion.bash
completion/available/flutter.completion.bash
completion/available/gcloud.completion.bash
completion/available/gem.completion.bash
completion/available/git.completion.bash
completion/available/github-cli.completion.bash
completion/available/go.completion.bash
completion/available/helm.completion.bash
completion/available/jboss5.completion.bash
completion/available/jboss7.completion.bash
completion/available/jungle.completion.bash
completion/available/knife.completion.bash
completion/available/kontena.completion.bash
completion/available/kubectl.completion.bash
completion/available/laravel.completion.bash
completion/available/lerna.completion.bash
completion/available/minikube.completion.bash
completion/available/ngrok.completion.bash
completion/available/notify-send.completion.bash
completion/available/npm.completion.bash
completion/available/packer.completion.bash
completion/available/pip.completion.bash
completion/available/pip3.completion.bash
completion/available/pipenv.completion.bash
completion/available/pipx.completion.bash
completion/available/rustup.completion.bash
completion/available/salt.completion.bash
completion/available/sdkman.completion.bash
completion/available/system.completion.bash
completion/available/vault.completion.bash
completion/available/vuejs.completion.bash
completion/available/wpscan.completion.bash
completion/available/yarn.completion.bash

# themes
#
themes/90210
Expand Down
22 changes: 13 additions & 9 deletions completion/available/git_flow.completion.bash
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
#!bash
# shellcheck shell=bash
#
# git-flow-completion
# ===================
Expand Down Expand Up @@ -46,8 +46,9 @@
# Distributed under the [MIT License](http://creativecommons.org/licenses/MIT/)

_git_flow() {
local subcommands="init feature release hotfix"
local subcommand="$(__git_find_subcommand "$subcommands")"
local subcommands subcommand
subcommands="init feature release hotfix"
subcommand="$(__git_find_subcommand "$subcommands")"
if [ -z "$subcommand" ]; then
__gitcomp "$subcommands"
return
Expand All @@ -73,8 +74,9 @@ _git_flow() {
}

__git_flow_feature() {
local subcommands="list start finish publish track diff rebase checkout pull"
local subcommand="$(__git_find_subcommand "$subcommands")"
local subcommands subcommand
subcommands="list start finish publish track diff rebase checkout pull"
subcommand="$(__git_find_subcommand "$subcommands")"
if [ -z "$subcommand" ]; then
__gitcomp "$subcommands"
return
Expand Down Expand Up @@ -116,8 +118,9 @@ __git_flow_feature_prefix() {
}

__git_flow_release() {
local subcommands="list start finish"
local subcommand="$(__git_find_subcommand "$subcommands")"
local subcommands subcommand
subcommands="list start finish"
subcommand="$(__git_find_subcommand "$subcommands")"
if [ -z "$subcommand" ]; then
__gitcomp "$subcommands"
return
Expand All @@ -140,8 +143,9 @@ __git_flow_list_releases() {
}

__git_flow_hotfix() {
local subcommands="list start finish"
local subcommand="$(__git_find_subcommand "$subcommands")"
local subcommands subcommand
subcommands="list start finish"
subcommand="$(__git_find_subcommand "$subcommands")"
if [ -z "$subcommand" ]; then
__gitcomp "$subcommands"
return
Expand Down
65 changes: 38 additions & 27 deletions completion/available/git_flow_avh.completion.bash
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
#!bash
# shellcheck shell=bash
# shellcheck disable=SC2154,SC2030,SC2031
#
# git-flow-completion
# ===================
Expand Down Expand Up @@ -54,8 +55,9 @@ __git_flow_config_file_options="
"

_git_flow() {
local subcommands="init feature release hotfix support help version config finish delete publish rebase"
local subcommand="$(__git_find_on_cmdline "$subcommands")"
local subcommands subcommand
subcommands="init feature release hotfix support help version config finish delete publish rebase"
subcommand="$(__git_find_on_cmdline "$subcommands")"
if [ -z "$subcommand" ]; then
__gitcomp "$subcommands"
return
Expand Down Expand Up @@ -93,8 +95,9 @@ _git_flow() {
}

__git_flow_init() {
local subcommands="help"
local subcommand="$(__git_find_on_cmdline "$subcommands")"
local subcommands subcommand
subcommands="help"
subcommand="$(__git_find_on_cmdline "$subcommands")"
if [ -z "$subcommand" ]; then
__gitcomp "$subcommands"
fi
Expand All @@ -112,8 +115,9 @@ __git_flow_init() {
}

__git_flow_feature() {
local subcommands="list start finish publish track diff rebase checkout pull help delete"
local subcommand="$(__git_find_on_cmdline "$subcommands")"
local subcommands subcommand
subcommands="list start finish publish track diff rebase checkout pull help delete"
subcommand="$(__git_find_on_cmdline "$subcommands")"

if [ -z "$subcommand" ]; then
__gitcomp "$subcommands"
Expand Down Expand Up @@ -194,8 +198,9 @@ __git_flow_feature() {
}

__git_flow_release() {
local subcommands="list start finish track publish help delete"
local subcommand="$(__git_find_on_cmdline "$subcommands")"
local subcommands subcommand
subcommands="list start finish track publish help delete"
subcommand="$(__git_find_on_cmdline "$subcommands")"
if [ -z "$subcommand" ]; then
__gitcomp "$subcommands"
return
Expand Down Expand Up @@ -279,8 +284,9 @@ __git_flow_release() {
}

__git_flow_hotfix() {
local subcommands="list start finish track publish help delete"
local subcommand="$(__git_find_on_cmdline "$subcommands")"
local subcommands subcommand
subcommands="list start finish track publish help delete"
subcommand="$(__git_find_on_cmdline "$subcommands")"
if [ -z "$subcommand" ]; then
__gitcomp "$subcommands"
return
Expand Down Expand Up @@ -362,8 +368,9 @@ __git_flow_hotfix() {
}

__git_flow_support() {
local subcommands="list start help"
local subcommand="$(__git_find_on_cmdline "$subcommands")"
local subcommands subcommand
subcommands="list start help"
subcommand="$(__git_find_on_cmdline "$subcommands")"
if [ -z "$subcommand" ]; then
__gitcomp "$subcommands"
return
Expand Down Expand Up @@ -401,8 +408,9 @@ __git_flow_support() {
}

__git_flow_config() {
local subcommands="list set base"
local subcommand="$(__git_find_on_cmdline "$subcommands")"
local subcommands subcommand
subcommands="list set base"
subcommand="$(__git_find_on_cmdline "$subcommands")"
if [ -z "$subcommand" ]; then
__gitcomp "$subcommands"
return
Expand Down Expand Up @@ -454,11 +462,12 @@ __git_flow_prefix() {

__git_flow_list_local_branches() {
if [ -n "$1" ]; then
local prefix="$(__git_flow_prefix $1)"
git for-each-ref --shell --format="ref=%(refname:short)" refs/heads/$prefix \
local prefix
prefix="$(__git_flow_prefix "$1")"
git for-each-ref --shell --format="ref=%(refname:short)" "refs/heads/$prefix" \
| while read -r entry; do
eval "$entry"
ref="${ref#$prefix}"
ref="${ref#"$prefix"}"
echo "$ref"
done | sort
else
Expand All @@ -468,28 +477,30 @@ __git_flow_list_local_branches() {
}

__git_flow_list_remote_branches() {
local prefix="$(__git_flow_prefix $1)"
local origin="$(git config gitflow.origin 2> /dev/null || echo "origin")"
git for-each-ref --shell --format='%(refname:short)' refs/remotes/$origin/$prefix \
local prefix origin
prefix="$(__git_flow_prefix "$1")"
origin="$(git config gitflow.origin 2> /dev/null || echo "origin")"
git for-each-ref --shell --format='ref=%refname:short)' "refs/remotes/$origin/$prefix" \
| while read -r entry; do
eval "$entry"
ref="${ref##$prefix}"
ref="${ref##"$prefix"}"
echo "$ref"
done | sort
}

__git_flow_list_branches() {
local origin="$(git config gitflow.origin 2> /dev/null || echo "origin")"
local origin prefix
origin="$(git config gitflow.origin 2> /dev/null || echo "origin")"
if [ -n "$1" ]; then
local prefix="$(__git_flow_prefix $1)"
git for-each-ref --shell --format="ref=%(refname:short)" refs/heads/$prefix refs/remotes/$origin/$prefix \
prefix="$(__git_flow_prefix "$1")"
git for-each-ref --shell --format="ref=%(refname:short)" "refs/heads/$prefix" "refs/remotes/$origin/$prefix" \
| while read -r entry; do
eval "$entry"
ref="${ref##$prefix}"
ref="${ref##"$prefix"}"
echo "$ref"
done | sort
else
git for-each-ref --format="%(refname:short)" refs/heads/ refs/remotes/$origin | sort
git for-each-ref --format="%(refname:short)" refs/heads/ "refs/remotes/$origin" | sort
fi
}

Expand Down
16 changes: 9 additions & 7 deletions completion/available/grunt.completion.bash
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
#!/bin/bash
# shellcheck shell=bash

# grunt-cli
# http://gruntjs.com/
Expand Down Expand Up @@ -57,19 +57,21 @@ function _grunt_gruntfile() {

# Enable bash autocompletion.
function _grunt_completions() {
local cur gruntfile gruntinfo opts compls line
# The currently-being-completed word.
local cur="${COMP_WORDS[COMP_CWORD]}"
cur="${COMP_WORDS[COMP_CWORD]}"
# The current gruntfile, if it exists.
local gruntfile="$(_grunt_gruntfile)"
gruntfile="$(_grunt_gruntfile)"
# The current grunt version, available tasks, options, etc.
local gruntinfo="$(grunt --version --verbose 2> /dev/null)"
gruntinfo="$(grunt --version --verbose 2> /dev/null)"
# Options and tasks.
local opts="$(echo "$gruntinfo" | awk '/Available options: / {$1=$2=""; print $0}')"
local compls="$(echo "$gruntinfo" | awk '/Available tasks: / {$1=$2=""; print $0}')"
opts="$(echo "$gruntinfo" | awk '/Available options: / {$1=$2=""; print $0}')"
compls="$(echo "$gruntinfo" | awk '/Available tasks: / {$1=$2=""; print $0}')"
# Only add -- or - options if the user has started typing -
[[ "$cur" == -* ]] && compls="$compls $opts"
# Tell complete what stuff to show.
COMPREPLY=($(compgen -W "$compls" -- "$cur"))

while IFS='' read -r line; do COMPREPLY+=("$line"); done < <(compgen -W "$compls" -- "$cur")
}

complete -o default -F _grunt_completions grunt
7 changes: 4 additions & 3 deletions completion/available/gulp.completion.bash
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
#!/bin/bash
# shellcheck shell=bash
# Borrowed from grunt-cli
# http://gruntjs.com/
#
Expand Down Expand Up @@ -43,8 +43,9 @@ function _gulp_completions() {
# The currently-being-completed word.
local cur="${COMP_WORDS[COMP_CWORD]}"
#Grab tasks
local compls=$(gulp --tasks-simple)
local line compls
compls=$(gulp --tasks-simple)
# Tell complete what stuff to show.
COMPREPLY=($(compgen -W "$compls" -- "$cur"))
while IFS='' read -r line; do COMPREPLY+=("$line"); done < <(compgen -W "$compls" -- "$cur")
}
complete -o default -F _gulp_completions gulp
Loading
Loading