Compare commits

..

No commits in common. "master" and "v2.1.1" have entirely different histories.

278 changed files with 7514 additions and 8998 deletions

10
.editorconfig 100644 → 100755
View File

@ -13,12 +13,11 @@ insert_final_newline = true
trim_trailing_whitespace = false trim_trailing_whitespace = false
[.git*] [.git*]
indent_size = tab
indent_style = tab indent_style = tab
[{**.*sh,test/run,**.bats}] [{**.*sh,test/run}]
indent_size = tab
indent_style = tab indent_style = tab
indent_size = 4
shell_variant = bash shell_variant = bash
binary_next_line = true # like -bn binary_next_line = true # like -bn
@ -29,8 +28,3 @@ end_of_line = lf
charset = utf-8 charset = utf-8
trim_trailing_whitespace = true trim_trailing_whitespace = true
insert_final_newline = true insert_final_newline = true
[**.bats]
indent_size = tab
indent_style = tab
shell_variant = bats

View File

@ -0,0 +1,46 @@
---
name: Bug report
about: Create a bug report to help us improve
title: ''
labels: bug:general
assignees: ''
---
<!--- Provide a general summary of the issue in the Title above -->
## Expected Behavior
<!--- Tell us what should happen -->
## Current Behavior
<!--- Tell us what happens instead of the expected behavior -->
## Possible Solution
<!--- Not obligatory, but suggest a fix/reason for the bug, -->
## Context
<!--- How has this issue affected you? What are you trying to accomplish? -->
<!--- Providing context helps us come up with a solution that is most useful in the real world -->
## Steps to Reproduce
<!--- Provide a link to a live example, or an unambiguous set of steps to -->
<!--- reproduce this bug. Include code to reproduce, if relevant -->
1.
2.
3.
4.
## Your Environment
<!--- Include as many relevant details about the environment you experienced the bug in -->
* Bash-it version used:
* List of enabled plugins, themes and aliases (use ``bash-it show (plugins/themes/aliases)``):
* ``bash-it doctor`` output:
* Bash version:
* Operating System and version:
## Your Bash Config File
<!--- Please paste here your bash config file (.bashrc/.bash_profile) -->
<!--- This will help us debug and locate the problem -->
```bash
# Your bash config file should be here
```

View File

@ -1,85 +0,0 @@
name: 🐛 Bug report
title: "[Bug]: "
description: Create a bug report to help us improve
labels: "bug:general"
body:
- type: textarea
attributes:
label: Expected behavior
description: Tell us what should happen.
validations:
required: true
- type: textarea
attributes:
label: Current behavior
description: Tell us what happens instead of the expected behavior.
validations:
required: true
- type: textarea
attributes:
label: Possible solution
description: Tell us how it could be fixed at your glance.
validations:
required: false
- type: textarea
attributes:
label: Context
description: >
How has this issue affected you? What are you trying to accomplish?
Providing context helps us come up with a solution that is most useful in the real world.
validations:
required: false
- type: textarea
attributes:
label: Steps to reproduce
description: >
Provide a link to a live example, or an unambiguous set of steps to reproduce this bug. Include code to reproduce, if relevant.
validations:
required: true
- type: input
attributes:
label: Bash-it version
placeholder: "How to get: bash-it version"
validations:
required: true
- type: input
attributes:
label: List of enabled plugins, themes and aliases
placeholder: "How to get: bash-it show plugins|themes|aliases (it is not a pipe)"
validations:
required: true
- type: input
attributes:
label: Bash version
placeholder: "How to get: bash --version"
validations:
required: true
- type: input
attributes:
label: Operating system and version
placeholder: "How to get: neofetch (or another command)"
validations:
required: true
- type: textarea
attributes:
label: "bash-it doctor output"
value: |
```
# How to get: bash-it doctor
```
validations:
required: false
- type: textarea
attributes:
label: Your ~/.bashrc
value: |
```bash
# How to get: cat ~/.bashrc
```
validations:
required: true
- type: textarea
attributes:
label: Notes
description: >
Provide any extra details here.

View File

@ -1,5 +0,0 @@
blank_issues_enabled: true
contact_links:
- name: Libera chat
url: https://web.libera.chat/?channel=#bash-it
about: You can ask and answer questions here

View File

@ -0,0 +1,23 @@
---
name: Feature request
about: Suggest an idea for this project
title: ''
labels: feature request
assignees: ''
---
<!--- Provide a general summary of the issue in the Title above -->
## Expected Behavior
<!--- Tell us how your feature should work -->
## Current Behavior
<!--- Explain the difference your feature will have from current behavior -->
## Possible Solution
<!--- Not obligatory, but suggest ideas on how to implement the addition or change -->
## Context
<!--- How has this issue affected you? What are you trying to accomplish? -->
<!--- Providing context helps us come up with a solution that is most useful in the real world -->

View File

@ -1,34 +0,0 @@
name: 💡 Feature request
title: "[Feature]: "
description: Suggest an idea for this project
labels: "feature request"
body:
- type: textarea
attributes:
label: Expected behavior
description: Tell us how your feature should work.
validations:
required: true
- type: textarea
attributes:
label: Current behavior
description: Explain the difference your feature will have from current behavior.
validations:
required: true
- type: textarea
attributes:
label: Possible solution
description: Tell us how it could be fixed at your glance.
validations:
required: false
- type: textarea
attributes:
label: Context
description: >
How has this issue affected you? What are you trying to accomplish?
Providing context helps us come up with a solution that is most useful in the real world.
- type: textarea
attributes:
label: Notes
description: >
Provide any extra details here.

View File

@ -1,13 +1,17 @@
name: CI name: CI
# Triggers the workflow on push or pull request events # Triggers the workflow on push or pull request events
on: [push, pull_request] on:
push:
branches: [ master ]
pull_request:
branches: [ master ]
jobs: jobs:
bats-test: bats-test:
strategy: strategy:
matrix: matrix:
os: [ubuntu-20.04, ubuntu-22.04, macos-12, macos-11] os: [ubuntu-20.04, ubuntu-18.04, ubuntu-16.04, macos-10.15]
runs-on: ${{ matrix.os }} runs-on: ${{ matrix.os }}
@ -16,9 +20,6 @@ jobs:
- name: Install greadlink - name: Install greadlink
if: startsWith(runner.os, 'macOS') if: startsWith(runner.os, 'macOS')
run: brew install coreutils run: brew install coreutils
- name: Install parallel
if: startsWith(runner.os, 'macOS')
run: brew install parallel
- name: Test code - name: Test code
run: test/run run: test/run
@ -44,22 +45,15 @@ jobs:
- name: Set up Go - name: Set up Go
uses: actions/setup-go@v2 uses: actions/setup-go@v2
with: with:
go-version: 1.17 go-version: 1.14
- name: Set up Python - name: Set up Python
uses: actions/setup-python@v2 uses: actions/setup-python@v2
with: with:
python-version: 3.8 python-version: 3.8
# - name: Update APT Package Lists
# run: sudo apt-get update
- name: Install shfmt - name: Install shfmt
run: GO111MODULE=on go get mvdan.cc/sh/v3/cmd/shfmt run: GO111MODULE=on go get mvdan.cc/sh/v3/cmd/shfmt
- name: Install shellcheck - name: Install shellcheck
env: run: brew install shellcheck
scversion: stable # Or latest, vxx, etc
run: |
wget -qO- "https://github.com/koalaman/shellcheck/releases/download/${scversion?}/shellcheck-${scversion?}.linux.x86_64.tar.xz" | tar -xJv "shellcheck-${scversion}/shellcheck"
sudo cp "shellcheck-${scversion}/shellcheck" /usr/bin/
shellcheck --version
- name: Install pre-commit - name: Install pre-commit
run: python3 -m pip install -r test/lint-requirements.txt run: python3 -m pip install -r test/lint-requirements.txt
- name: Run lint - name: Run lint

5
.gitignore vendored 100644 → 100755
View File

