Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
31 commits
Select commit Hold shift + click to select a range
32d76a6
removed crystal completion, already covered by system
tbhaxor Jan 10, 2021
87edb2d
formatted defaults.completion.bash
tbhaxor Jan 10, 2021
800e754
removed deprecated bash completion of virsh
tbhaxor Jan 10, 2021
325cda2
removed deprecated completion of todo
tbhaxor Jan 10, 2021
c3d0a74
removed deprecated completion of drush
tbhaxor Jan 10, 2021
2c39053
removed deprecated completion of homesick
tbhaxor Jan 10, 2021
f71d769
formatted apm completion and used helper function
tbhaxor Jan 10, 2021
500b70d
formatted awless completion and used helper function
tbhaxor Jan 10, 2021
43ca459
formatted brew completion
tbhaxor Jan 10, 2021
dd09dc5
formatted composer completion and used helper function
tbhaxor Jan 10, 2021
6e9fa19
formatted conda completion and used helper function
tbhaxor Jan 10, 2021
5be5d69
formatted consul completion and used helper function
tbhaxor Jan 10, 2021
15461c4
formatted docker completion
tbhaxor Jan 10, 2021
6ccb6c8
formatted gcloud completion and used helper function
tbhaxor Jan 10, 2021
be21936
formatted gem completion
tbhaxor Jan 10, 2021
f790ba2
formatted github-cli completion
tbhaxor Jan 10, 2021
475393c
formatted grunt completion and used helper function
tbhaxor Jan 10, 2021
538c19b
formatted gulp completion and used helper function
tbhaxor Jan 10, 2021
3260836
formatted help completion and used helper function
tbhaxor Jan 10, 2021
46906d7
formatted jungle completion and used helper function
tbhaxor Jan 10, 2021
a838146
formatted pip pip3 and pipenv completion and used helper functions
tbhaxor Jan 10, 2021
bdb3f29
formatted npm completion and used helper function
tbhaxor Jan 10, 2021
4ca22e9
formatted minikube completion and used helper function
tbhaxor Jan 10, 2021
9e483a9
formatted maven completion and used helper function
tbhaxor Jan 10, 2021
244c6a6
formatted makefile completion and used helper function
tbhaxor Jan 10, 2021
3ed0063
formatted lerna completion and used helper function
tbhaxor Jan 10, 2021
c9e977d
fixed and formatted laravel completion and used helper function
tbhaxor Jan 10, 2021
332246a
formatted kubectl completion and used helper function
tbhaxor Jan 10, 2021
9d546ea
formatted kontena completion and used helper function
tbhaxor Jan 10, 2021
a117c28
fixed new blank line at EOF in consul completions
tbhaxor Jan 10, 2021
d7fdb8e
revert apm.completion.bash (requested by @nwinkler https://github.com…
tbhaxor Jan 16, 2021
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
5 changes: 4 additions & 1 deletion completion/available/awless.completion.bash
Original file line number Diff line number Diff line change
@@ -1 +1,4 @@
[[ -x "$(which awless)" ]] && source <(awless completion bash)
if _command_exists awless
then
source <(awless completion bash)
fi
22 changes: 11 additions & 11 deletions completion/available/brew.completion.bash
Original file line number Diff line number Diff line change
Expand Up @@ -4,24 +4,24 @@
# BASH_IT_LOAD_PRIORITY: 375

if [[ "$(uname -s)" != 'Darwin' ]] ; then
_log_warning "unsupported operating system - only 'Darwin' is supported"
return 0
_log_warning "unsupported operating system - only 'Darwin' is supported"
return 1
fi

# Make sure brew is installed
_command_exists brew || return 0

BREW_PREFIX=${BREW_PREFIX:-$(brew --prefix)}

if [[ -r "$BREW_PREFIX"/etc/bash_completion.d/brew ]] ; then
source "$BREW_PREFIX"/etc/bash_completion.d/brew
if [[ -r "$BREW_PREFIX"/etc/bash_completion.d/brew ]]; then
source "$BREW_PREFIX"/etc/bash_completion.d/brew

elif [[ -r "$BREW_PREFIX"/Library/Contributions/brew_bash_completion.sh ]] ; then
source "$BREW_PREFIX"/Library/Contributions/brew_bash_completion.sh
elif [[ -r "$BREW_PREFIX"/Library/Contributions/brew_bash_completion.sh ]] ; then
source "$BREW_PREFIX"/Library/Contributions/brew_bash_completion.sh

elif [[ -f "$BREW_PREFIX"/completions/bash/brew ]] ; then
# For the git-clone based installation, see here for more info:
# https://github.com/Bash-it/bash-it/issues/1458
# https://docs.brew.sh/Shell-Completion
source "$BREW_PREFIX"/completions/bash/brew
elif [[ -f "$BREW_PREFIX"/completions/bash/brew ]] ; then
# For the git-clone based installation, see here for more info:
# https://github.com/Bash-it/bash-it/issues/1458
# https://docs.brew.sh/Shell-Completion
source "$BREW_PREFIX"/completions/bash/brew
fi
243 changes: 123 additions & 120 deletions completion/available/composer.completion.bash
Original file line number Diff line number Diff line change
@@ -1,133 +1,136 @@
#!/usr/bin/env bash

_composer()
{
local cur script coms opts com
COMPREPLY=()
_get_comp_words_by_ref -n : cur words
if _command_exists composer
then
function _composer()
{
local cur script coms opts com
COMPREPLY=()
_get_comp_words_by_ref -n : cur words

# for an alias, get the real script behind it
if [[ $(type -t ${words[0]}) == "alias" ]]; then
script=$(alias ${words[0]} | sed -E "s/alias ${words[0]}='(.*)'/\1/")
else
script=${words[0]}
fi

# lookup for command
for word in ${words[@]:1}; do
if [[ $word != -* ]]; then
com=$word
break
# for an alias, get the real script behind it
if [[ $(type -t ${words[0]}) == "alias" ]]; then
script=$(alias ${words[0]} | sed -E "s/alias ${words[0]}='(.*)'/\1/")
else
script=${words[0]}
fi
done

# completing for an option
if [[ ${cur} == --* ]] ; then
opts="--help --quiet --verbose --version --ansi --no-ansi --no-interaction --profile --no-plugins --working-dir"
# lookup for command
for word in ${words[@]:1}; do
if [[ $word != -* ]]; then
com=$word
break
fi
done

# completing for an option
if [[ ${cur} == --* ]] ; then
opts="--help --quiet --verbose --version --ansi --no-ansi --no-interaction --profile --no-plugins --working-dir"

case "$com" in
about)
opts="${opts} "
;;
archive)
opts="${opts} --format --dir --file"
;;
browse)
opts="${opts} --homepage --show"
;;
clear-cache)
opts="${opts} "
;;
config)
opts="${opts} --global --editor --auth --unset --list --file --absolute"
;;
create-project)
opts="${opts} --stability --prefer-source --prefer-dist --repository --repository-url --dev --no-dev --no-custom-installers --no-scripts --no-progress --no-secure-http --keep-vcs --no-install --ignore-platform-reqs"
;;
depends)
opts="${opts} --recursive --tree"
;;
diagnose)
opts="${opts} "
;;
dump-autoload)
opts="${opts} --no-scripts --optimize --classmap-authoritative --apcu --no-dev"
;;
exec)
opts="${opts} --list"
;;
global)
opts="${opts} "
;;
help)
opts="${opts} --xml --format --raw"
;;
init)
opts="${opts} --name --description --author --type --homepage --require --require-dev --stability --license --repository"
;;
install)
opts="${opts} --prefer-source --prefer-dist --dry-run --dev --no-dev --no-custom-installers --no-autoloader --no-scripts --no-progress --no-suggest --optimize-autoloader --classmap-authoritative --apcu-autoloader --ignore-platform-reqs"
;;
licenses)
opts="${opts} --format --no-dev"
;;
list)
opts="${opts} --xml --raw --format"
;;
outdated)
opts="${opts} --outdated --all --direct --strict"
;;
prohibits)
opts="${opts} --recursive --tree"
;;
remove)
opts="${opts} --dev --no-progress --no-update --no-scripts --update-no-dev --update-with-dependencies --no-update-with-dependencies --ignore-platform-reqs --optimize-autoloader --classmap-authoritative --apcu-autoloader"
;;
require)
opts="${opts} --dev --prefer-source --prefer-dist --no-progress --no-suggest --no-update --no-scripts --update-no-dev --update-with-dependencies --ignore-platform-reqs --prefer-stable --prefer-lowest --sort-packages --optimize-autoloader --classmap-authoritative --apcu-autoloader"
;;
run-script)
opts="${opts} --timeout --dev --no-dev --list"
;;
search)
opts="${opts} --only-name --type"
;;
self-update)
opts="${opts} --rollback --clean-backups --no-progress --update-keys --stable --preview --snapshot"
;;
show)
opts="${opts} --all --installed --platform --available --self --name-only --path --tree --latest --outdated --minor-only --direct --strict"
;;
status)
opts="${opts} "
;;
suggests)
opts="${opts} --by-package --by-suggestion --no-dev"
;;
update)
opts="${opts} --prefer-source --prefer-dist --dry-run --dev --no-dev --lock --no-custom-installers --no-autoloader --no-scripts --no-progress --no-suggest --with-dependencies --optimize-autoloader --classmap-authoritative --apcu-autoloader --ignore-platform-reqs --prefer-stable --prefer-lowest --interactive --root-reqs"
;;
validate)
opts="${opts} --no-check-all --no-check-lock --no-check-publish --with-dependencies --strict"
;;
case "$com" in
about)
opts="${opts} "
;;
archive)
opts="${opts} --format --dir --file"
;;
browse)
opts="${opts} --homepage --show"
;;
clear-cache)
opts="${opts} "
;;
config)
opts="${opts} --global --editor --auth --unset --list --file --absolute"
;;
create-project)
opts="${opts} --stability --prefer-source --prefer-dist --repository --repository-url --dev --no-dev --no-custom-installers --no-scripts --no-progress --no-secure-http --keep-vcs --no-install --ignore-platform-reqs"
;;
depends)
opts="${opts} --recursive --tree"
;;
diagnose)
opts="${opts} "
;;
dump-autoload)
opts="${opts} --no-scripts --optimize --classmap-authoritative --apcu --no-dev"
;;
exec)
opts="${opts} --list"
;;
global)
opts="${opts} "
;;
help)
opts="${opts} --xml --format --raw"
;;
init)
opts="${opts} --name --description --author --type --homepage --require --require-dev --stability --license --repository"
;;
install)
opts="${opts} --prefer-source --prefer-dist --dry-run --dev --no-dev --no-custom-installers --no-autoloader --no-scripts --no-progress --no-suggest --optimize-autoloader --classmap-authoritative --apcu-autoloader --ignore-platform-reqs"
;;
licenses)
opts="${opts} --format --no-dev"
;;
list)
opts="${opts} --xml --raw --format"
;;
outdated)
opts="${opts} --outdated --all --direct --strict"
;;
prohibits)
opts="${opts} --recursive --tree"
;;
remove)
opts="${opts} --dev --no-progress --no-update --no-scripts --update-no-dev --update-with-dependencies --no-update-with-dependencies --ignore-platform-reqs --optimize-autoloader --classmap-authoritative --apcu-autoloader"
;;
require)
opts="${opts} --dev --prefer-source --prefer-dist --no-progress --no-suggest --no-update --no-scripts --update-no-dev --update-with-dependencies --ignore-platform-reqs --prefer-stable --prefer-lowest --sort-packages --optimize-autoloader --classmap-authoritative --apcu-autoloader"
;;
run-script)
opts="${opts} --timeout --dev --no-dev --list"
;;
search)
opts="${opts} --only-name --type"
;;
self-update)
opts="${opts} --rollback --clean-backups --no-progress --update-keys --stable --preview --snapshot"
;;
show)
opts="${opts} --all --installed --platform --available --self --name-only --path --tree --latest --outdated --minor-only --direct --strict"
;;
status)
opts="${opts} "
;;
suggests)
opts="${opts} --by-package --by-suggestion --no-dev"
;;
update)
opts="${opts} --prefer-source --prefer-dist --dry-run --dev --no-dev --lock --no-custom-installers --no-autoloader --no-scripts --no-progress --no-suggest --with-dependencies --optimize-autoloader --classmap-authoritative --apcu-autoloader --ignore-platform-reqs --prefer-stable --prefer-lowest --interactive --root-reqs"
;;
validate)
opts="${opts} --no-check-all --no-check-lock --no-check-publish --with-dependencies --strict"
;;