@ -17,8 +17,3 @@ bats
enabled/* enabled/*
/enabled /enabled
tmp/ tmp/
# Do not save profiles
profiles/*
# apart from the default one
!profiles/default.bash_it

View File

@ -15,7 +15,7 @@ repos:
- id: mixed-line-ending - id: mixed-line-ending
- id: check-added-large-files - id: check-added-large-files
- repo: https://github.com/jumanjihouse/pre-commit-hooks - repo: https://github.com/jumanjihouse/pre-commit-hooks
rev: 2.1.5 rev: 2.1.4
hooks: hooks:
- id: git-check # Configure in .gitattributes - id: git-check # Configure in .gitattributes
- id: shellcheck - id: shellcheck
@ -43,8 +43,3 @@ repos:
language: system language: system
files: "\\.bash$" files: "\\.bash$"
types: [file] types: [file]
- id: clean-files-txt
name: Check that clean_files.txt is sorted alphabetically.
entry: ./hooks/check-clean-files-txt.sh
language: system
files: clean_files.txt

6
.shellcheckrc 100644
View File

@ -0,0 +1,6 @@
# We use colors and not assigned
disable=SC2154
# Hard to fix
disable=SC2155
# shellcheck is wrong on some
disable=SC2034

View File

@ -1,6 +1,6 @@
MIT License MIT License
Copyright (c) 2020-2021 Bash-it Copyright (c) 2020 Bash-it
Permission is hereby granted, free of charge, to any person obtaining a copy Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal of this software and associated documentation files (the "Software"), to deal

View File

@ -1,4 +1,4 @@
# shellcheck shell=bash cite 'about-alias'
about-alias 'the silver searcher (ag) aliases' about-alias 'the silver searcher (ag) aliases'
## Summary for args to less: ## Summary for args to less:

View File

@ -1,4 +1,4 @@
# shellcheck shell=bash cite 'about-alias'
about-alias 'ansible abbreviations' about-alias 'ansible abbreviations'
alias ans=ansible alias ans=ansible

View File

@ -1,4 +1,4 @@
# shellcheck shell=bash #!/bin/bash
# #
# -binaryanomaly # -binaryanomaly
@ -6,8 +6,9 @@ cite 'about-alias'
about-alias 'Apt and dpkg aliases for Ubuntu and Debian distros.' about-alias 'Apt and dpkg aliases for Ubuntu and Debian distros.'
# set apt aliases # set apt aliases
function _set_pkg_aliases() { function _set_pkg_aliases()
if _command_exists apt; then {
if [ -x $(which apt) ]; then
alias apts='apt-cache search' alias apts='apt-cache search'
alias aptshow='apt-cache show' alias aptshow='apt-cache show'
alias aptinst='sudo apt-get install -V' alias aptinst='sudo apt-get install -V'

View File

@ -1,4 +1,4 @@
# shellcheck shell=bash cite 'about-alias'
about-alias 'Atom.io editor abbreviations' about-alias 'Atom.io editor abbreviations'
alias a='atom' alias a='atom'

View File

@ -1,4 +1,4 @@
# shellcheck shell=bash cite about-alias
about-alias 'Aliases for the bash-it command (these aliases are automatically included with the "general" aliases)' about-alias 'Aliases for the bash-it command (these aliases are automatically included with the "general" aliases)'
# Common misspellings of bash-it # Common misspellings of bash-it

View File

@ -1,4 +1,4 @@
# shellcheck shell=bash cite 'about-alias'
about-alias 'puppet bolt aliases' about-alias 'puppet bolt aliases'
# Aliases # Aliases

View File

@ -1,4 +1,4 @@
# shellcheck shell=bash cite 'about-alias'
about-alias 'ruby bundler' about-alias 'ruby bundler'
# Bundler Commands # Bundler Commands

View File

@ -1,4 +1,5 @@
# shellcheck shell=bash # shellcheck shell=bash
cite 'about-alias'
about-alias 'xclip shortcuts' about-alias 'xclip shortcuts'
alias pbcopy="xclip -selection clipboard" alias pbcopy="xclip -selection clipboard"

View File

@ -1,4 +1,4 @@
# shellcheck shell=bash cite 'about-alias'
about-alias 'common composer abbreviations' about-alias 'common composer abbreviations'
# Aliases # Aliases

View File

@ -1,9 +1,12 @@
# shellcheck shell=bash #!/bin/bash
cite 'about-alias'
about-alias 'Curl aliases for convenience.' about-alias 'Curl aliases for convenience.'
# set apt aliases # set apt aliases
function _set_pkg_aliases() { function _set_pkg_aliases()
if _command_exists curl; then {
if [ -x $(which curl) ]; then
# follow redirects # follow redirects
alias cl='curl -L' alias cl='curl -L'
# follow redirects, download as original name # follow redirects, download as original name

View File

@ -1,4 +1,5 @@
# shellcheck shell=bash # shellcheck shell=bash
cite 'about-alias'
about-alias 'dnf aliases for fedora 22+ distros' about-alias 'dnf aliases for fedora 22+ distros'
alias dnfl="dnf list" # List packages alias dnfl="dnf list" # List packages

View File

@ -1,4 +1,4 @@
# shellcheck shell=bash cite 'about-alias'
about-alias 'docker-compose abbreviations' about-alias 'docker-compose abbreviations'
alias dco="docker-compose" alias dco="docker-compose"
@ -7,4 +7,3 @@ alias dco="docker-compose"
alias dcofresh="docker-compose-fresh" alias dcofresh="docker-compose-fresh"
alias dcol="docker-compose logs -f --tail 100" alias dcol="docker-compose logs -f --tail 100"
alias dcou="docker-compose up" alias dcou="docker-compose up"
alias dcouns="dcou --no-start"

View File

@ -1,4 +1,4 @@
# shellcheck shell=bash cite 'about-alias'
about-alias 'docker abbreviations' about-alias 'docker abbreviations'
alias dk='docker' alias dk='docker'
@ -19,7 +19,7 @@ case $OSTYPE in
;; ;;
esac esac
if _bash-it-component-item-is-enabled plugin docker; then if [ ! -z "$(command ls "${BASH_IT}/enabled/"{[0-9][0-9][0-9]${BASH_IT_LOAD_PRIORITY_SEPARATOR}docker,docker}.plugin.bash 2>/dev/null | head -1)" ]; then
# Function aliases from docker plugin: # Function aliases from docker plugin:
alias dkrmlc='docker-remove-most-recent-container' # Delete most recent (i.e., last) Docker container alias dkrmlc='docker-remove-most-recent-container' # Delete most recent (i.e., last) Docker container
alias dkrmall='docker-remove-stale-assets' # Delete all untagged images and exited containers alias dkrmall='docker-remove-stale-assets' # Delete all untagged images and exited containers

View File

@ -1,4 +1,4 @@
# shellcheck shell=bash cite 'about-alias'
about-alias 'emacs editor' about-alias 'emacs editor'
case $OSTYPE in case $OSTYPE in

View File

@ -1,4 +1,4 @@
# shellcheck shell=bash cite 'about-alias'
about-alias 'fuck/please to retry last command with sudo' about-alias 'fuck/please to retry last command with sudo'
# Play nicely with 'thefuck' plugin # Play nicely with 'thefuck' plugin

View File

@ -1,9 +1,12 @@
# shellcheck shell=bash cite about-alias
about-alias 'general aliases' about-alias 'general aliases'
if command ls --color -d . &> /dev/null; then if ls --color -d . &> /dev/null
alias ls='ls --color=auto' then
# BSD `ls` doesn't need an argument (`-G`) when `$CLICOLOR` is set. alias ls="ls --color=auto"
elif ls -G -d . &> /dev/null
then
alias ls='ls -G' # Compact view, show colors
fi fi
# List directory contents # List directory contents
@ -12,34 +15,36 @@ alias la='ls -AF' # Compact view, show hidden
alias ll='ls -al' alias ll='ls -al'
alias l='ls -a' alias l='ls -a'
alias l1='ls -1' alias l1='ls -1'
alias lf='ls -F'
alias _='sudo' alias _="sudo"
# Shortcuts to edit startup files # Shortcuts to edit startup files
alias vbrc='${VISUAL:-vim} ~/.bashrc' alias vbrc="vim ~/.bashrc"
alias vbpf='${VISUAL:-vim} ~/.bash_profile' alias vbpf="vim ~/.bash_profile"
# colored grep # colored grep
# Need to check an existing file for a pattern that will be found to ensure # Need to check an existing file for a pattern that will be found to ensure
# that the check works when on an OS that supports the color option # that the check works when on an OS that supports the color option
if command grep --color=auto "a" "${BASH_IT?}"/*.md &> /dev/null; then if grep --color=auto "a" "${BASH_IT}/"*.md &> /dev/null
then
alias grep='grep --color=auto' alias grep='grep --color=auto'
fi fi
if _command_exists gshuf; then if which gshuf &> /dev/null
then
alias shuf=gshuf alias shuf=gshuf
fi fi
alias c='clear' alias c='clear'
alias k='clear'
alias cls='clear' alias cls='clear'
alias edit='${EDITOR:-${ALTERNATE_EDITOR:-nano}}' alias edit="$EDITOR"
alias pager='${PAGER:=less}' alias pager="$PAGER"
alias q='exit' alias q='exit'
alias irc='${IRC_CLIENT:=irc}' alias irc="${IRC_CLIENT:=irc}"
# Language aliases # Language aliases
alias rb='ruby' alias rb='ruby'
@ -60,7 +65,8 @@ alias -- -='cd -' # Go back
alias h='history' alias h='history'
# Tree # Tree
if ! _command_exists tree; then if [ ! -x "$(which tree 2>/dev/null)" ]
then
alias tree="find . -print | sed -e 's;[^/]*/;|____;g;s;____|; |;g'" alias tree="find . -print | sed -e 's;[^/]*/;|____;g;s;____|; |;g'"
fi fi
@ -69,12 +75,16 @@ alias md='mkdir -p'
alias rd='rmdir' alias rd='rmdir'
# Shorten extract # Shorten extract
alias xt='extract' alias xt="extract"
# sudo editors
alias svim="sudo vim"
alias snano="sudo nano"
# Display whatever file is regular file or folder # Display whatever file is regular file or folder
function catt() { catt() {
for i in "$@"; do for i in "$@"; do
if [[ -d "$i" ]]; then if [ -d "$i" ]; then
ls "$i" ls "$i"
else else
cat "$i" cat "$i"
@ -88,5 +98,5 @@ function catt() {
# aliases and enable just the ones for Bash-it explicitly: # aliases and enable just the ones for Bash-it explicitly:
# bash-it disable alias general # bash-it disable alias general
# bash-it enable alias bash-it # bash-it enable alias bash-it
# shellcheck source-path=SCRIPTDIR # shellcheck source=./bash-it.aliases.bash
source "$BASH_IT/aliases/available/bash-it.aliases.bash" source "$BASH_IT/aliases/available/bash-it.aliases.bash"

View File

@ -1,4 +1,5 @@
# shellcheck shell=bash # shellcheck shell=bash
cite 'about-alias'
about-alias 'common git abbreviations' about-alias 'common git abbreviations'
alias g='git' alias g='git'
@ -8,18 +9,13 @@ alias get='git'
alias ga='git add' alias ga='git add'
alias gall='git add -A' alias gall='git add -A'
alias gap='git add -p' alias gap='git add -p'
alias gav='git add -v'
# branch # branch
alias gb='git branch' alias gb='git branch'
alias gba='git branch --all'
alias gbd='git branch -d'
alias gbD='git branch -D' alias gbD='git branch -D'
alias gbl='git branch --list' alias gba='git branch -a'
alias gbla='git branch --list --all' alias gbd='git branch -d'
alias gblr='git branch --list --remotes' alias gbm='git branch -m'
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'
@ -41,8 +37,8 @@ alias gcb='git checkout -b'
alias gco='git checkout' alias gco='git checkout'
alias gcob='git checkout -b' alias gcob='git checkout -b'
alias gcobu='git checkout -b ${USER}/' alias gcobu='git checkout -b ${USER}/'
alias gcom='git checkout $(get_default_branch)' alias gcom='git checkout master'
alias gcpd='git checkout $(get_default_branch); git pull; git branch -D' alias gcpd='git checkout master; git pull; git branch -D'
alias gct='git checkout --track' alias gct='git checkout --track'
# clone # clone
@ -68,14 +64,13 @@ alias gf='git fetch --all --prune'
alias gft='git fetch --all --prune --tags' alias gft='git fetch --all --prune --tags'
alias gftv='git fetch --all --prune --tags --verbose' alias gftv='git fetch --all --prune --tags --verbose'
alias gfv='git fetch --all --prune --verbose' alias gfv='git fetch --all --prune --verbose'
alias gmu='git fetch origin -v; git fetch upstream -v; git merge upstream/$(get_default_branch)' alias gmu='git fetch origin -v; git fetch upstream -v; git merge upstream/master'
alias gup='git fetch && git rebase' alias gup='git fetch && git rebase'
# log # log
alias gg='git log --graph --pretty=format:'\''%C(bold)%h%Creset%C(magenta)%d%Creset %s %C(yellow)<%an> %C(cyan)(%cr)%Creset'\'' --abbrev-commit --date=relative' alias gg='git log --graph --pretty=format:'\''%C(bold)%h%Creset%C(magenta)%d%Creset %s %C(yellow)<%an> %C(cyan)(%cr)%Creset'\'' --abbrev-commit --date=relative'
alias ggf='git log --graph --date=short --pretty=format:'\''%C(auto)%h %Cgreen%an%Creset %Cblue%cd%Creset %C(auto)%d %s'\''' alias ggf='git log --graph --date=short --pretty=format:'\''%C(auto)%h %Cgreen%an%Creset %Cblue%cd%Creset %C(auto)%d %s'\'''
alias ggs='gg --stat' alias ggs='gg --stat'
alias ggup='git log --branches --not --remotes --no-walk --decorate --oneline' # FROM https://stackoverflow.com/questions/39220870/in-git-list-names-of-branches-with-unpushed-commits
alias gll='git log --graph --pretty=oneline --abbrev-commit' alias gll='git log --graph --pretty=oneline --abbrev-commit'
alias gnew='git log HEAD@{1}..HEAD@{0}' # Show commits since last pull, see http://blogs.atlassian.com/2014/10/advanced-git-aliases/ alias gnew='git log HEAD@{1}..HEAD@{0}' # Show commits since last pull, see http://blogs.atlassian.com/2014/10/advanced-git-aliases/
alias gwc='git whatchanged' alias gwc='git whatchanged'
@ -109,7 +104,7 @@ alias gp='git push'
alias gpd='git push --delete' alias gpd='git push --delete'
alias gpf='git push --force' alias gpf='git push --force'
alias gpo='git push origin HEAD' alias gpo='git push origin HEAD'
alias gpom='git push origin $(get_default_branch)' alias gpom='git push origin master'
alias gpu='git push --set-upstream' alias gpu='git push --set-upstream'
alias gpunch='git push --force-with-lease' alias gpunch='git push --force-with-lease'
alias gpuo='git push --set-upstream origin' alias gpuo='git push --set-upstream origin'
@ -117,7 +112,7 @@ alias gpuoc='git push --set-upstream origin $(git symbolic-ref --short HEAD)'
# pull # pull
alias gl='git pull' alias gl='git pull'
alias glum='git pull upstream $(get_default_branch)' alias glum='git pull upstream master'
alias gpl='git pull' alias gpl='git pull'
alias gpp='git pull && git push' alias gpp='git pull && git push'
alias gpr='git pull --rebase' alias gpr='git pull --rebase'
@ -132,11 +127,9 @@ alias grm='git rm'
# rebase # rebase
alias grb='git rebase' alias grb='git rebase'
alias grbc='git rebase --continue' alias grm='git rebase master'
alias grm='git rebase $(get_default_branch)' alias grmi='git rebase master -i'
alias grmi='git rebase $(get_default_branch) -i' alias gprom='git fetch origin master && git rebase origin/master && git update-ref refs/heads/master origin/master' # Rebase with latest remote master
alias grma='GIT_SEQUENCE_EDITOR=: git rebase $(get_default_branch) -i --autosquash'
alias gprom='git fetch origin $(get_default_branch) && git rebase origin/$(get_default_branch) && git update-ref refs/heads/$(get_default_branch) origin/$(get_default_branch)' # Rebase with latest remote
# reset # reset
alias gus='git reset HEAD' alias gus='git reset HEAD'
@ -180,7 +173,7 @@ alias gsu='git submodule update --init --recursive'
# these aliases requires git v2.23+ # these aliases requires git v2.23+
alias gsw='git switch' alias gsw='git switch'
alias gswc='git switch --create' alias gswc='git switch --create'
alias gswm='git switch $(get_default_branch)' alias gswm='git switch master'
alias gswt='git switch --track' alias gswt='git switch --track'
# tag # tag
@ -202,11 +195,3 @@ esac
function gdv() { function gdv() {
git diff --ignore-all-space "$@" | vim -R - git diff --ignore-all-space "$@" | vim -R -
} }
function get_default_branch() {
if git branch | grep -q '^. main\s*$'; then
echo main
else
echo master
fi
}

View File

@ -1,4 +1,4 @@
# shellcheck shell=bash cite 'about-alias'
about-alias 'common git-svn abbreviations' about-alias 'common git-svn abbreviations'
# Aliases # Aliases

View File

@ -1,4 +1,4 @@
# shellcheck shell=bash cite 'about-alias'
about-alias 'heroku task abbreviations' about-alias 'heroku task abbreviations'
# heroku # heroku

View File

@ -1,4 +1,4 @@
# shellcheck shell=bash cite 'about-alias'
about-alias 'mercurial abbreviations' about-alias 'mercurial abbreviations'
alias hs='hg status' alias hs='hg status'

View File

@ -1,5 +1,7 @@
# shellcheck shell=bash # Some aliases for Homebrew Cask
about-alias 'Some aliases for Homebrew Cask'
cite 'about-alias'
about-alias 'homebrew-cask abbreviations'
alias bcin='brew cask install' alias bcin='brew cask install'
alias bcrm='brew cask uninstall' alias bcrm='brew cask uninstall'

View File

@ -1,5 +1,7 @@
# shellcheck shell=bash # Some aliases for Homebrew
about-alias 'Some aliases for Homebrew'
cite 'about-alias'
about-alias 'homebrew abbreviations'
alias bup='brew update && brew upgrade' alias bup='brew update && brew upgrade'
alias bout='brew outdated' alias bout='brew outdated'

View File

@ -1,4 +1,4 @@
# shellcheck shell=bash cite 'about-alias'
about-alias 'homesick aliases' about-alias 'homesick aliases'
# Aliases # Aliases
@ -19,5 +19,6 @@ alias sikpsh="homesick push dotfiles"
alias sikrc="homesick rc dotfiles" alias sikrc="homesick rc dotfiles"
alias sikpth="homesick show_path dotfiles" alias sikpth="homesick show_path dotfiles"
alias sikst="homesick status dotfiles" alias sikst="homesick status dotfiles"
alias siktrk="homesick track $1 dotfiles"
alias sikulnk="homesick unlink dotfiles" alias sikulnk="homesick unlink dotfiles"
alias sikv="homesick version" alias sikv="homesick version"

View File

@ -1,4 +1,4 @@
# shellcheck shell=bash cite 'about-alias'
about-alias 'jitsu task abbreviations' about-alias 'jitsu task abbreviations'
# jitsu # jitsu

View File

@ -1,6 +1,12 @@
# shellcheck shell=bash #!/bin/bash
#
# -binaryanomaly
cite 'about-alias'
about-alias 'kubectl aliases' about-alias 'kubectl aliases'
function _set_pkg_aliases()
{
if _command_exists kubectl; then if _command_exists kubectl; then
alias kc='kubectl' alias kc='kubectl'
alias kcgp='kubectl get pods' alias kcgp='kubectl get pods'
@ -14,3 +20,6 @@ if _command_exists kubectl; then
# launches a disposable netshoot pod in the k8s cluster # launches a disposable netshoot pod in the k8s cluster
alias kcnetshoot='kubectl run netshoot-$(date +%s) --rm -i --tty --image nicolaka/netshoot -- /bin/bash' alias kcnetshoot='kubectl run netshoot-$(date +%s) --rm -i --tty --image nicolaka/netshoot -- /bin/bash'
fi fi
}
_set_pkg_aliases

View File

@ -1,9 +1,9 @@
# shellcheck shell=bash cite 'about-alias'
about-alias 'laravel artisan abbreviations' about-alias 'laravel artisan abbreviations'
# A list of useful laravel aliases # A list of useful laravel aliases
alias laravel='${HOME?}/.composer/vendor/bin/laravel' alias laravel="${HOME}/.composer/vendor/bin/laravel"
# asset # asset
alias a:apub='php artisan asset:publish' alias a:apub='php artisan asset:publish'

View File

@ -1,4 +1,4 @@
# shellcheck shell=bash cite 'about-alias'
about-alias 'maven abbreviations' about-alias 'maven abbreviations'
alias mci='mvn clean install' alias mci='mvn clean install'

View File

@ -1,4 +1,6 @@
# shellcheck shell=bash #!/bin/bash
cite 'about-alias'
about-alias 'MSYS2 aliases' about-alias 'MSYS2 aliases'
LS_COMMON="-hG" LS_COMMON="-hG"
@ -7,8 +9,7 @@ LS_COMMON="$LS_COMMON -I NTUSER.DAT\* -I ntuser.dat\*"
# alias # alias
# setup the main ls alias if we've established common args # setup the main ls alias if we've established common args
alias ls='command ls ${LS_COMMON:-}' test -n "$LS_COMMON" && alias ls="command ls $LS_COMMON"
alias ll="ls -l" alias ll="ls -l"
alias la="ls -a" alias la="ls -a"
alias lal="ll -a" alias lal="ll -a"
alias lf="ls -F"

View File

@ -1,4 +1,4 @@
# shellcheck shell=bash cite 'about-alias'
about-alias 'the Node.js environment aliases' about-alias 'the Node.js environment aliases'
# alias to setup nodejs development environment # alias to setup nodejs development environment

View File

@ -1,4 +1,4 @@
# shellcheck shell=bash cite 'about-alias'
about-alias 'common npm abbreviations' about-alias 'common npm abbreviations'
# Aliases # Aliases
@ -22,7 +22,6 @@ alias nud='npm update'
alias nr='npm run' alias nr='npm run'
alias nls='npm list --depth=0 2>/dev/null' alias nls='npm list --depth=0 2>/dev/null'
alias nlsg='npm list -g --depth=0 2>/dev/null' alias nlsg='npm list -g --depth=0 2>/dev/null'
alias nt='npm test'
# npx # npx
alias nx='npx' alias nx='npx'

View File

@ -1,27 +1,26 @@
# shellcheck shell=bash cite 'about-alias'
about-alias 'osx-specific aliases' about-alias 'osx-specific aliases'
# Desktop Programs # Desktop Programs
alias fireworks='open -a "/Applications/Adobe Fireworks CS3/Adobe Fireworks CS3.app"' alias fireworks="open -a '/Applications/Adobe Fireworks CS3/Adobe Fireworks CS3.app'"
alias photoshop='open -a "/Applications/Adobe Photoshop CS3/Adobe Photoshop.app"' alias photoshop="open -a '/Applications/Adobe Photoshop CS3/Adobe Photoshop.app'"
alias preview='open -a "${PREVIEW?}"' alias preview="open -a '$PREVIEW'"
alias xcode='open -a "/Applications/XCode.app"' alias xcode="open -a '/Applications/XCode.app'"
alias filemerge='open -a "/Developer/Applications/Utilities/FileMerge.app"' alias filemerge="open -a '/Developer/Applications/Utilities/FileMerge.app'"
alias safari='open -a safari' alias safari="open -a safari"
alias firefox='open -a firefox' alias firefox="open -a firefox"
alias chrome='open -a "Google Chrome"' alias chrome="open -a google\ chrome"
alias chromium='open -a chromium' alias chromium="open -a chromium"
alias brave='open -a "Brave Browser"' alias dashcode="open -a dashcode"
alias dashcode='open -a dashcode'
alias f='open -a Finder ' alias f='open -a Finder '
alias fh='open -a Finder .' alias fh='open -a Finder .'
alias textedit='open -a TextEdit' alias textedit='open -a TextEdit'
alias hex='open -a "Hex Fiend"' alias hex='open -a "Hex Fiend"'
alias skype='open -a Skype' alias skype='open -a Skype'
alias mou='open -a Mou' alias mou='open -a Mou'
alias subl='open -a "Sublime Text"' alias subl='open -a Sublime\ Text'
if [[ -s /usr/bin/firefox ]]; then if [ -s /usr/bin/firefox ] ; then
unalias firefox unalias firefox
fi fi
@ -38,20 +37,19 @@ alias whotunes='lsof -r 2 -n -P -F n -c iTunes -a -i TCP@`hostname`:3689'
alias flush='dscacheutil -flushcache' alias flush='dscacheutil -flushcache'
# Show/hide hidden files (for Mac OS X Mavericks) # Show/hide hidden files (for Mac OS X Mavericks)
alias showhidden='defaults write com.apple.finder AppleShowAllFiles TRUE' alias showhidden="defaults write com.apple.finder AppleShowAllFiles TRUE"
alias hidehidden='defaults write com.apple.finder AppleShowAllFiles FALSE' alias hidehidden="defaults write com.apple.finder AppleShowAllFiles FALSE"
# From http://apple.stackexchange.com/questions/110343/copy-last-command-in-terminal # From http://apple.stackexchange.com/questions/110343/copy-last-command-in-terminal
# shellcheck disable=SC2142 # The quoting confuses `shellcheck`... alias copyLastCmd='fc -ln -1 | awk '\''{$1=$1}1'\'' ORS='\'''\'' | pbcopy'
alias copyLastCmd="fc -ln -1 | awk '{\$1=\$1}1' ORS='' | pbcopy"
# Use Finder's Quick Look on a file (^C or space to close) # Use Finder's Quick Look on a file (^C or space to close)
alias ql='qlmanage -p 2>/dev/null' alias ql='qlmanage -p 2>/dev/null'
# Mute/Unmute the system volume. Plays nice with all other volume settings. # Mute/Unmute the system volume. Plays nice with all other volume settings.
alias mute='osascript -e "set volume output muted true"' alias mute="osascript -e 'set volume output muted true'"
alias unmute='osascript -e "set volume output muted false"' alias unmute="osascript -e 'set volume output muted false'"
# Pin to the tail of long commands for an audible alert after long processes # Pin to the tail of long commands for an audible alert after long processes
## curl http://downloads.com/hugefile.zip; lmk ## curl http://downloads.com/hugefile.zip; lmk
alias lmk='say "Process complete."' alias lmk="say 'Process complete.'"

View File

@ -1,4 +1,4 @@
# shellcheck shell=bash cite 'about-alias'
about-alias 'phoenix abbreviations' about-alias 'phoenix abbreviations'
# Phoenix Commands # Phoenix Commands

View File

@ -1,4 +1,4 @@
# shellcheck shell=bash cite 'about-alias'
about-alias 'puppet aliases' about-alias 'puppet aliases'
# Aliases # Aliases

View File

@ -1,4 +1,4 @@
# shellcheck shell=bash cite 'about-alias'
about-alias 'pyrocms abbreviations' about-alias 'pyrocms abbreviations'
### ###

View File

@ -1,4 +1,4 @@
# shellcheck shell=bash cite 'about-alias'
about-alias 'rails abbreviations' about-alias 'rails abbreviations'
# Rails Commands # Rails Commands

View File

@ -1,4 +1,4 @@
# shellcheck shell=bash cite 'about-alias'
about-alias 'common svn abbreviations' about-alias 'common svn abbreviations'
# Aliases # Aliases

View File

@ -1,4 +1,4 @@
# shellcheck shell=bash cite 'about-alias'
about-alias 'systemd service' about-alias 'systemd service'
case $OSTYPE in case $OSTYPE in

View File

@ -1,9 +1,10 @@
# shellcheck shell=bash # Aliases for Terraform and Terragrunt
about-alias 'Aliases for Terraform and Terragrunt'
cite 'about-alias'
about-alias 'Terraform abbreviations'
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'
alias tfd='terraform destroy' alias tfd='terraform destory'

View File

@ -1,5 +1,7 @@
# shellcheck shell=bash # Aliases for Terraform and Terragrunt
about-alias 'Aliases for Terraform and Terragrunt'
cite 'about-alias'
about-alias 'Terragrunt abbreviations'
alias tg='terragrunt' alias tg='terragrunt'
alias tgv='terragrunt validate' alias tgv='terragrunt validate'

View File

@ -1,4 +1,4 @@
# shellcheck shell=bash cite 'about-alias'
about-alias 'textmate abbreviations' about-alias 'textmate abbreviations'
case $OSTYPE in case $OSTYPE in

View File

@ -1,4 +1,4 @@
# shellcheck shell=bash cite 'about-alias'
about-alias 'Tmux terminal multiplexer' about-alias 'Tmux terminal multiplexer'
alias txl='tmux ls' alias txl='tmux ls'

View File

@ -1,8 +1,8 @@
# shellcheck shell=bash cite 'about-alias'
about-alias 'todo.txt-cli abbreviations' about-alias 'todo.txt-cli abbreviations'
alias tls='"${TODO?}" ls' alias tls="$TODO ls"
alias ta='"${TODO?}" a' alias ta="$TODO a"
alias trm='"${TODO?}" rm' alias trm="$TODO rm"
alias tdo='"${TODO?}" do' alias tdo="$TODO do"
alias tpri='"${TODO?}" pri' alias tpri="$TODO pri"

View File

@ -1,4 +1,4 @@
# shellcheck shell=bash cite 'uuid-alias'
about-alias 'uuidgen aliases' about-alias 'uuidgen aliases'
if _command_exists uuid; then # Linux if _command_exists uuid; then # Linux

View File

@ -1,4 +1,4 @@
# shellcheck shell=bash cite 'about-alias'
about-alias 'vagrant aliases' about-alias 'vagrant aliases'
# Aliases # Aliases

View File

@ -1,4 +1,4 @@
# shellcheck shell=bash cite 'about-alias'
about-alias 'vault aliases' about-alias 'vault aliases'
# Aliases # Aliases

View File

@ -1,14 +1,25 @@
# shellcheck shell=bash # shellcheck shell=bash
cite 'about-alias'
about-alias 'vim abbreviations' about-alias 'vim abbreviations'
_command_exists vim || return VIM=$(command -v vim)
GVIM=$(command -v gvim)
MVIM=$(command -v mvim)
alias v='vim' if [[ -n $VIM ]]; then
alias v='$VIM'
# open the vim help in fullscreen incorporated from # open the vim help in fullscreen incorporated from
# https://stackoverflow.com/a/4687513 # https://stackoverflow.com/a/4687513
alias vimh='vim -c ":h | only"' alias vimh='${VIM} -c ":h | only"'
fi
# open vim in new tab is taken from # open vim in new tab is taken from
# http://stackoverflow.com/questions/936501/let-gvim-always-run-a-single-instancek # http://stackoverflow.com/questions/936501/let-gvim-always-run-a-single-instancek
_command_exists mvim && function mvimt { command mvim --remote-tab-silent "$@" || command mvim "$@"; } case $OSTYPE in
_command_exists gvim && function gvimt { command gvim --remote-tab-silent "$@" || command gvim "$@"; } darwin*)
[[ -n $MVIM ]] && function mvimt { command mvim --remote-tab-silent "$@" || command mvim "$@"; }
;;
*)
[[ -n $GVIM ]] && function gvimt { command gvim --remote-tab-silent "$@" || command gvim "$@"; }
;;
esac

View File

@ -1,4 +1,4 @@
# shellcheck shell=bash cite 'about-alias'
about-alias 'yarn package manager aliases' about-alias 'yarn package manager aliases'
# Aliases # Aliases

View File

@ -1,110 +1,159 @@
#!/usr/bin/env bash #!/usr/bin/env bash
# shellcheck source-path=SCRIPTDIR/lib source-path=SCRIPTDIR/scripts
# shellcheck disable=SC2034
#
# Initialize Bash It # Initialize Bash It
BASH_IT_LOG_PREFIX="core: main: " BASH_IT_LOG_PREFIX="core: main: "
: "${BASH_IT:=${BASH_SOURCE%/*}}"
: "${BASH_IT_CUSTOM:=${BASH_IT}/custom}" # Only set $BASH_IT if it's not already set
: "${CUSTOM_THEME_DIR:="${BASH_IT_CUSTOM}/themes"}" if [ -z "$BASH_IT" ]; then
: "${BASH_IT_BASHRC:=${BASH_SOURCE[${#BASH_SOURCE[@]} - 1]}}" # Setting $BASH to maintain backwards compatibility
export BASH_IT=$BASH
BASH="$(bash -c 'echo $BASH')"
export BASH
BASH_IT_OLD_BASH_SETUP=true
fi
# Load composure first, so we support function metadata # Load composure first, so we support function metadata
# shellcheck source-path=SCRIPTDIR/vendor/github.com/erichs/composure # shellcheck disable=SC1090
source "${BASH_IT}/vendor/github.com/erichs/composure/composure.sh" source "${BASH_IT}"/vendor/github.com/erichs/composure/composure.sh
# We need to load logging module first as well in order to be able to log
# shellcheck source=./lib/log.bash
source "${BASH_IT}/lib/log.bash"
# We can only log it now
[ -z "$BASH_IT_OLD_BASH_SETUP" ] || _log_warning "BASH_IT variable not initialized, please upgrade your bash-it version and reinstall it!"
# For backwards compatibility, look in old BASH_THEME location
if [ -z "$BASH_IT_THEME" ]; then
_log_warning "BASH_IT_THEME variable not initialized, please upgrade your bash-it version and reinstall it!"
export BASH_IT_THEME="$BASH_THEME"
unset BASH_THEME
fi
# support 'plumbing' metadata # support 'plumbing' metadata
cite _about _param _example _group _author _version cite _about _param _example _group _author _version
cite about-alias about-plugin about-completion cite about-alias about-plugin about-completion
# Declare our end-of-main finishing hook, but don't use `declare`/`typeset`
_bash_it_library_finalize_hook=()
# We need to load logging module early in order to be able to log
source "${BASH_IT}/lib/log.bash"
# libraries, but skip appearance (themes) for now # libraries, but skip appearance (themes) for now
_log_debug "Loading libraries(except appearance)..." _log_debug "Loading libraries(except appearance)..."
LIB="${BASH_IT}/lib/*.bash"
APPEARANCE_LIB="${BASH_IT}/lib/appearance.bash" APPEARANCE_LIB="${BASH_IT}/lib/appearance.bash"
for _bash_it_main_file_lib in "${BASH_IT}/lib"/*.bash; do for _bash_it_config_file in $LIB; do
[[ "$_bash_it_main_file_lib" == "$APPEARANCE_LIB" ]] && continue if [ "$_bash_it_config_file" != "$APPEARANCE_LIB" ]; then
_bash-it-log-prefix-by-path "${_bash_it_main_file_lib}" filename=${_bash_it_config_file##*/}
filename=${filename%.bash}
BASH_IT_LOG_PREFIX="lib: ${filename}: "
_log_debug "Loading library file..." _log_debug "Loading library file..."
# shellcheck disable=SC1090 # shellcheck disable=SC1090
source "$_bash_it_main_file_lib" source "$_bash_it_config_file"
BASH_IT_LOG_PREFIX="core: main: " fi
done done
# Load the global "enabled" directory, then enabled aliases, completion, plugins # Load vendors
# "_bash_it_main_file_type" param is empty so that files get sourced in glob order BASH_IT_LOG_PREFIX="vendor: "
for _bash_it_main_file_type in "" "aliases" "plugins" "completion"; do for _bash_it_vendor_init in "${BASH_IT}"/vendor/init.d/*.bash; do
BASH_IT_LOG_PREFIX="core: reloader: " _log_debug "Loading \"$(basename "${_bash_it_vendor_init}" .bash)\"..."
# shellcheck disable=SC2140 # shellcheck disable=SC1090
source "${BASH_IT}/scripts/reloader.bash" ${_bash_it_main_file_type:+"skip" "$_bash_it_main_file_type"} source "${_bash_it_vendor_init}"
done
unset _bash_it_vendor_init
BASH_IT_LOG_PREFIX="core: main: " BASH_IT_LOG_PREFIX="core: main: "
# Load the global "enabled" directory
# "family" param is empty so that files get sources in glob order
# shellcheck source=./scripts/reloader.bash
source "${BASH_IT}/scripts/reloader.bash"
# Load enabled aliases, completion, plugins
for file_type in "aliases" "plugins" "completion"; do
# shellcheck source=./scripts/reloader.bash
source "${BASH_IT}/scripts/reloader.bash" "skip" "$file_type"
done done
# Load theme, if a theme was set # Load theme, if a theme was set
# shellcheck source-path=SCRIPTDIR/themes if [[ -n "${BASH_IT_THEME}" ]]; then
if [[ -n "${BASH_IT_THEME:-}" ]]; then _log_debug "Loading \"${BASH_IT_THEME}\" theme..."
_log_debug "Loading theme '${BASH_IT_THEME}'." # Load colors and helpers first so they can be used in base theme
BASH_IT_LOG_PREFIX="themes: colors: "
# shellcheck source=./themes/colors.theme.bash
source "${BASH_IT}/themes/colors.theme.bash"
BASH_IT_LOG_PREFIX="themes: githelpers: " BASH_IT_LOG_PREFIX="themes: githelpers: "
# shellcheck source=./themes/githelpers.theme.bash
source "${BASH_IT}/themes/githelpers.theme.bash" source "${BASH_IT}/themes/githelpers.theme.bash"
BASH_IT_LOG_PREFIX="themes: p4helpers: " BASH_IT_LOG_PREFIX="themes: p4helpers: "
# shellcheck source=./themes/p4helpers.theme.bash
source "${BASH_IT}/themes/p4helpers.theme.bash" source "${BASH_IT}/themes/p4helpers.theme.bash"
BASH_IT_LOG_PREFIX="themes: command_duration: "
# shellcheck source=./themes/command_duration.theme.bash
source "${BASH_IT}/themes/command_duration.theme.bash"
BASH_IT_LOG_PREFIX="themes: base: " BASH_IT_LOG_PREFIX="themes: base: "
# shellcheck source=./themes/base.theme.bash
source "${BASH_IT}/themes/base.theme.bash" source "${BASH_IT}/themes/base.theme.bash"
BASH_IT_LOG_PREFIX="lib: appearance: " BASH_IT_LOG_PREFIX="lib: appearance: "
# appearance (themes) now, after all dependencies # appearance (themes) now, after all dependencies
# shellcheck source=SCRIPTDIR/lib/appearance.bash # shellcheck source=./lib/appearance.bash
source "$APPEARANCE_LIB" source "$APPEARANCE_LIB"
BASH_IT_LOG_PREFIX="core: main: "
fi fi
BASH_IT_LOG_PREFIX="core: main: "
_log_debug "Loading custom aliases, completion, plugins..." _log_debug "Loading custom aliases, completion, plugins..."
for _bash_it_main_file_type in "aliases" "completion" "plugins"; do for file_type in "aliases" "completion" "plugins"; do
_bash_it_main_file_custom="${BASH_IT}/${_bash_it_main_file_type}/custom.${_bash_it_main_file_type}.bash" if [ -e "${BASH_IT}/${file_type}/custom.${file_type}.bash" ]; then
if [[ -s "${_bash_it_main_file_custom}" ]]; then BASH_IT_LOG_PREFIX="${file_type}: custom: "
_bash-it-log-prefix-by-path "${_bash_it_main_file_custom}"
_log_debug "Loading component..." _log_debug "Loading component..."
# shellcheck disable=SC1090 # shellcheck disable=SC1090
source "${_bash_it_main_file_custom}" source "${BASH_IT}/${file_type}/custom.${file_type}.bash"
fi fi
BASH_IT_LOG_PREFIX="core: main: "
done done
# Custom # Custom
BASH_IT_LOG_PREFIX="core: main: "
_log_debug "Loading general custom files..." _log_debug "Loading general custom files..."
for _bash_it_main_file_custom in "${BASH_IT_CUSTOM}"/*.bash "${BASH_IT_CUSTOM}"/*/*.bash; do CUSTOM="${BASH_IT_CUSTOM:=${BASH_IT}/custom}/*.bash ${BASH_IT_CUSTOM:=${BASH_IT}/custom}/**/*.bash"
if [[ -s "${_bash_it_main_file_custom}" ]]; then for _bash_it_config_file in $CUSTOM; do
_bash-it-log-prefix-by-path "${_bash_it_main_file_custom}" if [ -e "${_bash_it_config_file}" ]; then
filename=$(basename "${_bash_it_config_file}")
filename=${filename%*.bash}
BASH_IT_LOG_PREFIX="custom: $filename: "
_log_debug "Loading custom file..." _log_debug "Loading custom file..."
# shellcheck disable=SC1090 # shellcheck disable=SC1090
source "$_bash_it_main_file_custom" source "$_bash_it_config_file"
fi fi
BASH_IT_LOG_PREFIX="core: main: "
done done
if [[ -n "${PROMPT:-}" ]]; then unset _bash_it_config_file
PS1="${PROMPT}" if [[ $PROMPT ]]; then
export PS1="\[""$PROMPT""\]"
fi fi
# Adding Support for other OSes # Adding Support for other OSes
if _command_exists gloobus-preview; then
PREVIEW="gloobus-preview"
elif [[ -d /Applications/Preview.app ]]; then
PREVIEW="/Applications/Preview.app"
else
PREVIEW="less" PREVIEW="less"
if [ -s /usr/bin/gloobus-preview ]; then
PREVIEW="gloobus-preview"
elif [ -s /Applications/Preview.app ]; then
# shellcheck disable=SC2034
PREVIEW="/Applications/Preview.app"
fi
# Load all the Jekyll stuff
if [ -e "$HOME/.jekyllconfig" ]; then
# shellcheck disable=SC1090
. "$HOME/.jekyllconfig"
fi fi
# BASH_IT_RELOAD_LEGACY is set. # BASH_IT_RELOAD_LEGACY is set.
if [[ -n "${BASH_IT_RELOAD_LEGACY:-}" ]] && ! _command_exists reload; then if ! command -v reload &> /dev/null && [ -n "$BASH_IT_RELOAD_LEGACY" ]; then
# shellcheck disable=SC2139 case $OSTYPE in
alias reload="builtin source '${BASH_IT_BASHRC?}'" darwin*)
alias reload='source ~/.bash_profile'
;;
*)
alias reload='source ~/.bashrc'
;;
esac
fi fi
for _bash_it_library_finalize_f in "${_bash_it_library_finalize_hook[@]:-}"; do # Disable trap DEBUG on subshells - https://github.com/Bash-it/bash-it/pull/1040
eval "${_bash_it_library_finalize_f?}" # Use `eval` to achieve the same behavior as `$PROMPT_COMMAND`. set +T
done
unset "${!_bash_it_library_finalize_@}" "${!_bash_it_main_file_@}"

View File

@ -1,7 +1,7 @@
####################################################################### #######################################################################
# Allow-list of files to be lint-checked by CI # Allow-list of files to be lint-checked by CI
# #
# Directory Support # Directory Suport
# Directory references are allowed within the file, ie: # Directory references are allowed within the file, ie:
# #
# themes/powerline # themes/powerline
@ -16,53 +16,71 @@
# root directories # root directories
# #
aliases/ docs
docs/ hooks
hooks/
scripts/
# root files # root files
# #
.gitattributes .gitattributes
bash_it.sh
clean_files.txt
install.sh
lint_clean_files.sh lint_clean_files.sh
install.sh
bash_it.sh
# themes
#
themes/agnoster
themes/90210
themes/powerline
themes/barbuk
themes/atomic
themes/axin
themes/base.theme.bash
themes/bakke
themes/binaryanomaly
themes/bira
themes/bobby
themes/bobby-python
themes/brainy
themes/brunton
themes/command_duration.theme.bash
themes/modern
# plugins
#
plugins/available/basher.plugin.bash
plugins/available/cmd-returned-notify.plugin.bash
plugins/available/docker-machine.plugin.bash
plugins/available/git.plugin.bash
plugins/available/go.plugin.bash
plugins/available/goenv.plugin.bash
plugins/available/history.plugin.bash
plugins/available/history-search.plugin.bash
plugins/available/history-substring-search.plugin.bash
plugins/available/xterm.plugin.bash
# completions # completions
# #
completion/available/apm.completion.bash completion/available/apm.completion.bash
completion/available/awless.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/brew.completion.bash
completion/available/cargo.completion.bash completion/available/cargo.completion.bash
completion/available/composer.completion.bash completion/available/composer.completion.bash
completion/available/conda.completion.bash completion/available/conda.completion.bash
completion/available/consul.completion.bash completion/available/consul.completion.bash
completion/available/dart.completion.bash
completion/available/django.completion.bash completion/available/django.completion.bash
completion/available/dmidecode.completion.bash
completion/available/docker-machine.completion.bash
completion/available/docker.completion.bash completion/available/docker.completion.bash
completion/available/dotnet.completion.bash completion/available/docker-machine.completion.bash
completion/available/flutter.completion.bash
completion/available/gcloud.completion.bash completion/available/gcloud.completion.bash
completion/available/gem.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/go.completion.bash
completion/available/github-cli.completion.bash
completion/available/helm.completion.bash completion/available/helm.completion.bash
completion/available/jboss5.completion.bash
completion/available/jboss7.completion.bash
completion/available/jungle.completion.bash completion/available/jungle.completion.bash
completion/available/knife.completion.bash completion/available/knife.completion.bash
completion/available/kontena.completion.bash completion/available/kontena.completion.bash
completion/available/kubectl.completion.bash completion/available/kubectl.completion.bash
completion/available/laravel.completion.bash
completion/available/lerna.completion.bash completion/available/lerna.completion.bash
completion/available/minikube.completion.bash completion/available/minikube.completion.bash
completion/available/ngrok.completion.bash
completion/available/notify-send.completion.bash completion/available/notify-send.completion.bash
completion/available/npm.completion.bash completion/available/npm.completion.bash
completion/available/packer.completion.bash completion/available/packer.completion.bash
@ -71,106 +89,19 @@ completion/available/pip3.completion.bash
completion/available/pipenv.completion.bash completion/available/pipenv.completion.bash
completion/available/pipx.completion.bash completion/available/pipx.completion.bash
completion/available/rustup.completion.bash completion/available/rustup.completion.bash
completion/available/sdkman.completion.bash
completion/available/system.completion.bash
completion/available/vault.completion.bash completion/available/vault.completion.bash
completion/available/sdkman.completion.bash
completion/available/vuejs.completion.bash completion/available/vuejs.completion.bash
completion/available/wpscan.completion.bash
completion/available/yarn.completion.bash
# libraries # aliases
lib/appearance.bash
lib/colors.bash
lib/command_duration.bash
lib/helpers.bash
lib/history.bash
lib/log.bash
lib/preexec.bash
lib/preview.bash
lib/search.bash
lib/utilities.bash
# plugins
# #
plugins/available/alias-completion.plugin.bash aliases/available/dnf.aliases.bash
plugins/available/autojump.plugin.bash aliases/available/vim.aliases.bash
plugins/available/base.plugin.bash aliases/available/git.aliases.bash
plugins/available/basher.plugin.bash
plugins/available/battery.plugin.bash
plugins/available/blesh.plugin.bash
plugins/available/cmd-returned-notify.plugin.bash
plugins/available/colors.plugin.bash
plugins/available/direnv.plugin.bash
plugins/available/dirs.plugin.bash
plugins/available/docker-machine.plugin.bash
plugins/available/gif.plugin.bash
plugins/available/git-subrepo.plugin.bash
plugins/available/git.plugin.bash
plugins/available/go.plugin.bash
plugins/available/goenv.plugin.bash
plugins/available/history-eternal.plugin.bash
plugins/available/history-search.plugin.bash
plugins/available/history-substring-search.plugin.bash
plugins/available/history.plugin.bash
plugins/available/hub.plugin.bash
plugins/available/java.plugin.bash
plugins/available/jekyll.plugin.bash
plugins/available/jump.plugin.bash
plugins/available/latex.plugin.bash
plugins/available/less-pretty-cat.plugin.bash
plugins/available/man.plugin.bash
plugins/available/nginx.plugin.bash
plugins/available/node.plugin.bash
plugins/available/nodenv.plugin.bash
plugins/available/osx-timemachine.plugin.bash
plugins/available/osx.plugin.bash
plugins/available/percol.plugin.bash
plugins/available/plenv.plugin.bash
plugins/available/projects.plugin.bash
plugins/available/proxy.plugin.bash
plugins/available/pyenv.plugin.bash
plugins/available/python.plugin.bash
plugins/available/rbenv.plugin.bash
plugins/available/ruby.plugin.bash
plugins/available/textmate.plugin.bash
plugins/available/todo.plugin.bash
plugins/available/xterm.plugin.bash
plugins/available/zoxide.plugin.bash
# tests # tests
#
test/completion/aliases.completion.bats
test/run
test/test_helper.bash test/test_helper.bash
# themes
#
themes/90210
themes/agnoster
themes/atomic
themes/axin
themes/bakke
themes/barbuk
themes/base.theme.bash
themes/binaryanomaly
themes/bira
themes/bobby
themes/bobby-python
themes/brainy
themes/brunton
themes/candy
themes/easy
themes/essential
themes/githelpers.theme.bash
themes/modern
themes/norbu
themes/oh-my-posh
themes/p4helpers.theme.bash
themes/pete
themes/powerline
themes/pure
themes/purity
# vendor init files # vendor init files
#
vendor/.gitattributes vendor/.gitattributes
vendor/init.d