esac
esac

COMPREPLY=($(compgen -W "${opts}" -- ${cur}))
__ltrim_colon_completions "$cur"
COMPREPLY=($(compgen -W "${opts}" -- ${cur}))
__ltrim_colon_completions "$cur"

return 0;
fi
return 0;
fi

# completing for a command
if [[ $cur == $com ]]; then
coms="about archive browse clear-cache config create-project depends diagnose dump-autoload exec global help init install licenses list outdated prohibits remove require run-script search self-update show status suggests update validate"
# completing for a command
if [[ $cur == $com ]]; then
coms="about archive browse clear-cache config create-project depends diagnose dump-autoload exec global help init install licenses list outdated prohibits remove require run-script search self-update show status suggests update validate"

COMPREPLY=($(compgen -W "${coms}" -- ${cur}))
__ltrim_colon_completions "$cur"
COMPREPLY=($(compgen -W "${coms}" -- ${cur}))
__ltrim_colon_completions "$cur"

return 0
fi
}
return 0
fi
}

complete -o default -F _composer composer
complete -o default -F _composer composer
fi
14 changes: 11 additions & 3 deletions completion/available/conda.completion.bash
Original file line number Diff line number Diff line change
@@ -1,4 +1,12 @@
#!/usr/bin/env bash
which register-python-argcomplete > /dev/null \
&& eval "$(register-python-argcomplete conda)" \
|| echo "Please install argcomplete to use conda completion"

if _command_exists conda
then
if _command_exists register-python-argcomplete
then
eval "$(register-python-argcomplete conda)"
else
_log_warning "Argcomplete not found. Please run 'conda install argcomplete'"
return 1
fi
fi
8 changes: 2 additions & 6 deletions completion/available/consul.completion.bash
Original file line number Diff line number Diff line change
@@ -1,10 +1,6 @@
# bash completion support for Hashicorp consul

CONSUL_BIN=$(command -v consul 2>/dev/null)

if [[ -x "$CONSUL_BIN" ]]
if _command_exists consul
then
complete -C "$CONSUL_BIN" consul
complete -C "$(which consul)" consul
fi

unset CONSUL_BIN
1 change: 0 additions & 1 deletion completion/available/crystal.completion.bash

This file was deleted.

Loading