View File

@ -1,112 +0,0 @@
# shellcheck shell=bash
about-plugin 'Automatic completion of aliases'
# Load after all aliases and completions to understand what needs to be completed
# BASH_IT_LOAD_PRIORITY: 800
# References:
# http://superuser.com/a/437508/119764
# http://stackoverflow.com/a/1793178/1228454
# Automatically add completion for all aliases to commands having completion functions
function _bash-it-component-completion-callback-on-init-aliases() {
local namespace="alias_completion"
local tmp_file completion_loader alias_name line completions chars
local alias_arg_words new_completion compl_func compl_wrapper alias_defn
# create array of function completion triggers, keeping multi-word triggers together
IFS=$'\n' read -d '' -ra completions < <(complete -p)
((${#completions[@]} == 0)) && return 0
completions=("${completions[@]##complete -* * -}") # strip all but last option plus trigger(s)
completions=("${completions[@]#complete -}") # strip anything missed
completions=("${completions[@]#? * }") # strip last option and arg, leaving only trigger(s)
completions=("${completions[@]#? }") # strip anything missed
#TODO: this will fail on some completions...
# create temporary file for wrapper functions and completions
tmp_file="$(mktemp -t "${namespace}-${RANDOM}XXXXXX")" || return 1
IFS=$'\n' read -r completion_loader < <(complete -p -D 2> /dev/null)
if [[ "${completion_loader#complete }" =~ '-F'[[:space:]]([[:alnum:]_]+)[[:space:]] ]]; then
completion_loader="${BASH_REMATCH[1]}"
else
completion_loader=""
fi
# read in "<alias> '<aliased command>' '<command args>'" lines from defined aliases
# some aliases do have backslashes that needs to be interpreted
# shellcheck disable=SC2162
while read line; do
line="${line#alias -- }"
line="${line#alias }"
alias_name="${line%%=*}"
alias_defn="${line#*=\'}" # alias definition
alias_defn="${alias_defn%\'}"
alias_cmd="${alias_defn%%[[:space:]]*}" # first word of alias
if [[ ${alias_defn} == ${alias_cmd} ]]; then
alias_args=''
else
alias_args="${alias_defn#*[[:space:]]}" # everything after first word
fi
# skip aliases to pipes, boolean control structures and other command lists
chars=$'|&;()<>\n'
if [[ "${alias_defn}" =~ [$chars] ]]; then
continue
fi
# avoid expanding wildcards
read -ra alias_arg_words <<< "$alias_args"
# skip alias if there is no completion function triggered by the aliased command
if ! _bash-it-array-contains-element "$alias_cmd" "${completions[@]}"; then
if [[ -n "$completion_loader" ]]; then
# force loading of completions for the aliased command
"${completion_loader:?}" "${alias_cmd}"
# 124 means completion loader was successful
[[ $? -eq 124 ]] || continue
completions+=("$alias_cmd")
else
continue
fi
fi
new_completion="$(complete -p "$alias_cmd" 2> /dev/null)"
# create a wrapper inserting the alias arguments if any
if [[ -n $alias_args ]]; then
compl_func="${new_completion/#* -F /}"
compl_func="${compl_func%% *}"
# avoid recursive call loops by ignoring our own functions
if [[ "${compl_func#_"$namespace"::}" == "$compl_func" ]]; then
compl_wrapper="_${namespace}::${alias_name}"
echo "function $compl_wrapper {
local compl_word=\${2?}
local prec_word=\${3?}
# check if prec_word is the alias itself. if so, replace it
# with the last word in the unaliased form, i.e.,
# alias_cmd + ' ' + alias_args.
if [[ \$COMP_LINE == \"\$prec_word \$compl_word\" ]]; then
prec_word='$alias_cmd $alias_args'
prec_word=\${prec_word#* }
fi
(( COMP_CWORD += ${#alias_arg_words[@]} ))
COMP_WORDS=(\"$alias_cmd\" \"${alias_arg_words[@]}\" \"\${COMP_WORDS[@]:1}\")
(( COMP_POINT -= \${#COMP_LINE} ))
COMP_LINE=\${COMP_LINE/$alias_name/$alias_cmd $alias_args}
(( COMP_POINT += \${#COMP_LINE} ))
\"$compl_func\" \"$alias_cmd\" \"\$compl_word\" \"\$prec_word\"
}" >> "$tmp_file"
new_completion="${new_completion/ -F $compl_func / -F $compl_wrapper }"
fi
fi
# replace completion trigger by alias
if [[ -n $new_completion ]]; then
new_completion="${new_completion% *} $alias_name"
echo "$new_completion" >> "$tmp_file"
fi
done < <(alias -p)
# shellcheck source=/dev/null
source "$tmp_file" && command rm -f "$tmp_file"
}
_bash-it-component-completion-callback-on-init-aliases

View File

@ -1,5 +1 @@
# shellcheck shell=bash [[ -x "$(which aws_completer)" ]] && complete -C "$(which aws_completer)" aws
if _command_exists aws_completer; then
complete -C "$(command -v aws_completer)" aws
fi

View File

@ -1,95 +1,140 @@
# shellcheck shell=bash #!/usr/bin/env bash
function _compreply_candidates() { _bash-it-comp-enable-disable()
local IFS=$'\n' {
local enable_disable_args="alias completion plugin"
read -d '' -ra COMPREPLY < <(compgen -W "${candidates[*]}" -- "${cur}") COMPREPLY=( $(compgen -W "${enable_disable_args}" -- ${cur}) )
} }
function _bash-it() { _bash-it-comp-list-available-not-enabled()
local cur prev verb file_type candidates suffix {
subdirectory="$1"
local available_things
available_things=$(for f in `compgen -G "${BASH_IT}/$subdirectory/available/*.bash" | sort -d`;
do
file_entity=$(basename $f)
typeset enabled_component=$(command ls "${BASH_IT}/$subdirectory/enabled/"{[0-9]*$BASH_IT_LOAD_PRIORITY_SEPARATOR$file_entity,$file_entity} 2>/dev/null | head -1)
typeset enabled_component_global=$(command ls "${BASH_IT}/enabled/"[0-9]*$BASH_IT_LOAD_PRIORITY_SEPARATOR$file_entity 2>/dev/null | head -1)
if [ -z "$enabled_component" ] && [ -z "$enabled_component_global" ]
then
basename $f | sed -e 's/\(.*\)\..*\.bash/\1/g'
fi
done)
COMPREPLY=( $(compgen -W "all ${available_things}" -- ${cur}) )
}
_bash-it-comp-list-enabled()
{
local subdirectory="$1"
local suffix enabled_things
suffix=$(echo "$subdirectory" | sed -e 's/plugins/plugin/g')
enabled_things=$(for f in `sort -d <(compgen -G "${BASH_IT}/$subdirectory/enabled/*.${suffix}.bash") <(compgen -G "${BASH_IT}/enabled/*.${suffix}.bash")`;
do
basename $f | sed -e 's/\(.*\)\..*\.bash/\1/g' | sed -e "s/^[0-9]*---//g"
done)
COMPREPLY=( $(compgen -W "all ${enabled_things}" -- ${cur}) )
}
_bash-it-comp-list-available()
{
subdirectory="$1"
local enabled_things
enabled_things=$(for f in `compgen -G "${BASH_IT}/$subdirectory/available/*.bash" | sort -d`;
do
basename $f | sed -e 's/\(.*\)\..*\.bash/\1/g'
done)
COMPREPLY=( $(compgen -W "${enabled_things}" -- ${cur}) )
}
_bash-it-comp()
{
local cur prev opts
COMPREPLY=() COMPREPLY=()
cur="${COMP_WORDS[COMP_CWORD]}" cur="${COMP_WORDS[COMP_CWORD]}"
prev="${COMP_WORDS[COMP_CWORD-1]}" prev="${COMP_WORDS[COMP_CWORD-1]}"
verb="${COMP_WORDS[1]}" chose_opt="${COMP_WORDS[1]}"
file_type="${COMP_WORDS[2]:-}" file_type="${COMP_WORDS[2]}"
candidates=('disable' 'enable' 'help' 'migrate' 'reload' 'restart' 'preview' 'profile' 'doctor' 'search' 'show' 'update' 'version') opts="disable enable help migrate reload restart doctor search show update version"
case "${verb}" in case "${chose_opt}" in
show) show)
candidates=('aliases' 'completions' 'plugins') local show_args="aliases completions plugins"
_compreply_candidates COMPREPLY=( $(compgen -W "${show_args}" -- ${cur}) )
return 0
;; ;;
help) help)
if [[ "${prev}" == "aliases" ]]; then if [ x"${prev}" == x"aliases" ]; then
candidates=('all' "$(_bash-it-component-list "${file_type}")") _bash-it-comp-list-available aliases
_compreply_candidates return 0
else else
candidates=('aliases' 'completions' 'migrate' 'plugins' 'update') local help_args="aliases completions migrate plugins update"
_compreply_candidates COMPREPLY=( $(compgen -W "${help_args}" -- ${cur}) )
return 0
fi fi
;; ;;
profile)
case "${file_type}" in
load | rm)
if [[ "${file_type}" == "$prev" ]]; then
candidates=("${BASH_IT}/profiles"/*.bash_it)
candidates=("${candidates[@]##*/}")
candidates=("${candidates[@]%%.bash_it}")
_compreply_candidates
fi
;;
save | list) ;;
*)
candidates=('load' 'save' 'list' 'rm')
_compreply_candidates
;;
esac
;;
doctor) doctor)
candidates=('errors' 'warnings' 'all') local doctor_args="errors warnings all"
_compreply_candidates COMPREPLY=( $(compgen -W "${doctor_args}" -- ${cur}) )
return 0
;; ;;
update) update)
if [[ "${cur}" == -* ]]; then if [[ ${cur} == -* ]];then
candidates=('-s' '--silent') local update_args="-s --silent"
else else
candidates=('stable' 'dev') local update_args="stable dev"
fi fi
_compreply_candidates COMPREPLY=( $(compgen -W "${update_args}" -- ${cur}) )
return 0
;; ;;
migrate | reload | restart | search | version) ;; migrate | reload | search | version)
preview)
_bash-it-preview # completes itself
return 0 return 0
;; ;;
enable | disable) enable | disable)
if [[ "${verb}" == "enable" ]]; then if [ x"${chose_opt}" == x"enable" ];then
suffix="disabled" suffix="available-not-enabled"
else else
suffix="enabled" suffix="enabled"
fi fi
case "${file_type}" in case "${file_type}" in
alias | completion | plugin) alias)
candidates=('all' "$("_bash-it-component-list-${suffix}" "${file_type}")") _bash-it-comp-list-${suffix} aliases
_compreply_candidates return 0
;;
plugin)
_bash-it-comp-list-${suffix} plugins
return 0
;;
completion)
_bash-it-comp-list-${suffix} completion
return 0
;; ;;
*) *)
candidates=('alias' 'completion' 'plugin') _bash-it-comp-enable-disable
_compreply_candidates return 0
;; ;;
esac esac
;; ;;
*)
_compreply_candidates
;;
esac esac
COMPREPLY=( $(compgen -W "${opts}" -- ${cur}) )
return 0
} }
# Activate completion for bash-it and its common misspellings # Activate completion for bash-it and its common misspellings
complete -F _bash-it bash-it complete -F _bash-it-comp bash-it
complete -F _bash-it bash-ti complete -F _bash-it-comp bash-ti
complete -F _bash-it shit complete -F _bash-it-comp shit
complete -F _bash-it bashit complete -F _bash-it-comp bashit
complete -F _bash-it batshit complete -F _bash-it-comp batshit
complete -F _bash-it bash_it complete -F _bash-it-comp bash_it

View File

@ -5,26 +5,28 @@ about-completion "brew completion"
# Load late to make sure `system` completion loads first # Load late to make sure `system` completion loads first
# BASH_IT_LOAD_PRIORITY: 375 # BASH_IT_LOAD_PRIORITY: 375
if [[ "$OSTYPE" != 'darwin'* ]]; then if [[ "$(uname -s)" != 'Darwin' ]]; then
_log_warning "unsupported operating system - only 'Darwin' is supported" _log_warning "unsupported operating system - only 'Darwin' is supported"
return 0 return 0
fi fi
# Make sure brew is installed # Make sure brew is installed
_bash_it_homebrew_check || return 0 _command_exists brew || return 0
if [[ -r "$BASH_IT_HOMEBREW_PREFIX/etc/bash_completion.d/brew" ]]; then BREW_PREFIX=${BREW_PREFIX:-$(brew --prefix)}
# shellcheck disable=1090,1091
source "$BASH_IT_HOMEBREW_PREFIX/etc/bash_completion.d/brew"
elif [[ -r "$BASH_IT_HOMEBREW_PREFIX/Library/Contributions/brew_bash_completion.sh" ]]; then if [[ -r "$BREW_PREFIX"/etc/bash_completion.d/brew ]]; then
# shellcheck disable=1090,1091 # shellcheck disable=1090
source "$BASH_IT_HOMEBREW_PREFIX/Library/Contributions/brew_bash_completion.sh" source "$BREW_PREFIX"/etc/bash_completion.d/brew
elif [[ -f "$BASH_IT_HOMEBREW_PREFIX/completions/bash/brew" ]]; then elif [[ -r "$BREW_PREFIX"/Library/Contributions/brew_bash_completion.sh ]]; then
# shellcheck disable=1090
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: # 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,1091 # shellcheck disable=1090
source "$BASH_IT_HOMEBREW_PREFIX/completions/bash/brew" source "$BREW_PREFIX"/completions/bash/brew
fi fi

View File

@ -3,14 +3,14 @@ cite "about-completion"
about-completion "composer completion" about-completion "composer completion"
function __composer_completion() { function __composer_completion() {
local cur coms opts com words local cur coms opts com
COMPREPLY=() COMPREPLY=()
_get_comp_words_by_ref -n : cur words _get_comp_words_by_ref -n : cur words
# lookup for command # lookup for command
for word in "${words[@]:1}"; do for word in "${words[@]:1}"; do
if [[ "${word}" != -* ]]; then if [[ $word != -* ]]; then
com="${word}" com=$word
break break
fi fi
done done
@ -19,7 +19,7 @@ function __composer_completion() {
if [[ ${cur} == --* ]]; then if [[ ${cur} == --* ]]; then
opts="--help --quiet --verbose --version --ansi --no-ansi --no-interaction --profile --no-plugins --working-dir" opts="--help --quiet --verbose --version --ansi --no-ansi --no-interaction --profile --no-plugins --working-dir"
case "${com}" in case "$com" in
about) about)
opts="${opts} " opts="${opts} "
;; ;;
@ -109,18 +109,18 @@ function __composer_completion() {
# shellcheck disable=SC2207 # shellcheck disable=SC2207
COMPREPLY=($(compgen -W "${opts}" -- "${cur}")) COMPREPLY=($(compgen -W "${opts}" -- "${cur}"))
__ltrim_colon_completions "${cur}" __ltrim_colon_completions "$cur"
return 0 return 0
fi fi
# completing for a command # completing for a command
if [[ "${cur}" == "${com}" ]]; then 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" 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"
# shellcheck disable=SC2207 # shellcheck disable=SC2207
COMPREPLY=($(compgen -W "${coms}" -- "${cur}")) COMPREPLY=($(compgen -W "${coms}" -- "${cur}"))
__ltrim_colon_completions "${cur}" __ltrim_colon_completions "$cur"
return 0 return 0
fi fi

View File

@ -3,5 +3,5 @@ cite "about-completion"
about-completion "Hashicorp consul completion" about-completion "Hashicorp consul completion"
if _command_exists consul; then if _command_exists consul; then
complete -C "$(command -v consul)" consul complete -C "$(which consul)" consul
fi fi

View File

@ -1,48 +0,0 @@
# shellcheck shell=bash
__dart_completion() {
# shellcheck disable=SC2155
local prev=$(_get_pword)
# shellcheck disable=SC2155
local curr=$(_get_cword)
local HELP="--help -h"
local VERBOSE="-v --verbose"
case $prev in
analyze)
# shellcheck disable=SC2207
COMPREPLY=($(compgen -W "$HELP --fatal-infos --no-fatal-warnings --fatal-warnings" -- "$curr"))
;;
compile)
# shellcheck disable=SC2207
COMPREPLY=($(compgen -W "$HELP aot-snapshot exe js jit-snapshot kernel" -- "$curr"))
;;
create)
# shellcheck disable=SC2207
COMPREPLY=($(compgen -W "$HELP --template -t --no-pub --pub --force" -- "$curr"))
;;
-t | --template)
# shellcheck disable=SC2207
COMPREPLY=($(compgen -W "console-simple console-full package-simple web-simple" -- "$curr"))
;;
format)
# shellcheck disable=SC2207
COMPREPLY=($(compgen -W "$HELP $VERBOSE -o --output --fix -l --line-length" -- "$curr"))
;;
pub)
# shellcheck disable=SC2207
COMPREPLY=($(compgen -W "$HELP $VERBOSE --version --no-trace --trace --verbosity cache deps downgrade get global logout outdated publish run upgrade uploader version" -- "$curr"))
;;
run)
# shellcheck disable=SC2207
COMPREPLY=($(compgen -W "$HELP --observe --enable-vm-service --no-pause-isolates-on-exit --no-pause-isolates-on-unhandled-exceptions --no-warn-on-pause-with-no-debugger --pause-isolates-on-exit --pause-isolates-on-unhandled-exceptions --warn-on-pause-with-no-debugger" -- "$curr"))
;;
dart)
# shellcheck disable=SC2207
COMPREPLY=($(compgen -W "$HELP $VERBOSE --version --enable-analytics --disable-analytics help analyze compile create format pub run test" -- "$curr"))
;;
esac
}
complete -F __dart_completion dart

View File

@ -1,5 +1,175 @@
# shellcheck shell=bash # defaults
# Bash command line completion for defaults
#
# Created by Jonathon Mah on 2006-11-08.
# Copyright 2006 Playhaus. All rights reserved.
#
# Version 1.0 (2006-11-08)
if test -s "${BASH_IT?}/vendor/github.com/gaelicWizard/bash-progcomp/defaults.completion.bash"; then
source "$_" _defaults_domains()
{
local cur
COMPREPLY=()
cur=${COMP_WORDS[COMP_CWORD]}
local domains=$( defaults domains | sed -e 's/, /:/g' | tr : '\n' | sed -e 's/ /\\ /g' | grep -i "^$cur" )
local IFS=$'\n'
COMPREPLY=( $domains )
if [[ $( echo '-app' | grep "^$cur" ) ]]; then
COMPREPLY[${#COMPREPLY[@]}]="-app"
fi fi
return 0
}
_defaults()
{
local cur prev host_opts cmds cmd domain keys key_index
cur=${COMP_WORDS[COMP_CWORD]}
prev=${COMP_WORDS[COMP_CWORD-1]}
host_opts='-currentHost -host'
cmds='read read-type write rename delete domains find help'
if [[ $COMP_CWORD -eq 1 ]]; then
COMPREPLY=( $( compgen -W "$host_opts $cmds" -- $cur ) )
return 0
elif [[ $COMP_CWORD -eq 2 ]]; then
if [[ "$prev" == "-currentHost" ]]; then
COMPREPLY=( $( compgen -W "$cmds" -- $cur ) )
return 0
elif [[ "$prev" == "-host" ]]; then
return 0
_known_hosts -a
else
_defaults_domains
return 0
fi
elif [[ $COMP_CWORD -eq 3 ]]; then
if [[ ${COMP_WORDS[1]} == "-host" ]]; then
_defaults_domains
return 0
fi
fi
# Both a domain and command have been specified
if [[ ${COMP_WORDS[1]} == [${cmds// /|}] ]]; then
cmd=${COMP_WORDS[1]}
domain=${COMP_WORDS[2]}
key_index=3
if [[ "$domain" == "-app" ]]; then
if [[ $COMP_CWORD -eq 3 ]]; then
# Completing application name. Can't help here, sorry
return 0
fi
domain="-app ${COMP_WORDS[3]}"
key_index=4
fi
elif [[ ${COMP_WORDS[2]} == "-currentHost" ]] && [[ ${COMP_WORDS[2]} == [${cmds// /|}] ]]; then
cmd=${COMP_WORDS[2]}
domain=${COMP_WORDS[3]}
key_index=4
if [[ "$domain" == "-app" ]]; then
if [[ $COMP_CWORD -eq 4 ]]; then
# Completing application name. Can't help here, sorry
return 0
fi
domain="-app ${COMP_WORDS[4]}"
key_index=5
fi
elif [[ ${COMP_WORDS[3]} == "-host" ]] && [[ ${COMP_WORDS[3]} == [${cmds// /|}] ]]; then
cmd=${COMP_WORDS[3]}
domain=${COMP_WORDS[4]}
key_index=5
if [[ "$domain" == "-app" ]]; then
if [[ $COMP_CWORD -eq 5 ]]; then
# Completing application name. Can't help here, sorry
return 0
fi
domain="-app ${COMP_WORDS[5]}"
key_index=6
fi
fi
keys=$( defaults read $domain 2>/dev/null | sed -n -e '/^ [^}) ]/p' | sed -e 's/^ \([^" ]\{1,\}\) = .*$/\1/g' -e 's/^ "\([^"]\{1,\}\)" = .*$/\1/g' | sed -e 's/ /\\ /g' )
case $cmd in
read|read-type)
# Complete key
local IFS=$'\n'
COMPREPLY=( $( echo "$keys" | grep -i "^${cur//\\/\\\\}" ) )
;;
write)
if [[ $key_index -eq $COMP_CWORD ]]; then
# Complete key
local IFS=$'\n'
COMPREPLY=( $( echo "$keys" | grep -i "^${cur//\\/\\\\}" ) )
elif [[ $((key_index+1)) -eq $COMP_CWORD ]]; then
# Complete value type
# Unfortunately ${COMP_WORDS[key_index]} fails on keys with spaces
local value_types='-string -data -integer -float -boolean -date -array -array-add -dict -dict-add'
local cur_type=$( defaults read-type $domain ${COMP_WORDS[key_index]} 2>/dev/null | sed -e 's/^Type is \(.*\)/-\1/' -e's/dictionary/dict/' | grep "^$cur" )
if [[ $cur_type ]]; then
COMPREPLY=( $cur_type )
else
COMPREPLY=( $( compgen -W "$value_types" -- $cur ) )
fi
elif [[ $((key_index+2)) -eq $COMP_CWORD ]]; then
# Complete value
# Unfortunately ${COMP_WORDS[key_index]} fails on keys with spaces
COMPREPLY=( $( defaults read $domain ${COMP_WORDS[key_index]} 2>/dev/null | grep -i "^${cur//\\/\\\\}" ) )
fi
;;
rename)
if [[ $key_index -eq $COMP_CWORD ]] ||
[[ $((key_index+1)) -eq $COMP_CWORD ]]; then
# Complete source and destination keys
local IFS=$'\n'
COMPREPLY=( $( echo "$keys" | grep -i "^${cur//\\/\\\\}" ) )
fi
;;
delete)
if [[ $key_index -eq $COMP_CWORD ]]; then
# Complete key
local IFS=$'\n'
COMPREPLY=( $( echo "$keys" | grep -i "^${cur//\\/\\\\}" ) )
fi
;;
esac
return 0
}
complete -F _defaults -o default defaults
# This file is licensed under the BSD license, as follows:
#
# Copyright (c) 2006, Playhaus
# All rights reserved.
#
# Redistribution and use in source and binary forms, with or without
# modification, are permitted provided that the following conditions are met:
#
# * Redistributions of source code must retain the above copyright notice, this
# list of conditions and the following disclaimer.
# * Redistributions in binary form must reproduce the above copyright notice,
# this list of conditions and the following disclaimer in the documentation
# and/or other materials provided with the distribution.
# * Neither the name of the Playhaus nor the names of its contributors may be
# used to endorse or promote products derived from this software without
# specific prior written permission.
#
# This software is provided by the copyright holders and contributors "as is"
# and any express or implied warranties, including, but not limited to, the
# implied warranties of merchantability and fitness for a particular purpose are
# disclaimed. In no event shall the copyright owner or contributors be liable
# for any direct, indirect, incidental, special, exemplary, or consequential
# damages (including, but not limited to, procurement of substitute goods or
# services; loss of use, data, or profits; or business interruption) however
# caused and on any theory of liability, whether in contract, strict liability,
# or tort (including negligence or otherwise) arising in any way out of the use
# of this software, even if advised of the possibility of such damage.

View File

@ -1,22 +0,0 @@
# shellcheck shell=bash
function __dmidecode_completion() {
# shellcheck disable=SC2155
local prev=$(_get_pword)
# shellcheck disable=SC2155
local curr=$(_get_cword)
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"))
;;
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"))
;;
esac
}
complete -F __dmidecode_completion dmidecode

View File

@ -676,7 +676,7 @@ _docker_compose() {
done done
local completions_func=_docker_compose_${command//-/_} local completions_func=_docker_compose_${command//-/_}
_is_function $completions_func && $completions_func declare -F $completions_func >/dev/null && $completions_func
eval "$previous_extglob_setting" eval "$previous_extglob_setting"
return 0 return 0

View File

@ -1,14 +0,0 @@
# shellcheck shell=bash
about-completion "bash parameter completion for the dotnet CLI"
# see https://docs.microsoft.com/en-us/dotnet/core/tools/enable-tab-autocomplete#bash
function _dotnet_bash_complete() {
local cur="${COMP_WORDS[COMP_CWORD]}" IFS=$'\n'
local candidates
read -d '' -ra candidates < <(dotnet complete --position "${COMP_POINT}" "${COMP_LINE}" 2> /dev/null)
read -d '' -ra COMPREPLY < <(compgen -W "${candidates[*]:-}" -- "$cur")
}
complete -f -F _dotnet_bash_complete dotnet

View File

@ -1,4 +1,4 @@
# shellcheck shell=bash #!/usr/bin/env bash
# #
# Bash completion support for Fabric (http://fabfile.org/) # Bash completion support for Fabric (http://fabfile.org/)
# #
@ -41,8 +41,8 @@ export FAB_COMPLETION_CACHED_TASKS_FILENAME=".fab_tasks~"
# Set command to get time of last file modification as seconds since Epoch # Set command to get time of last file modification as seconds since Epoch
case "$OSTYPE" in case `uname` in
'darwin'*|'freebsd'*) Darwin|FreeBSD)
__FAB_COMPLETION_MTIME_COMMAND="stat -f '%m'" __FAB_COMPLETION_MTIME_COMMAND="stat -f '%m'"
;; ;;
*) *)
@ -91,7 +91,7 @@ function __fab_completion() {
-*) -*)
if [[ -z "${__FAB_COMPLETION_LONG_OPT}" ]]; then if [[ -z "${__FAB_COMPLETION_LONG_OPT}" ]]; then
export __FAB_COMPLETION_LONG_OPT=$( export __FAB_COMPLETION_LONG_OPT=$(
fab --help | grep -E -o "\-\-[A-Za-z_\-]+\=?" | sort -u) fab --help | egrep -o "\-\-[A-Za-z_\-]+\=?" | sort -u)
fi fi
opts="${__FAB_COMPLETION_LONG_OPT}" opts="${__FAB_COMPLETION_LONG_OPT}"
;; ;;
@ -101,7 +101,7 @@ function __fab_completion() {
# -*) # -*)
# if [[ -z "${__FAB_COMPLETION_SHORT_OPT}" ]]; then # if [[ -z "${__FAB_COMPLETION_SHORT_OPT}" ]]; then
# export __FAB_COMPLETION_SHORT_OPT=$( # export __FAB_COMPLETION_SHORT_OPT=$(
# fab --help | grep -E -o "^ +\-[A-Za-z_\]" | sort -u) # fab --help | egrep -o "^ +\-[A-Za-z_\]" | sort -u)
# fi # fi
# opts="${__FAB_COMPLETION_SHORT_OPT}" # opts="${__FAB_COMPLETION_SHORT_OPT}"
# ;; # ;;

View File

@ -1,4 +1,4 @@
# shellcheck shell=bash #!/usr/bin/bash
if _command_exists flutter; then if _command_exists flutter; then
eval "$(flutter bash-completion)" eval "$(flutter bash-completion)"

View File

@ -1,9 +1,13 @@
# shellcheck shell=bash #!/usr/bin/env bash
#
# Locate and load completions for `git`. # Only operate on MacOS since there are no linux paths
if [[ "$(uname -s)" != 'Darwin' ]] ; then
_log_warning "unsupported operating system - only 'Darwin' is supported"
return 0
fi
# Make sure git is installed # Make sure git is installed
_command_exists git || return _command_exists git || return 0
# Don't handle completion if it's already managed # Don't handle completion if it's already managed
if complete -p git &>/dev/null ; then if complete -p git &>/dev/null ; then
@ -11,25 +15,17 @@ if complete -p git &> /dev/null; then
return 0 return 0
fi fi
_git_bash_completion_xcrun_git= _git_bash_completion_found=false
if _command_exists xcrun; then
_git_bash_completion_xcrun_git="$(xcrun --find git)"
fi
_git_bash_completion_paths=( _git_bash_completion_paths=(
# Standard locations
"${GIT_EXE%/*}/../share/git-core/git-completion.bash"
"${GIT_EXE%/*}/../share/git-core/contrib/completion/git-completion.bash"
"${GIT_EXE%/*}/../etc/bash_completion.d/git-completion.bash"
# MacOS non-system locations # MacOS non-system locations
"${_git_bash_completion_xcrun_git%/bin/git}/share/git-core/git-completion.bash" '/Library/Developer/CommandLineTools/usr/share/git-core/git-completion.bash'
'/Applications/Xcode.app/Contents/Developer/usr/share/git-core/git-completion.bash'
) )
# Load the first completion file found # Load the first completion file found
_git_bash_completion_found=false
for _comp_path in "${_git_bash_completion_paths[@]}" ; do for _comp_path in "${_git_bash_completion_paths[@]}" ; do
if [[ -r "$_comp_path" ]]; then if [ -r "$_comp_path" ] ; then
_git_bash_completion_found=true _git_bash_completion_found=true
# shellcheck disable=SC1090 # don't follow
source "$_comp_path" source "$_comp_path"
break break
fi fi
@ -39,4 +35,5 @@ done
if [[ "${_git_bash_completion_found}" == false ]]; then if [[ "${_git_bash_completion_found}" == false ]]; then
_log_warning "no completion files found - please try enabling the 'system' completion instead." _log_warning "no completion files found - please try enabling the 'system' completion instead."
fi fi
unset "${!_git_bash_completion@}" unset _git_bash_completion_paths
unset _git_bash_completion_found

View File

@ -172,7 +172,6 @@ __git_flow_list_hotfixes ()
} }
# temporarily wrap __git_find_on_cmdline() for backwards compatibility # temporarily wrap __git_find_on_cmdline() for backwards compatibility
if ! _command_exists __git_find_subcommand if [ -z "`type -t __git_find_subcommand`" ]; then
then
alias __git_find_subcommand=__git_find_on_cmdline alias __git_find_subcommand=__git_find_on_cmdline
fi fi

View File

@ -505,7 +505,6 @@ __git_flow_list_branches ()
} }
# alias __git_find_on_cmdline for backwards compatibility # alias __git_find_on_cmdline for backwards compatibility
if ! _command_exists __git_find_on_cmdline if [ -z "`type -t __git_find_on_cmdline`" ]; then
then
alias __git_find_on_cmdline=__git_find_subcommand alias __git_find_on_cmdline=__git_find_subcommand
fi fi

View File

@ -1,5 +1,3 @@
# shellcheck shell=bash
# Copyright (c) 2017 Eric Wendelin # Copyright (c) 2017 Eric Wendelin
# Permission is hereby granted, free of charge, to any person obtaining a copy of # Permission is hereby granted, free of charge, to any person obtaining a copy of
@ -24,9 +22,17 @@
# Avoid inaccurate completions for subproject tasks # Avoid inaccurate completions for subproject tasks
COMP_WORDBREAKS=$(echo "$COMP_WORDBREAKS" | sed -e 's/://g') COMP_WORDBREAKS=$(echo "$COMP_WORDBREAKS" | sed -e 's/://g')
function __gradle-set-project-root-dir() { __gradle-set-project-root-dir() {
project_root_dir="$(_bash-it-find-in-ancestor "settings.gradle" "gradlew")" local dir=`pwd`
return "$?" project_root_dir=`pwd`
while [[ $dir != '/' ]]; do
if [[ -f "$dir/settings.gradle" || -f "$dir/gradlew" ]]; then
project_root_dir=$dir
return 0
fi
dir="$(dirname "$dir")"
done
return 1
} }
__gradle-init-cache-dir() { __gradle-init-cache-dir() {
@ -52,9 +58,9 @@ __gradle-set-cache-name() {
__gradle-set-files-checksum() { __gradle-set-files-checksum() {
# Cache MD5 sum of all Gradle scripts and modified timestamps # Cache MD5 sum of all Gradle scripts and modified timestamps
if _command_exists md5; then if builtin command -v md5 > /dev/null; then
gradle_files_checksum=$(md5 -q -s "$(cat "$cache_dir/$cache_name" | xargs ls -o 2>/dev/null)") gradle_files_checksum=$(md5 -q -s "$(cat "$cache_dir/$cache_name" | xargs ls -o 2>/dev/null)")
elif _command_exists md5sum; then elif builtin command -v md5sum > /dev/null; then
gradle_files_checksum=$(cat "$cache_dir/$cache_name" | xargs ls -o 2>/dev/null | md5sum | awk '{print $1}') gradle_files_checksum=$(cat "$cache_dir/$cache_name" | xargs ls -o 2>/dev/null | md5sum | awk '{print $1}')
else else
echo "Cannot generate completions as neither md5 nor md5sum exist on \$PATH" echo "Cannot generate completions as neither md5 nor md5sum exist on \$PATH"
@ -68,7 +74,7 @@ __gradle-generate-script-cache() {
if [[ ! $(find $cache_dir/$cache_name -mmin -$cache_ttl_mins 2>/dev/null) ]]; then if [[ ! $(find $cache_dir/$cache_name -mmin -$cache_ttl_mins 2>/dev/null) ]]; then
# Cache all Gradle scripts # Cache all Gradle scripts
local gradle_build_scripts=$(find $project_root_dir -type f -name "*.gradle" -o -name "*.gradle.kts" 2>/dev/null | grep -E -v "$script_exclude_pattern") local gradle_build_scripts=$(find $project_root_dir -type f -name "*.gradle" -o -name "*.gradle.kts" 2>/dev/null | egrep -v "$script_exclude_pattern")
printf "%s\n" "${gradle_build_scripts[@]}" > $cache_dir/$cache_name printf "%s\n" "${gradle_build_scripts[@]}" > $cache_dir/$cache_name
fi fi
} }

View File

@ -23,12 +23,12 @@
# WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. # WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
# If there is no git tab completion, but we have the _completion loader try to load it # If there is no git tab completion, but we have the _completion loader try to load it
if ! _is_function _git && _is_function _completion_loader; then if ! declare -F _git > /dev/null && declare -F _completion_loader > /dev/null; then
_completion_loader git _completion_loader git
fi fi
# Check that git tab completion is available and we haven't already set up completion # Check that git tab completion is available and we haven't already set up completion
if _is_function _git && ! _is_function __git_list_all_commands_without_hub; then if declare -F _git > /dev/null && ! declare -F __git_list_all_commands_without_hub > /dev/null; then
# Duplicate and rename the 'list_all_commands' function # Duplicate and rename the 'list_all_commands' function
eval "$(declare -f __git_list_all_commands | \ eval "$(declare -f __git_list_all_commands | \
sed 's/__git_list_all_commands/__git_list_all_commands_without_hub/')" sed 's/__git_list_all_commands/__git_list_all_commands_without_hub/')"
@ -227,7 +227,7 @@ EOF
((c++)) ((c++))
done done
if [ -z "$name" ]; then if [ -z "$name" ]; then
repo="$(basename "${PWD}")" repo=$(basename "$(pwd)")
fi fi
case "$prev" in case "$prev" in
-d|-h) -d|-h)

View File

@ -1,4 +0,0 @@
# shellcheck shell=bash
about-completion "jboss5 completion"
# shellcheck disable=SC1090
source "${BASH_IT}"/vendor/github.com/rparree/jboss-bash-completion/jboss5

View File

@ -1,4 +1,160 @@
# shellcheck shell=bash # Completions for JBoss Application Server 7 (EAP 6)
about-completion "jboss7 completion" # VERSION: 0.6
# shellcheck disable=SC1090 # DATE: 2012-10-30
source "${BASH_IT}"/vendor/github.com/rparree/jboss-bash-completion/jboss7 # rparree-at-edc4it-dot-com
# MIT License
# Copyright (c) 2020 Raphael Parree
# Permission is hereby granted, free of charge, to any person obtaining a copy
# of this software and associated documentation files (the "Software"), to deal
# in the Software without restriction, including without limitation the rights
# to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
# copies of the Software, and to permit persons to whom the Software is
# furnished to do so, subject to the following conditions:
# The above copyright notice and this permission notice shall be included in all
# copies or substantial portions of the Software.
# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
# FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
# AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
# LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
# OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
# SOFTWARE.
_serverProfiles(){
if [[ $COMP_WORDS == *standalone.sh* ]]
then
serverdir="../standalone/configuration/"
else
# assume is domain.sh
serverdir="../domain/configuration/"
fi
for i in ${!COMP_WORDS[*]}
do
if [[ "${COMP_WORDS[i]}" == "-Djboss.server.base.dir" || "${COMP_WORDS[i]}" == "-Djboss.domain.base.dir" ]]; then
serverdir="${COMP_WORDS[i+2]}/configuration"
fi
done
if [ -d "${serverdir}" ]
then
IFS=$'\n' tmp="$(ls "${serverdir}" | grep xml)"
local fls="${tmp[@]// /\ }"
unset IFS
COMPREPLY=( $(compgen -W "${fls} initial boot last v" -- "$cur" ))
fi
}
_bindingAddress(){
# from /etc/bash_completion.d/ssh
COMPREPLY=( "${COMPREPLY[@]}" $( compgen -W \
"0.0.0.0 $( PATH="$PATH:/sbin" ifconfig -a | \
sed -ne 's/.*addr:\([^[:space:]]*\).*/\1/p' \
-ne 's/.*inet[[:space:]]\{1,\}\([^[:space:]]*\).*/\1/p' )" \
-- "$cur" ) )
}
_jboss(){
local cur prev words cword
COMPREPLY=()
_get_comp_words_by_ref -n = cur prev words cword
case $cur in
-Djboss.socket.binding.port-offset=*)
cur=${cur#*=}
#static list of common bindings sets
local bindings="100 200 300 400 10000 20000 30000 40000"
COMPREPLY=( $(compgen -W "${bindings}" -- ${cur}) )
return 0
;;
-Djboss.default.jgroups.stack=*)
cur=${cur#*=}
#static list of standard JGroups stacks
local stacks="udp udp-async udp-sync tcp tcp-sync"
COMPREPLY=( $(compgen -W "${stacks}" -- ${cur}) )
return 0
;;
-Dorg.jboss.ejb3.remoting.IsLocalInterceptor.passByRef=*|-Dcom.sun.management.jmxremote.authenticate=*|-Dcom.sun.management.jmxremote.ssl=*)
cur=${cur#*=}
local booleans="true false"
COMPREPLY=( $(compgen -W "${booleans}" -- ${cur}) )
return 0
;;
-Djboss.server.base.dir=*|-Djboss.home.dir=*|-Djboss.domain.base.dir=*)
cur=${cur#*=}
_filedir -d
return 0
;;
-Djboss.domain.master.address=*|-Djboss.bind.address*=*)
cur=${cur#*=}
_bindingAddress
return 0
;;
--server-config=*|-c=|--host-config=*)
cur=${cur#*=}
_serverProfiles
return 0
esac
case $prev in
-u)
# a few from RFC 2365 IPv4 Local Scope ()
local addresses="239.255.0.1 239.255.0.2 239.255.0.3"
COMPREPLY=( $(compgen -W "${addresses}" -- ${cur}) )
return 0
;;
-b*)
_bindingAddress
return 0
;;
-c)
_serverProfiles
return 0
;;
*)
;;
esac
# *** from jboss5 ********************
# *** -modulepath -c -m -g -l -d -p -n -B -L -C -Djboss.platform.mbeanserver -Djboss.server.base.directory
# *** -Djboss.Domain -Djboss.modcluster.proxyList -Djboss.jvmRoute -Djboss.default.jgroups.stack -Dorg.jboss.ejb3.remoting.IsLocalInterceptor.passByRef -Djboss.platform.mbeanserver -Dcom.sun.management.jmxremote.port -Dcom.sun.management.jmxremote.ssl
# *************************************
# standard commands for standalone and domain mode
local commandsWithoutEqualSign='-b -bmanagement -bunsecure -bpublic --admin-only -h -help -u -version -V -v'
local commandsWithEqualSign='-P -Djboss.node.name -Djboss.home.dir -Djboss.socket.binding.port-offset -Djboss.bind.address.management -Djboss.bind.address -Djboss.bind.address.unsecure'
if [[ $COMP_WORDS == *standalone.sh* ]]
then
commandsWithoutEqualSign="${commandsWithoutEqualSign} -c"
commandsWithEqualSign="${commandsWithEqualSign} --server-config -Djboss.server.base.dir -c"
else
# assume is domain.sh
commandsWithoutEqualSign="${commandsWithoutEqualSign} --backup --cached-dc"
commandsWithEqualSign="${commandsWithEqualSign} -Djboss.domain.master.address --host-config -Djboss.domain.master.port -Djboss.domain.base.dir "
fi
COMPREPLY=( $( compgen -W "$commandsWithoutEqualSign" -- "$cur" )
$( compgen -W "$commandsWithEqualSign" -S '=' -- "$cur" ) )
return 0
}
complete -o nospace -F _jboss standalone.sh
complete -o nospace -F _jboss domain.sh

View File

@ -42,7 +42,6 @@ _KAC_is_file_newer_than() {
_KAC_regen_cache() { _KAC_regen_cache() {
local CACHE_NAME=$1 local CACHE_NAME=$1
local CACHE_PATH="$_KNIFE_AUTOCOMPLETE_CACHE_DIR/$CACHE_NAME" local CACHE_PATH="$_KNIFE_AUTOCOMPLETE_CACHE_DIR/$CACHE_NAME"
# shellcheck disable=SC2155
local TMP_FILE=$(mktemp "$_KAC_CACHE_TMP_DIR/$CACHE_NAME.XXXX") local TMP_FILE=$(mktemp "$_KAC_CACHE_TMP_DIR/$CACHE_NAME.XXXX")
shift 1 shift 1
# discard the temp file if it's empty AND the previous command didn't exit successfully, but still mark the cache as updated # discard the temp file if it's empty AND the previous command didn't exit successfully, but still mark the cache as updated
@ -55,19 +54,18 @@ _KAC_regen_cache() {
# cached files can't have spaces in their names # cached files can't have spaces in their names
_KAC_get_cache_name_from_command() { _KAC_get_cache_name_from_command() {
echo "${@// /_SPACE_}" echo "${@/ /_SPACE_}"
} }
# the reverse operation from the function above # the reverse operation from the function above
_KAC_get_command_from_cache_name() { _KAC_get_command_from_cache_name() {
echo "${@//_SPACE_/ }" echo "${@/_SPACE_/ }"
} }
# given a command as argument, it fetches the cache for that command if it can find it # given a command as argument, it fetches the cache for that command if it can find it
# otherwise it waits for the cache to be generated # otherwise it waits for the cache to be generated
# in either case, it regenerates the cache, and sets the _KAC_CACHE_PATH env variable # in either case, it regenerates the cache, and sets the _KAC_CACHE_PATH env variable
# for obvious reason, do NOT call that in a sub-shell (in particular, no piping) # for obvious reason, do NOT call that in a sub-shell (in particular, no piping)
# shellcheck disable=SC2155
_KAC_get_and_regen_cache() { _KAC_get_and_regen_cache() {
# the cache name can't have space in it # the cache name can't have space in it
local CACHE_NAME=$(_KAC_get_cache_name_from_command "$@") local CACHE_NAME=$(_KAC_get_cache_name_from_command "$@")
@ -102,7 +100,7 @@ _KAC_clean_cache() {
# perform a cache cleaning when loading this file # perform a cache cleaning when loading this file
# On big systems this could baloon up to a 30 second run or more, so not enabling by default. # On big systems this could baloon up to a 30 second run or more, so not enabling by default.
[[ -n "${KNIFE_CACHE_CLEAN}" ]] && _KAC_clean_cache [[ "${KNIFE_CACHE_CLEAN}" ]] && _KAC_clean_cache
##################################### #####################################
### End of cache helper functions ### ### End of cache helper functions ###
@ -120,7 +118,7 @@ _KAC_get_current_base_command() {
local PREVIOUS="knife" local PREVIOUS="knife"
local I=1 local I=1
local CURRENT local CURRENT
while [[ "${I}" -le "${COMP_CWORD}" ]]; do while [ $I -le "$COMP_CWORD" ]; do
# command words are all lower-case # command words are all lower-case
echo "${COMP_WORDS[$I]}" | grep -E "^[a-z]+$" > /dev/null || break echo "${COMP_WORDS[$I]}" | grep -E "^[a-z]+$" > /dev/null || break
CURRENT="$PREVIOUS ${COMP_WORDS[$I]}" CURRENT="$PREVIOUS ${COMP_WORDS[$I]}"
@ -129,13 +127,12 @@ _KAC_get_current_base_command() {
I=$((I + 1)) I=$((I + 1))
done done
_KAC_CURRENT_COMMAND=$PREVIOUS _KAC_CURRENT_COMMAND=$PREVIOUS
[[ "${I}" -le "${COMP_CWORD}" ]] && _KAC_CURRENT_COMMAND_NB_WORDS="${I}" [ $I -le "$COMP_CWORD" ] && _KAC_CURRENT_COMMAND_NB_WORDS=$I
} }
# searches the position of the currently completed argument in the current base command # searches the position of the currently completed argument in the current base command
# (i.e. handles "plural" arguments such as knife cookbook upload cookbook1 cookbook2 and so on...) # (i.e. handles "plural" arguments such as knife cookbook upload cookbook1 cookbook2 and so on...)
# assumes the current base command is complete # assumes the current base command is complete
# shellcheck disable=SC2155
_KAC_get_current_arg_position() { _KAC_get_current_arg_position() {
local CURRENT_ARG_POS=$((_KAC_CURRENT_COMMAND_NB_WORDS + 1)) local CURRENT_ARG_POS=$((_KAC_CURRENT_COMMAND_NB_WORDS + 1))
local COMPLETE_COMMAND=$(grep -E "^$_KAC_CURRENT_COMMAND" "$_KAC_CACHE_PATH") local COMPLETE_COMMAND=$(grep -E "^$_KAC_CURRENT_COMMAND" "$_KAC_CACHE_PATH")
@ -153,11 +150,10 @@ _KAC_get_current_arg_position() {
_knife() { _knife() {
_KAC_get_and_regen_cache _KAC_knife_commands _KAC_get_and_regen_cache _KAC_knife_commands
local RAW_LIST ITEM REGEN_CMD ARG_POSITION local RAW_LIST ITEM REGEN_CMD ARG_POSITION
# shellcheck disable=SC2034
COMREPLY=() COMREPLY=()
# get correct command & arg pos # get correct command & arg pos
_KAC_get_current_base_command && ARG_POSITION=$(_KAC_get_current_arg_position) || ARG_POSITION=$((COMP_CWORD + 1)) _KAC_get_current_base_command && ARG_POSITION=$(_KAC_get_current_arg_position) || ARG_POSITION=$((COMP_CWORD + 1))
RAW_LIST=$(grep -E "^${_KAC_CURRENT_COMMAND}" "${_KAC_CACHE_PATH}" | cut -d ' ' -f "${ARG_POSITION}" | uniq) RAW_LIST=$(grep -E "^$_KAC_CURRENT_COMMAND" "$_KAC_CACHE_PATH" | cut -d ' ' -f $ARG_POSITION | uniq)
# we need to process that raw list a bit, most notably for placeholders # we need to process that raw list a bit, most notably for placeholders
# NOTE: I chose to explicitely fetch & cache _certain_ informations for the server (cookbooks & node names, etc) # NOTE: I chose to explicitely fetch & cache _certain_ informations for the server (cookbooks & node names, etc)

View File

@ -1,12 +1,10 @@
# shellcheck shell=bash #!/usr/bin/bash
_command_exists laravel || return if command -v laravel > /dev/null; then
__laravel_completion() {
function __laravel_completion() { local OPTS=("-h --help -q --quiet --ansi --no-ansi -n --no-interaction -v -vv -vvv --verbose help list new")
local OPTS=('-h' '--help' '-q' '--quiet' '--ansi' '--no-ansi' '-n' '--no-interaction' '-v' '-vv' '-vvv' '--verbose' 'help' 'list' 'new')
local _opt_
COMPREPLY=() COMPREPLY=()
for _opt_ in "${OPTS[@]}"; do for _opt_ in ${OPTS[@]}; do
if [[ "$_opt_" == "$2"* ]]; then if [[ "$_opt_" == "$2"* ]]; then
COMPREPLY+=("$_opt_") COMPREPLY+=("$_opt_")
fi fi
@ -14,3 +12,4 @@ function __laravel_completion() {
} }
complete -F __laravel_completion laravel complete -F __laravel_completion laravel
fi

View File

@ -1,5 +1,3 @@
# shellcheck shell=bash
# Bash completion for Makefile # Bash completion for Makefile
# Loosely adapted from http://stackoverflow.com/a/38415982/1472048 # Loosely adapted from http://stackoverflow.com/a/38415982/1472048
@ -19,7 +17,7 @@ _makecomplete() {
for f in "${files[@]}" ; do for f in "${files[@]}" ; do
while IFS='' read -r line ; do while IFS='' read -r line ; do
targets+=("$line") targets+=("$line")
done < <(grep -E -o '^[a-zA-Z0-9_-]+:([^=]|$)' "$f" | cut -d':' -f1) done < <(grep -oE '^[a-zA-Z0-9_-]+:([^=]|$)' "$f" | cut -d':' -f1)
done done
[ "${#targets[@]}" -eq 0 ] && return 0 [ "${#targets[@]}" -eq 0 ] && return 0

View File

@ -1,47 +0,0 @@
# shellcheck shell=bash
__ngrok_completion() {
# shellcheck disable=SC2155
local prev=$(_get_pword)
# shellcheck disable=SC2155
local curr=$(_get_cword)
local BASE_NO_CONF="--log --log-format --log-level --help"
local BASE="--config $BASE_NO_CONF"
local DEFAULT="$BASE --authtoken --region"
case $prev in
authtoken)
# shellcheck disable=SC2207
COMPREPLY=($(compgen -W "$BASE" -- "$curr"))
;;
http)
# shellcheck disable=SC2207
COMPREPLY=($(compgen -W "$DEFAULT --auth --bind-tls --host-header --hostname --inspect --subdomain" -- "$curr"))
;;
start)
# shellcheck disable=SC2207
COMPREPLY=($(compgen -W "$DEFAULT --all --none" -- "$curr"))
;;
tcp)
# shellcheck disable=SC2207
COMPREPLY=($(compgen -W "$DEFAULT --remote-addr" -- "$curr"))
;;
tls)
# shellcheck disable=SC2207
COMPREPLY=($(compgen -W "$DEFAULT --client-cas --crt --hostname --key --subdomain" -- "$curr"))
;;
update)
# shellcheck disable=SC2207
COMPREPLY=($(compgen -W "$BASE_NO_CONF --channel" -- "$curr"))
;;
ngrok)
# shellcheck disable=SC2207
COMPREPLY=($(compgen -W "authtoken credits http start tcp tls update version help" -- "$curr"))
;;
*) ;;
esac
}
complete -F __ngrok_completion ngrok

View File

@ -1,9 +1,7 @@
# shellcheck shell=bash # shellcheck shell=bash
function __notify-send_completions() { function __notify-send_completions() {
# shellcheck disable=SC2155
local curr=$(_get_cword) local curr=$(_get_cword)
# shellcheck disable=SC2155
local prev=$(_get_pword) local prev=$(_get_pword)
case $prev in case $prev in

View File

@ -1,6 +1 @@
# shellcheck shell=bash [[ -x "$(which pew)" ]] && source "$(pew shell_config)"
if _command_exists pew
then
source "$(pew shell_config)"
fi

View File

@ -6,15 +6,6 @@
# If the pip package is installed within virtual environments, say, python managed by pyenv, # If the pip package is installed within virtual environments, say, python managed by pyenv,
# you should first initialize the corresponding environment. # you should first initialize the corresponding environment.
# So that pip is in the system's path. # So that pip is in the system's path.
_command_exists pip || return if _command_exists pip; then
function __bash_it_complete_pip() {
if _command_exists _pip_completion; then
complete -o default -F _pip_completion pip
_pip_completion "$@"
else
eval "$(pip completion --bash)" eval "$(pip completion --bash)"
_pip_completion "$@"
fi fi
}
complete -o default -F __bash_it_complete_pip pip

View File

@ -6,15 +6,6 @@
# If the pip package is installed within virtual environments, say, python managed by pyenv, # If the pip package is installed within virtual environments, say, python managed by pyenv,
# you should first initialize the corresponding environment. # you should first initialize the corresponding environment.
# So that pip3 is in the system's path. # So that pip3 is in the system's path.
_command_exists pip3 || return if _command_exists pip3; then
function __bash_it_complete_pip3() {
if _command_exists _pip_completion; then
complete -o default -F _pip_completion pip3
_pip_completion "$@"
else
eval "$(pip3 completion --bash)" eval "$(pip3 completion --bash)"
_pip_completion "$@"
fi fi
}
complete -o default -F __bash_it_complete_pip3 pip3

View File

@ -1,4 +1,4 @@
# shellcheck shell=bash # shellcheck shell=bash
if _command_exists pipenv; then if _command_exists pipenv; then
eval "$(_PIPENV_COMPLETE=bash_source pipenv)" eval "$(pipenv --completion)"
fi fi

View File

@ -7,7 +7,7 @@ _is_function _rl_enabled ||
_pj() { _pj() {
_is_function _init_completion || return _is_function _init_completion || return
_is_function _rl_enabled || return _is_function _rl_enabled || return
[ -n "$BASH_IT_PROJECT_PATHS" ] || return [ -n "$PROJECT_PATHS" ] || return
shift shift
[ "$1" == "open" ] && shift [ "$1" == "open" ] && shift
@ -21,7 +21,7 @@ _pj() {
local -r mark_dirs=$(_rl_enabled mark-directories && echo y) local -r mark_dirs=$(_rl_enabled mark-directories && echo y)
local -r mark_symdirs=$(_rl_enabled mark-symlinked-directories && echo y) local -r mark_symdirs=$(_rl_enabled mark-symlinked-directories && echo y)
for i in ${BASH_IT_PROJECT_PATHS//:/$'\n'}; do for i in ${PROJECT_PATHS//:/$'\n'}; do
# create an array of matched subdirs # create an array of matched subdirs
k="${#COMPREPLY[@]}" k="${#COMPREPLY[@]}"
for j in $( compgen -d $i/$cur ); do for j in $( compgen -d $i/$cur ); do

View File

@ -1,9 +1,7 @@
# shellcheck shell=bash # shellcheck shell=bash
_sdkman_complete() {
function _sdkman_complete() {
local CANDIDATES local CANDIDATES
local CANDIDATE_VERSIONS local CANDIDATE_VERSIONS
local SDKMAN_CANDIDATES_CSV="${SDKMAN_CANDIDATES_CSV:-}"
COMPREPLY=() COMPREPLY=()
@ -12,7 +10,7 @@ function _sdkman_complete() {
elif [ "$COMP_CWORD" -eq 2 ]; then 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") "install" | "i" | "uninstall" | "rm" | "list" | "ls" | "use" | "u" | "default" | "d" | "home" | "h" | "current" | "c" | "upgrade" | "ug")
CANDIDATES="${SDKMAN_CANDIDATES_CSV//,/${IFS:0:1}}" CANDIDATES=$(echo "${SDKMAN_CANDIDATES_CSV}" | tr ',' ' ')
mapfile -t COMPREPLY < <(compgen -W "$CANDIDATES" -- "${COMP_WORDS[COMP_CWORD]}") mapfile -t COMPREPLY < <(compgen -W "$CANDIDATES" -- "${COMP_WORDS[COMP_CWORD]}")
;; ;;
"env") "env")
@ -48,17 +46,17 @@ function _sdkman_complete() {
return 0 return 0
} }
function _sdkman_candidate_local_versions() { _sdkman_candidate_local_versions() {
CANDIDATE_VERSIONS=$(__sdkman_cleanup_local_versions "$1") CANDIDATE_VERSIONS=$(__sdkman_cleanup_local_versions "$1")
} }
function _sdkman_candidate_all_versions() { _sdkman_candidate_all_versions() {
candidate="$1" candidate="$1"
CANDIDATE_LOCAL_VERSIONS=$(__sdkman_cleanup_local_versions "$candidate") CANDIDATE_LOCAL_VERSIONS=$(__sdkman_cleanup_local_versions "$candidate")
if [[ "${SDKMAN_OFFLINE_MODE:-false}" == "true" ]]; then if [ "$SDKMAN_OFFLINE_MODE" = "true" ]; then
CANDIDATE_VERSIONS=$CANDIDATE_LOCAL_VERSIONS CANDIDATE_VERSIONS=$CANDIDATE_LOCAL_VERSIONS
else else
# sdkman has a specific output format for Java candidate since # sdkman has a specific output format for Java candidate since
@ -72,12 +70,12 @@ function _sdkman_candidate_all_versions() {
# "+" - local version # "+" - local version
# "*" - installed # "*" - installed
# ">" - currently in use # ">" - currently in use
CANDIDATE_VERSIONS="$(echo "$CANDIDATE_ONLINE_VERSIONS $CANDIDATE_LOCAL_VERSIONS" | tr ' ' '\n' | grep -v -e '^[[:space:]|\*|\>|\+]*$' | sort -u) " CANDIDATE_VERSIONS="$(echo "$CANDIDATE_ONLINE_VERSIONS $CANDIDATE_LOCAL_VERSIONS" | tr ' ' '\n' | grep -v -e '^[[:space:]|\*|\>|\+]*$' | sort | uniq -u) "
fi fi
} }
function __sdkman_cleanup_local_versions() { __sdkman_cleanup_local_versions() {
__sdkman_build_version_csv "$1" | tr ',' ' ' __sdkman_build_version_csv "$1" | tr ',' ' '

View File

@ -1,4 +1,4 @@
# shellcheck shell=bash #!/bin/bash
# ---------------------------------------------------------------------------+ # ---------------------------------------------------------------------------+
# | # |
@ -7,16 +7,15 @@
# | # |
# ---------------------------------------------------------------------------+ # ---------------------------------------------------------------------------+
if _command_exists sqlmap if command -v sqlmap > /dev/null; then
then
function _sqlmap() _sqlmap()
{ {
local cur prev local cur prev
COMPREPLY=() COMPREPLY=()
cur="$(_get_cword)" cur=$(_get_cword)
prev="$(_get_pword)" prev=$(_get_pword)
case $prev in case $prev in

File diff suppressed because it is too large Load Diff

View File

@ -1,52 +1,25 @@
# shellcheck shell=bash #!/usr/bin/env bash
#
# Loads the system's Bash completion modules. # Loads the system's Bash completion modules.
# If Homebrew is installed (OS X), it's Bash completion modules are loaded. # If Homebrew is installed (OS X), it's Bash completion modules are loaded.
# Load before other completions if [[ -r /etc/bash_completion ]] ; then
# BASH_IT_LOAD_PRIORITY: 325 # shellcheck disable=SC1091
# Bash-completion is too large and complex to expect to handle unbound variables throughout the whole codebase.
if shopt -qo nounset; then
__bash_it_restore_nounset=true
shopt -uo nounset
else
__bash_it_restore_nounset=false
fi
# shellcheck disable=SC1090 disable=SC1091
if [[ -r "${BASH_COMPLETION:-}" ]]; then
source "${BASH_COMPLETION}"
elif [[ -r /etc/bash_completion ]]; then
source /etc/bash_completion source /etc/bash_completion
# Some distribution makes use of a profile.d script to import completion. # Some distribution makes use of a profile.d script to import completion.
elif [[ -r /etc/profile.d/bash_completion.sh ]] ; then elif [[ -r /etc/profile.d/bash_completion.sh ]] ; then
# shellcheck disable=SC1091
source /etc/profile.d/bash_completion.sh source /etc/profile.d/bash_completion.sh
elif _bash_it_homebrew_check; then
: "${BASH_COMPLETION_COMPAT_DIR:=${BASH_IT_HOMEBREW_PREFIX}/etc/bash_completion.d}"
case "${BASH_VERSION}" in
1* | 2* | 3.0* | 3.1*)
_log_warning "Cannot load completion due to version of shell. Are you using Bash 3.2+?"
;;
3.2* | 4.0* | 4.1*)
# Import version 1.x of bash-completion, if installed.
BASH_COMPLETION="${BASH_IT_HOMEBREW_PREFIX}/opt/bash-completion@1/etc/bash_completion"
if [[ -r "$BASH_COMPLETION" ]]; then
source "$BASH_COMPLETION"
else
unset BASH_COMPLETION
fi
;;
4.2* | 5* | *)
# homebrew/versions/bash-completion2 (required for projects.completion.bash) is installed to this path
if [[ -r "${BASH_IT_HOMEBREW_PREFIX}/opt/bash-completion@2/etc/profile.d/bash_completion.sh" ]]; then
source "${BASH_IT_HOMEBREW_PREFIX}/opt/bash-completion@2/etc/profile.d/bash_completion.sh"
fi
;;
esac
fi fi
if [[ ${__bash_it_restore_nounset:-false} == "true" ]]; then if [[ "$(uname -s)" == 'Darwin' ]] && _command_exists brew ; then
shopt -so nounset BREW_PREFIX=${BREW_PREFIX:-$(brew --prefix)}
# homebrew/versions/bash-completion2 (required for projects.completion.bash) is installed to this path
if [[ -r "$BREW_PREFIX"/etc/profile.d/bash_completion.sh ]] ; then
# shellcheck disable=SC1090
source "$BREW_PREFIX"/etc/profile.d/bash_completion.sh
fi
fi fi
unset __bash_it_restore_nounset

View File

@ -1,10 +1,5 @@
# shellcheck shell=bash if [[ -x "$(which travis)" ]]; then
__TRAVIS_COMPLETION_SCRIPT="${TRAVIS_CONFIG_PATH:-${HOME}/.travis}/travis.sh"
if _command_exists travis [[ -f "${__TRAVIS_COMPLETION_SCRIPT}" ]] && source "${__TRAVIS_COMPLETION_SCRIPT}"
then
if [[ -s "${__TRAVIS_COMPLETION_SCRIPT:=${TRAVIS_CONFIG_PATH:-${HOME}/.travis}/travis.sh}" ]]
then
source "${__TRAVIS_COMPLETION_SCRIPT}"
fi
unset __TRAVIS_COMPLETION_SCRIPT unset __TRAVIS_COMPLETION_SCRIPT
fi fi

View File

@ -1,9 +1,7 @@
# shellcheck shell=bash # shellcheck shell=bash
__vuejs_completion() { __vuejs_completion() {
# shellcheck disable=SC2155
local prev=$(_get_pword) local prev=$(_get_pword)
# shellcheck disable=SC2155
local curr=$(_get_cword) local curr=$(_get_cword)
case $prev in case $prev in

View File

@ -1,12 +1,10 @@
# shellcheck shell=bash #!/usr/bin/bash
_command_exists wpscan || return if command -v wpscan > /dev/null; then
__wpscan_completion() {
function __wpscan_completion() { local OPTS=("--help --hh --version --url --ignore-main-redirect --verbose --output --format --detection-mode --scope --headers --user-agent --vhost --random-user-agent --user-agents-list --http-auth --max-threads --throttle --request-timeout --connect-timeout --disable-tlc-checks --proxy --proxy-auth --cookie-string --cookie-jar --cache-ttl --clear-cache --server --cache-dir --update --no-update --wp-content-dir --wp-plugins-dir --wp-version-detection --main-theme-detection --enumerate --exclude-content-based --plugins-list --plugins-detection --plugins-version-all --plugins-version-detection --themes-list --themes-detection --themes-version-all --themes-version-detection --timthumbs-list --timthumbs-detection --config-backups-list --config-backups-detection --db-exports-list --db-exports-detection --medias-detection --users-list --users-detection --passwords --usernames --multicall-max-passwords --password-attack --stealthy")
local _opt_
local OPTS=('--help' '--hh' '--version' '--url' '--ignore-main-redirect' '--verbose' '--output' '--format' '--detection-mode' '--scope' '--headers' '--user-agent' '--vhost' '--random-user-agent' '--user-agents-list' '--http-auth' '--max-threads' '--throttle' '--request-timeout' '--connect-timeout' '--disable-tlc-checks' '--proxy' '--proxy-auth' '--cookie-string' '--cookie-jar' '--cache-ttl' '--clear-cache' '--server' '--cache-dir' '--update' '--no-update' '--wp-content-dir' '--wp-plugins-dir' '--wp-version-detection' '--main-theme-detection' '--enumerate' '--exclude-content-based' '--plugins-list' '--plugins-detection' '--plugins-version-all' '--plugins-version-detection' '--themes-list' '--themes-detection' '--themes-version-all' '--themes-version-detection' '--timthumbs-list' '--timthumbs-detection' '--config-backups-list' '--config-backups-detection' '--db-exports-list' '--db-exports-detection' '--medias-detection' '--users-list' '--users-detection' '--passwords' '--usernames' '--multicall-max-passwords' '--password-attack' '--stealthy')
COMPREPLY=() COMPREPLY=()
for _opt_ in "${OPTS[@]}"; do for _opt_ in ${OPTS[@]}; do
if [[ "$_opt_" == "$2"* ]]; then if [[ "$_opt_" == "$2"* ]]; then
COMPREPLY+=("$_opt_") COMPREPLY+=("$_opt_")
fi fi
@ -14,3 +12,4 @@ function __wpscan_completion() {
} }
complete -F __wpscan_completion wpscan complete -F __wpscan_completion wpscan
fi

View File

@ -1,5 +0,0 @@
# 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

@ -1,9 +1,7 @@
![logo](https://github.com/Bash-it/media/raw/master/media/Bash-it.png) # Bash-it
![Build Status](https://github.com/Bash-it/bash-it/workflows/CI/badge.svg?branch=master)
![Build Status](../../../workflows/CI/badge.svg?event=push)
![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) [![Join the chat at https://webchat.freenode.net/?channel=#bash-it](https://img.shields.io/badge/chat-on%20freenode-brightgreen.svg)](https://webchat.freenode.net/?channel=#bash-it)
![shell](https://img.shields.io/badge/Shell-Bash-blue)
**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:)
@ -41,8 +39,7 @@ Stop polluting your `~/bin` directory and your `.bashrc` file, fork/clone Bash-i
``git clone --depth=1 https://github.com/Bash-it/bash-it.git ~/.bash_it`` ``git clone --depth=1 https://github.com/Bash-it/bash-it.git ~/.bash_it``
2) Run ``~/.bash_it/install.sh`` 2) Run ``~/.bash_it/install.sh``
That's it! :smiley: Thats it! :smiley:
You can check out more components of Bash-it, and customize it to your desire. You can check out more components of Bash-it, and customize it to your desire.
For more information, see detailed instructions [here](https://bash-it.readthedocs.io/en/latest/installation/). For more information, see detailed instructions [here](https://bash-it.readthedocs.io/en/latest/installation/).
@ -56,8 +53,6 @@ please feel free to read through this page if you're interested in how Bash-it l
## Contributors ## Contributors
[List of contributors](https://github.com/Bash-it/bash-it/contributors) * [List of contributors][contribute]
## License [contribute]: https://github.com/Bash-it/bash-it/contributors
Bash-it is licensed under the [MIT License](https://github.com/Bash-it/bash-it/blob/master/LICENSE).

View File

@ -13,4 +13,3 @@ You should be familiar with them in order to fully utilize Bash-it.
search search
reload reload
doctor doctor
profile

Some files were not shown because too many files have changed in this diff Show More