Compare commits

..

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

278 changed files with 7508 additions and 8999 deletions

12
.editorconfig 100644 → 100755
View File

@ -13,24 +13,18 @@ insert_final_newline = true
trim_trailing_whitespace = false
[.git*]
indent_size = tab
indent_style = tab
[{**.*sh,test/run,**.bats}]
indent_size = tab
[{**.*sh,test/run}]
indent_style = tab
indent_size = 4
shell_variant = bash
binary_next_line = true # like -bn
switch_case_indent = true # like -ci
space_redirects = true # like -sr
keep_padding = false # like -kp
keep_padding = false # like -kp
end_of_line = lf
charset = utf-8
trim_trailing_whitespace = 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
# Triggers the workflow on push or pull request events
on: [push, pull_request]
on:
push:
branches: [ master ]
pull_request:
branches: [ master ]
jobs:
bats-test:
strategy:
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 }}
@ -16,9 +20,6 @@ jobs:
- name: Install greadlink
if: startsWith(runner.os, 'macOS')
run: brew install coreutils
- name: Install parallel
if: startsWith(runner.os, 'macOS')
run: brew install parallel
- name: Test code
run: test/run
@ -44,22 +45,15 @@ jobs:
- name: Set up Go
uses: actions/setup-go@v2
with:
go-version: 1.17
go-version: 1.14
- name: Set up Python
uses: actions/setup-python@v2
with:
python-version: 3.8
# - name: Update APT Package Lists
# run: sudo apt-get update
- name: Install shfmt
run: GO111MODULE=on go get mvdan.cc/sh/v3/cmd/shfmt
- name: Install shellcheck
env:
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
run: brew install shellcheck
- name: Install pre-commit
run: python3 -m pip install -r test/lint-requirements.txt
- name: Run lint

5
.gitignore vendored 100644 → 100755
View File

@ -17,8 +17,3 @@ bats
enabled/*
/enabled
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: check-added-large-files
- repo: https://github.com/jumanjihouse/pre-commit-hooks
rev: 2.1.5
rev: 2.1.4
hooks:
- id: git-check # Configure in .gitattributes
- id: shellcheck
@ -43,8 +43,3 @@ repos:
language: system
files: "\\.bash$"
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
Copyright (c) 2020-2021 Bash-it
Copyright (c) 2020 Bash-it
Permission is hereby granted, free of charge, to any person obtaining a copy
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'
## Summary for args to less:

View File

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

View File

@ -1,4 +1,4 @@
# shellcheck shell=bash
#!/bin/bash
#
# -binaryanomaly
@ -6,8 +6,9 @@ cite 'about-alias'
about-alias 'Apt and dpkg aliases for Ubuntu and Debian distros.'
# set apt aliases
function _set_pkg_aliases() {
if _command_exists apt; then
function _set_pkg_aliases()
{
if [ -x $(which apt) ]; then
alias apts='apt-cache search'
alias aptshow='apt-cache show'
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'
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)'
# Common misspellings of bash-it

View File

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

View File

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

View File

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

View File

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

View File

@ -1,19 +1,22 @@
# shellcheck shell=bash
#!/bin/bash
cite 'about-alias'
about-alias 'Curl aliases for convenience.'
# set apt aliases
function _set_pkg_aliases() {
if _command_exists curl; then
function _set_pkg_aliases()
{
if [ -x $(which curl) ]; then
# follow redirects
alias cl='curl -L'
# follow redirects, download as original name
alias clo='curl -L -O'
# follow redirects, download as original name, continue
alias cloc='curl -L -C - -O'
# follow redirects, download as original name, continue, retry 5 times
alias clocr='curl -L -C - -O --retry 5'
# follow redirects, fetch banner
alias clb='curl -L -I'
alias cl='curl -L'
# follow redirects, download as original name
alias clo='curl -L -O'
# follow redirects, download as original name, continue
alias cloc='curl -L -C - -O'
# follow redirects, download as original name, continue, retry 5 times
alias clocr='curl -L -C - -O --retry 5'
# follow redirects, fetch banner
alias clb='curl -L -I'
# see only response headers from a get request
alias clhead='curl -D - -so /dev/null'
fi

View File

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

View File

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

View File

@ -1,32 +1,32 @@
# shellcheck shell=bash
cite 'about-alias'
about-alias 'docker abbreviations'
alias dk='docker'
alias dklc='docker ps -l' # List last Docker container
alias dklcid='docker ps -l -q' # List last Docker container ID
alias dklcip='docker inspect -f "{{.NetworkSettings.IPAddress}}" $(docker ps -l -q)' # Get IP of last Docker container
alias dkps='docker ps' # List running Docker containers
alias dkpsa='docker ps -a' # List all Docker containers
alias dki='docker images' # List Docker images
alias dkrmac='docker rm $(docker ps -a -q)' # Delete all Docker containers
alias dklc='docker ps -l' # List last Docker container
alias dklcid='docker ps -l -q' # List last Docker container ID
alias dklcip='docker inspect -f "{{.NetworkSettings.IPAddress}}" $(docker ps -l -q)' # Get IP of last Docker container
alias dkps='docker ps' # List running Docker containers
alias dkpsa='docker ps -a' # List all Docker containers
alias dki='docker images' # List Docker images
alias dkrmac='docker rm $(docker ps -a -q)' # Delete all Docker containers
case $OSTYPE in
darwin* | *bsd* | *BSD*)
alias dkrmui='docker images -q -f dangling=true | xargs docker rmi' # Delete all untagged Docker images
;;
*)
alias dkrmui='docker images -q -f dangling=true | xargs -r docker rmi' # Delete all untagged Docker images
;;
darwin*|*bsd*|*BSD*)
alias dkrmui='docker images -q -f dangling=true | xargs docker rmi' # Delete all untagged Docker images
;;
*)
alias dkrmui='docker images -q -f dangling=true | xargs -r docker rmi' # Delete all untagged Docker images
;;
esac
if _bash-it-component-item-is-enabled plugin docker; then
# Function aliases from docker plugin:
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 dkrmli='docker-remove-most-recent-image' # Delete most recent (i.e., last) Docker image
alias dkrmi='docker-remove-images' # Delete images for supplied IDs or all if no IDs are passed as arguments
alias dkideps='docker-image-dependencies' # Output a graph of image dependencies using Graphiz
alias dkre='docker-runtime-environment' # List environmental variables of the supplied image ID
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:
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 dkrmli='docker-remove-most-recent-image' # Delete most recent (i.e., last) Docker image
alias dkrmi='docker-remove-images' # Delete images for supplied IDs or all if no IDs are passed as arguments
alias dkideps='docker-image-dependencies' # Output a graph of image dependencies using Graphiz
alias dkre='docker-runtime-environment' # List environmental variables of the supplied image ID
fi
alias dkelc='docker exec -it $(dklcid) bash --login' # Enter last container (works with Docker 1.3 and above)
alias dkrmflast='docker rm -f $(dklcid)'

View File

@ -1,16 +1,16 @@
# shellcheck shell=bash
cite 'about-alias'
about-alias 'emacs editor'
case $OSTYPE in
linux*)
alias em='emacs'
alias en='emacs -nw'
alias e='emacsclient -n'
alias et='emacsclient -t'
alias ed='emacs --daemon'
alias E='SUDO_EDITOR=emacsclient sudo -e'
;;
darwin*)
alias em='open -a emacs'
;;
linux*)
alias em='emacs'
alias en='emacs -nw'
alias e='emacsclient -n'
alias et='emacsclient -t'
alias ed='emacs --daemon'
alias E='SUDO_EDITOR=emacsclient sudo -e'
;;
darwin*)
alias em='open -a emacs'
;;
esac

View File

@ -1,9 +1,9 @@
# shellcheck shell=bash
cite 'about-alias'
about-alias 'fuck/please to retry last command with sudo'
# Play nicely with 'thefuck' plugin
if ! _command_exists fuck; then
alias fuck='sudo $(fc -ln -1)'
if ! _command_exists fuck ; then
alias fuck='sudo $(fc -ln -1)'
fi
alias please=fuck
alias plz=please

View File

@ -1,45 +1,50 @@
# shellcheck shell=bash
cite about-alias
about-alias 'general aliases'
if command ls --color -d . &> /dev/null; then
alias ls='ls --color=auto'
# BSD `ls` doesn't need an argument (`-G`) when `$CLICOLOR` is set.
if ls --color -d . &> /dev/null
then
alias ls="ls --color=auto"
elif ls -G -d . &> /dev/null
then
alias ls='ls -G' # Compact view, show colors
fi
# List directory contents
alias sl=ls
alias la='ls -AF' # Compact view, show hidden
alias la='ls -AF' # Compact view, show hidden
alias ll='ls -al'
alias l='ls -a'
alias l1='ls -1'
alias lf='ls -F'
alias _='sudo'
alias _="sudo"
# Shortcuts to edit startup files
alias vbrc='${VISUAL:-vim} ~/.bashrc'
alias vbpf='${VISUAL:-vim} ~/.bash_profile'
alias vbrc="vim ~/.bashrc"
alias vbpf="vim ~/.bash_profile"
# colored grep
# 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
if command grep --color=auto "a" "${BASH_IT?}"/*.md &> /dev/null; then
alias grep='grep --color=auto'
if grep --color=auto "a" "${BASH_IT}/"*.md &> /dev/null
then
alias grep='grep --color=auto'
fi
if _command_exists gshuf; then
alias shuf=gshuf
if which gshuf &> /dev/null
then
alias shuf=gshuf
fi
alias c='clear'
alias k='clear'
alias cls='clear'
alias edit='${EDITOR:-${ALTERNATE_EDITOR:-nano}}'
alias pager='${PAGER:=less}'
alias edit="$EDITOR"
alias pager="$PAGER"
alias q='exit'
alias irc='${IRC_CLIENT:=irc}'
alias irc="${IRC_CLIENT:=irc}"
# Language aliases
alias rb='ruby'
@ -60,8 +65,9 @@ alias -- -='cd -' # Go back
alias h='history'
# Tree
if ! _command_exists tree; then
alias tree="find . -print | sed -e 's;[^/]*/;|____;g;s;____|; |;g'"
if [ ! -x "$(which tree 2>/dev/null)" ]
then
alias tree="find . -print | sed -e 's;[^/]*/;|____;g;s;____|; |;g'"
fi
# Directory
@ -69,17 +75,21 @@ alias md='mkdir -p'
alias rd='rmdir'
# 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
function catt() {
for i in "$@"; do
if [[ -d "$i" ]]; then
ls "$i"
else
cat "$i"
fi
done
catt() {
for i in "$@"; do
if [ -d "$i" ]; then
ls "$i"
else
cat "$i"
fi
done
}
# The Bash-it aliases were moved to the `bash-it.aliases.bash` file. The intent of this
@ -88,5 +98,5 @@ function catt() {
# aliases and enable just the ones for Bash-it explicitly:
# bash-it disable alias general
# 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"

View File

@ -1,4 +1,5 @@
# shellcheck shell=bash
cite 'about-alias'
about-alias 'common git abbreviations'
alias g='git'
@ -8,18 +9,13 @@ alias get='git'
alias ga='git add'
alias gall='git add -A'
alias gap='git add -p'
alias gav='git add -v'
# branch
alias gb='git branch'
alias gba='git branch --all'
alias gbd='git branch -d'
alias gbD='git branch -D'
alias gbl='git branch --list'
alias gbla='git branch --list --all'
alias gblr='git branch --list --remotes'
alias gbm='git branch --move'
alias gbr='git branch --remotes'
alias gba='git branch -a'
alias gbd='git branch -d'
alias gbm='git branch -m'
alias gbt='git branch --track'
alias gdel='git branch -D'
@ -41,8 +37,8 @@ alias gcb='git checkout -b'
alias gco='git checkout'
alias gcob='git checkout -b'
alias gcobu='git checkout -b ${USER}/'
alias gcom='git checkout $(get_default_branch)'
alias gcpd='git checkout $(get_default_branch); git pull; git branch -D'
alias gcom='git checkout master'
alias gcpd='git checkout master; git pull; git branch -D'
alias gct='git checkout --track'
# clone
@ -68,14 +64,13 @@ alias gf='git fetch --all --prune'
alias gft='git fetch --all --prune --tags'
alias gftv='git fetch --all --prune --tags --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'
# 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 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 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 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'
@ -89,7 +84,7 @@ alias glsum='git diff --name-only --diff-filter=U' # Show unmerged (conflicted)
alias ggui='git gui'
# home
alias ghm='cd "$(git rev-parse --show-toplevel)"' # Git home
alias ghm='cd '\''$(git rev-parse --show-toplevel)'\''' # Git home
# appendage to ghm
if ! _command_exists gh; then
alias gh='ghm'
@ -109,7 +104,7 @@ alias gp='git push'
alias gpd='git push --delete'
alias gpf='git push --force'
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 gpunch='git push --force-with-lease'
alias gpuo='git push --set-upstream origin'
@ -117,7 +112,7 @@ alias gpuoc='git push --set-upstream origin $(git symbolic-ref --short HEAD)'
# pull
alias gl='git pull'
alias glum='git pull upstream $(get_default_branch)'
alias glum='git pull upstream master'
alias gpl='git pull'
alias gpp='git pull && git push'
alias gpr='git pull --rebase'
@ -132,11 +127,9 @@ alias grm='git rm'
# rebase
alias grb='git rebase'
alias grbc='git rebase --continue'
alias grm='git rebase $(get_default_branch)'
alias grmi='git rebase $(get_default_branch) -i'
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
alias grm='git rebase master'
alias grmi='git rebase master -i'
alias gprom='git fetch origin master && git rebase origin/master && git update-ref refs/heads/master origin/master' # Rebase with latest remote master
# reset
alias gus='git reset HEAD'
@ -180,7 +173,7 @@ alias gsu='git submodule update --init --recursive'
# these aliases requires git v2.23+
alias gsw='git switch'
alias gswc='git switch --create'
alias gswm='git switch $(get_default_branch)'
alias gswm='git switch master'
alias gswt='git switch --track'
# tag
@ -202,11 +195,3 @@ esac
function gdv() {
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'
# Aliases

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

@ -1,16 +1,25 @@
# shellcheck shell=bash
#!/bin/bash
#
# -binaryanomaly
cite 'about-alias'
about-alias 'kubectl aliases'
if _command_exists kubectl; then
alias kc='kubectl'
alias kcgp='kubectl get pods'
alias kcgd='kubectl get deployments'
alias kcgn='kubectl get nodes'
alias kcdp='kubectl describe pod'
alias kcdd='kubectl describe deployment'
alias kcdn='kubectl describe node'
alias kcgpan='kubectl get pods --all-namespaces'
alias kcgdan='kubectl get deployments --all-namespaces'
# launches a disposable netshoot pod in the k8s cluster
alias kcnetshoot='kubectl run netshoot-$(date +%s) --rm -i --tty --image nicolaka/netshoot -- /bin/bash'
fi
function _set_pkg_aliases()
{
if _command_exists kubectl; then
alias kc='kubectl'
alias kcgp='kubectl get pods'
alias kcgd='kubectl get deployments'
alias kcgn='kubectl get nodes'
alias kcdp='kubectl describe pod'
alias kcdd='kubectl describe deployment'
alias kcdn='kubectl describe node'
alias kcgpan='kubectl get pods --all-namespaces'
alias kcgdan='kubectl get deployments --all-namespaces'
# launches a disposable netshoot pod in the k8s cluster
alias kcnetshoot='kubectl run --generator=run-pod/v1 netshoot-$(date +%s) --rm -i --tty --image nicolaka/netshoot -- /bin/bash'
fi
}
_set_pkg_aliases

View File

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

View File

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

View File

@ -1,4 +1,6 @@
# shellcheck shell=bash
#!/bin/bash
cite 'about-alias'
about-alias 'MSYS2 aliases'
LS_COMMON="-hG"
@ -7,8 +9,7 @@ LS_COMMON="$LS_COMMON -I NTUSER.DAT\* -I ntuser.dat\*"
# alias
# 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 la="ls -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'
# alias to setup nodejs development environment

View File

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

View File

@ -1,28 +1,27 @@
# shellcheck shell=bash
cite 'about-alias'
about-alias 'osx-specific aliases'
# Desktop Programs
alias fireworks='open -a "/Applications/Adobe Fireworks CS3/Adobe Fireworks CS3.app"'
alias photoshop='open -a "/Applications/Adobe Photoshop CS3/Adobe Photoshop.app"'
alias preview='open -a "${PREVIEW?}"'
alias xcode='open -a "/Applications/XCode.app"'
alias filemerge='open -a "/Developer/Applications/Utilities/FileMerge.app"'
alias safari='open -a safari'
alias firefox='open -a firefox'
alias chrome='open -a "Google Chrome"'
alias chromium='open -a chromium'
alias brave='open -a "Brave Browser"'
alias dashcode='open -a dashcode'
alias fireworks="open -a '/Applications/Adobe Fireworks CS3/Adobe Fireworks CS3.app'"
alias photoshop="open -a '/Applications/Adobe Photoshop CS3/Adobe Photoshop.app'"
alias preview="open -a '$PREVIEW'"
alias xcode="open -a '/Applications/XCode.app'"
alias filemerge="open -a '/Developer/Applications/Utilities/FileMerge.app'"
alias safari="open -a safari"
alias firefox="open -a firefox"
alias chrome="open -a google\ chrome"
alias chromium="open -a chromium"
alias dashcode="open -a dashcode"
alias f='open -a Finder '
alias fh='open -a Finder .'
alias textedit='open -a TextEdit'
alias hex='open -a "Hex Fiend"'
alias skype='open -a Skype'
alias mou='open -a Mou'
alias subl='open -a "Sublime Text"'
alias subl='open -a Sublime\ Text'
if [[ -s /usr/bin/firefox ]]; then
unalias firefox
if [ -s /usr/bin/firefox ] ; then
unalias firefox
fi
# Requires growlnotify, which can be found in the Growl DMG under "Extras"
@ -38,20 +37,19 @@ alias whotunes='lsof -r 2 -n -P -F n -c iTunes -a -i TCP@`hostname`:3689'
alias flush='dscacheutil -flushcache'
# Show/hide hidden files (for Mac OS X Mavericks)
alias showhidden='defaults write com.apple.finder AppleShowAllFiles TRUE'
alias hidehidden='defaults write com.apple.finder AppleShowAllFiles FALSE'
alias showhidden="defaults write com.apple.finder AppleShowAllFiles TRUE"
alias hidehidden="defaults write com.apple.finder AppleShowAllFiles FALSE"
# 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)
alias ql='qlmanage -p 2>/dev/null'
# Mute/Unmute the system volume. Plays nice with all other volume settings.
alias mute='osascript -e "set volume output muted true"'
alias unmute='osascript -e "set volume output muted false"'
alias mute="osascript -e 'set volume output muted true'"
alias unmute="osascript -e 'set volume output muted false'"
# Pin to the tail of long commands for an audible alert after long processes
## 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'
# Phoenix Commands

View File

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

View File

@ -1,4 +1,4 @@
# shellcheck shell=bash
cite 'about-alias'
about-alias 'pyrocms abbreviations'
###
@ -7,146 +7,146 @@ about-alias 'pyrocms abbreviations'
###
# general
alias a:cl="php artisan clear-compiled" # Remove the compiled class file
alias a:d="php artisan down" # Put the application into maintenance mode
alias a:e="php artisan env" # Display the current framework environment
alias a:h="php artisan help" # Displays help for a command
alias a:i="php artisan install" # Install the Streams Platform.
alias a:ls="php artisan list" # Lists commands
alias a:mg="php artisan migrate" # Run the database migrations
alias a:op="php artisan optimize" # Optimize the framework for better performance (deprecated)
alias a:pr="php artisan preset" # Swap the front-end scaffolding for the application
alias a:s="php artisan serve" # Serve the application on the PHP development server
alias a:u="php artisan up" # Bring the application out of maintenance mode
alias a:cl="php artisan clear-compiled" # Remove the compiled class file
alias a:d="php artisan down" # Put the application into maintenance mode
alias a:e="php artisan env" # Display the current framework environment
alias a:h="php artisan help" # Displays help for a command
alias a:i="php artisan install" # Install the Streams Platform.
alias a:ls="php artisan list" # Lists commands
alias a:mg="php artisan migrate" # Run the database migrations
alias a:op="php artisan optimize" # Optimize the framework for better performance (deprecated)
alias a:pr="php artisan preset" # Swap the front-end scaffolding for the application
alias a:s="php artisan serve" # Serve the application on the PHP development server
alias a:u="php artisan up" # Bring the application out of maintenance mode
# addon
alias a:ad:i="php artisan addon:install" # Install an addon.
alias a:ad:p="php artisan addon:publish" # Publish an the configuration and translations for an addon.
alias a:ad:r="php artisan addon:reinstall" # Reinstall an addon.
alias a:ad:u="php artisan addon:uninstall" # Uninstall an addon.
alias a:ad:i="php artisan addon:install" # Install an addon.
alias a:ad:p="php artisan addon:publish" # Publish an the configuration and translations for an addon.
alias a:ad:r="php artisan addon:reinstall" # Reinstall an addon.
alias a:ad:u="php artisan addon:uninstall" # Uninstall an addon.
# app
alias a:ap:n="php artisan app:name" # Set the application namespace
alias a:ap:p="php artisan app:publish" # Publish general application override files.
alias a:ap:n="php artisan app:name" # Set the application namespace
alias a:ap:p="php artisan app:publish" # Publish general application override files.
# assets
alias a:as:cl="php artisan assets:clear" # Clear compiled public assets.
alias a:as:cl="php artisan assets:clear" # Clear compiled public assets.
# auth
alias a:au:clrs="php artisan auth:clear-resets" # Flush expired password reset tokens
alias a:au:clrs="php artisan auth:clear-resets" # Flush expired password reset tokens
# cache
alias a:ca:cl="php artisan cache:clear" # Flush the application cache
alias a:ca:f="php artisan cache:forget" # Remove an item from the cache
alias a:ca:t="php artisan cache:table" # Create a migration for the cache database table
alias a:ca:cl="php artisan cache:clear" # Flush the application cache
alias a:ca:f="php artisan cache:forget" # Remove an item from the cache
alias a:ca:t="php artisan cache:table" # Create a migration for the cache database table
# config
alias a:co:ca="php artisan config:cache" # Create a cache file for faster configuration loading
alias a:co:cl="php artisan config:clear" # Remove the configuration cache file
alias a:co:ca="php artisan config:cache" # Create a cache file for faster configuration loading
alias a:co:cl="php artisan config:clear" # Remove the configuration cache file
# db
alias a:db:s="php artisan db:seed" # Seed the database with records
alias a:db:s="php artisan db:seed" # Seed the database with records
# env
alias a:en:s="php artisan env:set" # Set an environmental value.
alias a:en:s="php artisan env:set" # Set an environmental value.
# event
alias a:ev:g="php artisan event:generate" # Generate the missing events and listeners based on registration
alias a:ev:g="php artisan event:generate" # Generate the missing events and listeners based on registration
# extension
alias a:ex:i="php artisan extension:install" # Install a extension.
alias a:ex:r="php artisan extension:reinstall" # Reinstall a extension.
alias a:ex:u="php artisan extension:uninstall" # Uninstall a extension.
alias a:ex:i="php artisan extension:install" # Install a extension.
alias a:ex:r="php artisan extension:reinstall" # Reinstall a extension.
alias a:ex:u="php artisan extension:uninstall" # Uninstall a extension.
# files
alias a:fi:cl="php artisan files:clean" # Clean missing files from the files table.
alias a:fi:cl="php artisan files:clean" # Clean missing files from the files table.
# key
alias a:ke:g="php artisan key:generate" # Set the application key
alias a:ke:g="php artisan key:generate" # Set the application key
# make
alias a:mk:ad="php artisan make:addon" # Create a new addon.
alias a:mk:au="php artisan make:auth" # Scaffold basic login and registration views and routes
alias a:mk:cm="php artisan make:command" # Create a new Artisan command
alias a:mk:ct="php artisan make:controller" # Create a new controller class
alias a:mk:ev="php artisan make:event" # Create a new event class
alias a:mk:fa="php artisan make:factory" # Create a new model factory
alias a:mk:j="php artisan make:job" # Create a new job class
alias a:mk:li="php artisan make:listener" # Create a new event listener class
alias a:mk:ma="php artisan make:mail" # Create a new email class
alias a:mk:mw="php artisan make:middleware" # Create a new middleware class
alias a:mk:mg="php artisan make:migration" # Create a new migration file
alias a:mk:md="php artisan make:model" # Create a new Eloquent model class
alias a:mk:no="php artisan make:notification" # Create a new notification class
alias a:mk:po="php artisan make:policy" # Create a new policy class
alias a:mk:pr="php artisan make:provider" # Create a new service provider class
alias a:mk:rq="php artisan make:request" # Create a new form request class
alias a:mk:rs="php artisan make:resource" # Create a new resource
alias a:mk:rl="php artisan make:rule" # Create a new validation rule
alias a:mk:sd="php artisan make:seeder" # Create a new seeder class
alias a:mk:st="php artisan make:stream" # Make a streams entity namespace.
alias a:mk:ts="php artisan make:test" # Create a new test class
alias a:mk:ad="php artisan make:addon" # Create a new addon.
alias a:mk:au="php artisan make:auth" # Scaffold basic login and registration views and routes
alias a:mk:cm="php artisan make:command" # Create a new Artisan command
alias a:mk:ct="php artisan make:controller" # Create a new controller class
alias a:mk:ev="php artisan make:event" # Create a new event class
alias a:mk:fa="php artisan make:factory" # Create a new model factory
alias a:mk:j="php artisan make:job" # Create a new job class
alias a:mk:li="php artisan make:listener" # Create a new event listener class
alias a:mk:ma="php artisan make:mail" # Create a new email class
alias a:mk:mw="php artisan make:middleware" # Create a new middleware class
alias a:mk:mg="php artisan make:migration" # Create a new migration file
alias a:mk:md="php artisan make:model" # Create a new Eloquent model class
alias a:mk:no="php artisan make:notification" # Create a new notification class
alias a:mk:po="php artisan make:policy" # Create a new policy class
alias a:mk:pr="php artisan make:provider" # Create a new service provider class
alias a:mk:rq="php artisan make:request" # Create a new form request class
alias a:mk:rs="php artisan make:resource" # Create a new resource
alias a:mk:rl="php artisan make:rule" # Create a new validation rule
alias a:mk:sd="php artisan make:seeder" # Create a new seeder class
alias a:mk:st="php artisan make:stream" # Make a streams entity namespace.
alias a:mk:ts="php artisan make:test" # Create a new test class
# migrate
alias a:mg:fr="php artisan migrate:fresh" # Drop all tables and re-run all migrations
alias a:mg:i="php artisan migrate:install" # Create the migration repository
alias a:mg:rf="php artisan migrate:refresh" # Reset and re-run all migrations
alias a:mg:rs="php artisan migrate:reset" # Rollback all database migrations
alias a:mg:rl="php artisan migrate:rollback" # Rollback the last database migration
alias a:mg:st="php artisan migrate:status" # Show the status of each migration
alias a:mg:fr="php artisan migrate:fresh" # Drop all tables and re-run all migrations
alias a:mg:i="php artisan migrate:install" # Create the migration repository
alias a:mg:rf="php artisan migrate:refresh" # Reset and re-run all migrations
alias a:mg:rs="php artisan migrate:reset" # Rollback all database migrations
alias a:mg:rl="php artisan migrate:rollback" # Rollback the last database migration
alias a:mg:st="php artisan migrate:status" # Show the status of each migration
# module
alias a:mo:i="php artisan module:install" # Install a module.
alias a:mo:r="php artisan module:reinstall" # Reinstall a module.
alias a:mo:u="php artisan module:uninstall" # Uninstall a module.
alias a:mo:i="php artisan module:install" # Install a module.
alias a:mo:r="php artisan module:reinstall" # Reinstall a module.
alias a:mo:u="php artisan module:uninstall" # Uninstall a module.
# notifications
alias a:no:tb="php artisan notifications:table" # Create a migration for the notifications table
alias a:no:tb="php artisan notifications:table" # Create a migration for the notifications table
# package
alias a:pk:d="php artisan package:discover" # Rebuild the cached package manifest
alias a:pk:d="php artisan package:discover" # Rebuild the cached package manifest
# queue
alias a:qu:fa="php artisan queue:failed" # List all of the failed queue jobs
alias a:qu:ft="php artisan queue:failed-table" # Create a migration for the failed queue jobs database table
alias a:qu:fl="php artisan queue:flush" # Flush all of the failed queue jobs
alias a:qu:fg="php artisan queue:forget" # Delete a failed queue job
alias a:qu:li="php artisan queue:listen" # Listen to a given queue
alias a:qu:rs="php artisan queue:restart" # Restart queue worker daemons after their current job
alias a:qu:rt="php artisan queue:retry" # Retry a failed queue job
alias a:qu:tb="php artisan queue:table" # Create a migration for the queue jobs database table
alias a:qu:w="php artisan queue:work" # Start processing jobs on the queue as a daemon
alias a:qu:fa="php artisan queue:failed" # List all of the failed queue jobs
alias a:qu:ft="php artisan queue:failed-table" # Create a migration for the failed queue jobs database table
alias a:qu:fl="php artisan queue:flush" # Flush all of the failed queue jobs
alias a:qu:fg="php artisan queue:forget" # Delete a failed queue job
alias a:qu:li="php artisan queue:listen" # Listen to a given queue
alias a:qu:rs="php artisan queue:restart" # Restart queue worker daemons after their current job
alias a:qu:rt="php artisan queue:retry" # Retry a failed queue job
alias a:qu:tb="php artisan queue:table" # Create a migration for the queue jobs database table
alias a:qu:w="php artisan queue:work" # Start processing jobs on the queue as a daemon
# route
alias a:ro:ca="php artisan route:cache" # Create a route cache file for faster route registration
alias a:ro:cl="php artisan route:clear" # Remove the route cache file
alias a:ro:ls="php artisan route:list" # List all registered routes
alias a:ro:ca="php artisan route:cache" # Create a route cache file for faster route registration
alias a:ro:cl="php artisan route:clear" # Remove the route cache file
alias a:ro:ls="php artisan route:list" # List all registered routes
# schedule
alias a:sc:r="php artisan schedule:run" # Run the scheduled commands
alias a:sc:r="php artisan schedule:run" # Run the scheduled commands
# scout
alias a:su:fl="php artisan scout:flush" # Flush all of the model's records from the index
alias a:su:im="php artisan scout:import" # Import the given model into the search index
alias a:su:fl="php artisan scout:flush" # Flush all of the model's records from the index
alias a:su:im="php artisan scout:import" # Import the given model into the search index
# session
alias a:se:tb="php artisan session:table" # Create a migration for the session database table
alias a:se:tb="php artisan session:table" # Create a migration for the session database table
# storage
alias a:sg:l="php artisan storage:link" # Create a symbolic link from "public/storage" to "storage/app/public"
alias a:sg:l="php artisan storage:link" # Create a symbolic link from "public/storage" to "storage/app/public"
# streams
alias a:st:cl="php artisan streams:cleanup" # Cleanup streams entry models.
alias a:st:co="php artisan streams:compile" # Compile streams entry models.
alias a:st:d="php artisan streams:destroy" # Destroy a namespace.
alias a:st:p="php artisan streams:publish" # Publish configuration and translations for streams.
alias a:st:r="php artisan streams:refresh" # Refresh streams generated components.
alias a:st:cl="php artisan streams:cleanup" # Cleanup streams entry models.
alias a:st:co="php artisan streams:compile" # Compile streams entry models.
alias a:st:d="php artisan streams:destroy" # Destroy a namespace.
alias a:st:p="php artisan streams:publish" # Publish configuration and translations for streams.
alias a:st:r="php artisan streams:refresh" # Refresh streams generated components.
# tntsearch
alias a:tn:im="php artisan tntsearch:import" # Import the given model into the search index
alias a:tn:im="php artisan tntsearch:import" # Import the given model into the search index
# vendor
alias a:ve:p="php artisan vendor:publish" # Publish any publishable assets from vendor packages
alias a:ve:p="php artisan vendor:publish" # Publish any publishable assets from vendor packages
# view
alias a:vi:cl="php artisan view:clear" # Clear all compiled view files
alias a:vi:cl="php artisan view:clear" # Clear all compiled view files

View File

@ -1,4 +1,4 @@
# shellcheck shell=bash
cite 'about-alias'
about-alias 'rails abbreviations'
# Rails Commands
@ -14,9 +14,9 @@ alias rd='rails destroy'
alias dbm='rake db:migrate'
alias ss='script/server'
alias ts="thin start" # thin server
alias ts="thin start" # thin server
alias sc='script/console'
alias restartapp='touch tmp/restart.txt'
alias restart='touch tmp/restart.txt' # restart passenger
alias restart='touch tmp/restart.txt' # restart passenger
alias devlog='tail -f log/development.log'
alias taild='tail -f log/development.log' # tail dev log

View File

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

View File

@ -1,22 +1,15 @@
# shellcheck shell=bash
cite 'about-alias'
about-alias 'systemd service'
case $OSTYPE in
linux*)
# Improve aliases by bringing the common root `sc|scd` + `sre` for action + `u` for user
alias sc='systemctl'
alias scu='systemctl --user'
alias scdr='systemctl daemon-reload'
alias scdru='systemctl --user daemon-reload'
alias scr='systemctl restart'
alias scru='systemctl --user restart'
alias sce='systemctl stop'
alias sceu='systemctl --user stop'
alias scs='systemctl start'
alias scsu='systemctl --user start'
# Keeping previous aliases for a non-breaking change.
alias scue='sceu'
alias scus='scsu'
alias scur='scdru'
;;
linux*)
alias sc='systemctl'
alias scr='systemctl daemon-reload'
alias scu='systemctl --user'
alias scur='systemctl --user daemon-reload'
alias sce='systemctl stop'
alias scue='systemctl --user stop'
alias scs='systemctl start'
alias scus='systemctl --user start'
;;
esac

View File

@ -1,9 +1,10 @@
# shellcheck shell=bash
about-alias 'Aliases for Terraform and Terragrunt'
# Aliases for Terraform and Terragrunt
cite 'about-alias'
about-alias 'Terraform abbreviations'
alias tf='terraform'
alias tfi='tf init'
alias tfv='terraform validate'
alias tfp='terraform plan'
alias tfa='terraform apply'
alias tfd='terraform destroy'
alias tfd='terraform destory'

View File

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

View File

@ -1,10 +1,10 @@
# shellcheck shell=bash
cite 'about-alias'
about-alias 'textmate abbreviations'
case $OSTYPE in
darwin*)
# Textmate
alias e='mate . &'
alias et='mate app config db lib public script test spec config.ru Gemfile Rakefile README &'
;;
darwin*)
# Textmate
alias e='mate . &'
alias et='mate app config db lib public script test spec config.ru Gemfile Rakefile README &'
;;
esac

View File

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

View File

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

View File

@ -1,11 +1,11 @@
# shellcheck shell=bash
cite 'uuid-alias'
about-alias 'uuidgen aliases'
if _command_exists uuid; then # Linux
alias uuidu="uuid | tr '[:lower:]' '[:upper:]'"
alias uuidl=uuid
alias uuidu="uuid | tr '[:lower:]' '[:upper:]'"
alias uuidl=uuid
elif _command_exists uuidgen; then # macOS/BSD
alias uuidu="uuidgen"
alias uuid="uuidgen | tr '[:upper:]' '[:lower:]'" # because upper case is like YELLING
alias uuidl=uuid
alias uuidu="uuidgen"
alias uuid="uuidgen | tr '[:upper:]' '[:lower:]'" # because upper case is like YELLING
alias uuidl=uuid
fi

View File

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

View File

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

View File

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

View File

@ -1,110 +1,159 @@
#!/usr/bin/env bash
# shellcheck source-path=SCRIPTDIR/lib source-path=SCRIPTDIR/scripts
# shellcheck disable=SC2034
#
# Initialize Bash It
BASH_IT_LOG_PREFIX="core: main: "
: "${BASH_IT:=${BASH_SOURCE%/*}}"
: "${BASH_IT_CUSTOM:=${BASH_IT}/custom}"
: "${CUSTOM_THEME_DIR:="${BASH_IT_CUSTOM}/themes"}"
: "${BASH_IT_BASHRC:=${BASH_SOURCE[${#BASH_SOURCE[@]} - 1]}}"
# Only set $BASH_IT if it's not already set
if [ -z "$BASH_IT" ]; then
# 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
# shellcheck source-path=SCRIPTDIR/vendor/github.com/erichs/composure
source "${BASH_IT}/vendor/github.com/erichs/composure/composure.sh"
# shellcheck disable=SC1090
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
cite _about _param _example _group _author _version
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
_log_debug "Loading libraries(except appearance)..."
LIB="${BASH_IT}/lib/*.bash"
APPEARANCE_LIB="${BASH_IT}/lib/appearance.bash"
for _bash_it_main_file_lib in "${BASH_IT}/lib"/*.bash; do
[[ "$_bash_it_main_file_lib" == "$APPEARANCE_LIB" ]] && continue
_bash-it-log-prefix-by-path "${_bash_it_main_file_lib}"
_log_debug "Loading library file..."
# shellcheck disable=SC1090
source "$_bash_it_main_file_lib"
BASH_IT_LOG_PREFIX="core: main: "
for _bash_it_config_file in $LIB; do
if [ "$_bash_it_config_file" != "$APPEARANCE_LIB" ]; then
filename=${_bash_it_config_file##*/}
filename=${filename%.bash}
BASH_IT_LOG_PREFIX="lib: ${filename}: "
_log_debug "Loading library file..."
# shellcheck disable=SC1090
source "$_bash_it_config_file"
fi
done
# Load the global "enabled" directory, then enabled aliases, completion, plugins
# "_bash_it_main_file_type" param is empty so that files get sourced in glob order
for _bash_it_main_file_type in "" "aliases" "plugins" "completion"; do
BASH_IT_LOG_PREFIX="core: reloader: "
# shellcheck disable=SC2140
source "${BASH_IT}/scripts/reloader.bash" ${_bash_it_main_file_type:+"skip" "$_bash_it_main_file_type"}
BASH_IT_LOG_PREFIX="core: main: "
# Load vendors
BASH_IT_LOG_PREFIX="vendor: "
for _bash_it_vendor_init in "${BASH_IT}"/vendor/init.d/*.bash; do
_log_debug "Loading \"$(basename "${_bash_it_vendor_init}" .bash)\"..."
# shellcheck disable=SC1090
source "${_bash_it_vendor_init}"
done
unset _bash_it_vendor_init
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
# Load theme, if a theme was set
# shellcheck source-path=SCRIPTDIR/themes
if [[ -n "${BASH_IT_THEME:-}" ]]; then
_log_debug "Loading theme '${BASH_IT_THEME}'."
if [[ -n "${BASH_IT_THEME}" ]]; then
_log_debug "Loading \"${BASH_IT_THEME}\" 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: "
# shellcheck source=./themes/githelpers.theme.bash
source "${BASH_IT}/themes/githelpers.theme.bash"
BASH_IT_LOG_PREFIX="themes: p4helpers: "
# shellcheck source=./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: "
# shellcheck source=./themes/base.theme.bash
source "${BASH_IT}/themes/base.theme.bash"
BASH_IT_LOG_PREFIX="lib: appearance: "
# appearance (themes) now, after all dependencies
# shellcheck source=SCRIPTDIR/lib/appearance.bash
# shellcheck source=./lib/appearance.bash
source "$APPEARANCE_LIB"
BASH_IT_LOG_PREFIX="core: main: "
fi
BASH_IT_LOG_PREFIX="core: main: "
_log_debug "Loading custom aliases, completion, plugins..."
for _bash_it_main_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 [[ -s "${_bash_it_main_file_custom}" ]]; then
_bash-it-log-prefix-by-path "${_bash_it_main_file_custom}"
for file_type in "aliases" "completion" "plugins"; do
if [ -e "${BASH_IT}/${file_type}/custom.${file_type}.bash" ]; then
BASH_IT_LOG_PREFIX="${file_type}: custom: "
_log_debug "Loading component..."
# shellcheck disable=SC1090
source "${_bash_it_main_file_custom}"
source "${BASH_IT}/${file_type}/custom.${file_type}.bash"
fi
BASH_IT_LOG_PREFIX="core: main: "
done
# Custom
BASH_IT_LOG_PREFIX="core: main: "
_log_debug "Loading general custom files..."
for _bash_it_main_file_custom in "${BASH_IT_CUSTOM}"/*.bash "${BASH_IT_CUSTOM}"/*/*.bash; do
if [[ -s "${_bash_it_main_file_custom}" ]]; then
_bash-it-log-prefix-by-path "${_bash_it_main_file_custom}"
CUSTOM="${BASH_IT_CUSTOM:=${BASH_IT}/custom}/*.bash ${BASH_IT_CUSTOM:=${BASH_IT}/custom}/**/*.bash"
for _bash_it_config_file in $CUSTOM; do
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..."
# shellcheck disable=SC1090
source "$_bash_it_main_file_custom"
source "$_bash_it_config_file"
fi
BASH_IT_LOG_PREFIX="core: main: "
done
if [[ -n "${PROMPT:-}" ]]; then
PS1="${PROMPT}"
unset _bash_it_config_file
if [[ $PROMPT ]]; then
export PS1="\[""$PROMPT""\]"
fi
# Adding Support for other OSes
if _command_exists gloobus-preview; then
PREVIEW="less"
if [ -s /usr/bin/gloobus-preview ]; then
PREVIEW="gloobus-preview"
elif [[ -d /Applications/Preview.app ]]; then
elif [ -s /Applications/Preview.app ]; then
# shellcheck disable=SC2034
PREVIEW="/Applications/Preview.app"
else
PREVIEW="less"
fi
# Load all the Jekyll stuff
if [ -e "$HOME/.jekyllconfig" ]; then
# shellcheck disable=SC1090
. "$HOME/.jekyllconfig"
fi
# BASH_IT_RELOAD_LEGACY is set.
if [[ -n "${BASH_IT_RELOAD_LEGACY:-}" ]] && ! _command_exists reload; then
# shellcheck disable=SC2139
alias reload="builtin source '${BASH_IT_BASHRC?}'"
if ! command -v reload &> /dev/null && [ -n "$BASH_IT_RELOAD_LEGACY" ]; then
case $OSTYPE in
darwin*)
alias reload='source ~/.bash_profile'
;;
*)
alias reload='source ~/.bashrc'
;;
esac
fi
for _bash_it_library_finalize_f in "${_bash_it_library_finalize_hook[@]:-}"; do
eval "${_bash_it_library_finalize_f?}" # Use `eval` to achieve the same behavior as `$PROMPT_COMMAND`.
done
unset "${!_bash_it_library_finalize_@}" "${!_bash_it_main_file_@}"
# Disable trap DEBUG on subshells - https://github.com/Bash-it/bash-it/pull/1040
set +T

View File

@ -1,7 +1,7 @@
#######################################################################
# Allow-list of files to be lint-checked by CI
#
# Directory Support
# Directory Suport
# Directory references are allowed within the file, ie:
#
# themes/powerline
@ -16,53 +16,71 @@
# root directories
#
aliases/
docs/
hooks/
scripts/
docs
hooks
# root files
#
.gitattributes
bash_it.sh
clean_files.txt
install.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
#
completion/available/apm.completion.bash
completion/available/awless.completion.bash
completion/available/awscli.completion.bash
completion/available/bash-it.completion.bash
completion/available/brew.completion.bash
completion/available/cargo.completion.bash
completion/available/composer.completion.bash
completion/available/conda.completion.bash
completion/available/consul.completion.bash
completion/available/dart.completion.bash
completion/available/django.completion.bash
completion/available/dmidecode.completion.bash
completion/available/docker-machine.completion.bash
completion/available/docker.completion.bash
completion/available/dotnet.completion.bash
completion/available/flutter.completion.bash
completion/available/docker-machine.completion.bash
completion/available/gcloud.completion.bash
completion/available/gem.completion.bash
completion/available/git.completion.bash
completion/available/github-cli.completion.bash
completion/available/go.completion.bash
completion/available/github-cli.completion.bash
completion/available/helm.completion.bash
completion/available/jboss5.completion.bash
completion/available/jboss7.completion.bash
completion/available/jungle.completion.bash
completion/available/knife.completion.bash
completion/available/kontena.completion.bash
completion/available/kubectl.completion.bash
completion/available/laravel.completion.bash
completion/available/lerna.completion.bash
completion/available/minikube.completion.bash
completion/available/ngrok.completion.bash
completion/available/notify-send.completion.bash
completion/available/npm.completion.bash
completion/available/packer.completion.bash
@ -71,106 +89,19 @@ completion/available/pip3.completion.bash
completion/available/pipenv.completion.bash
completion/available/pipx.completion.bash
completion/available/rustup.completion.bash
completion/available/sdkman.completion.bash
completion/available/system.completion.bash
completion/available/vault.completion.bash
completion/available/sdkman.completion.bash
completion/available/vuejs.completion.bash
completion/available/wpscan.completion.bash
completion/available/yarn.completion.bash
# libraries
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
# aliases
#
plugins/available/alias-completion.plugin.bash
plugins/available/autojump.plugin.bash
plugins/available/base.plugin.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
aliases/available/dnf.aliases.bash
aliases/available/vim.aliases.bash
aliases/available/git.aliases.bash
# tests
#
test/completion/aliases.completion.bats
test/run
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/.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
if _command_exists aws_completer; then
complete -C "$(command -v aws_completer)" aws
fi
[[ -x "$(which aws_completer)" ]] && complete -C "$(which aws_completer)" aws

View File

@ -1,95 +1,140 @@
# shellcheck shell=bash
#!/usr/bin/env bash
function _compreply_candidates() {
local IFS=$'\n'
read -d '' -ra COMPREPLY < <(compgen -W "${candidates[*]}" -- "${cur}")
_bash-it-comp-enable-disable()
{
local enable_disable_args="alias completion plugin"
COMPREPLY=( $(compgen -W "${enable_disable_args}" -- ${cur}) )
}
function _bash-it() {
local cur prev verb file_type candidates suffix
COMPREPLY=()
cur="${COMP_WORDS[COMP_CWORD]}"
prev="${COMP_WORDS[COMP_CWORD - 1]}"
verb="${COMP_WORDS[1]}"
file_type="${COMP_WORDS[2]:-}"
candidates=('disable' 'enable' 'help' 'migrate' 'reload' 'restart' 'preview' 'profile' 'doctor' 'search' 'show' 'update' 'version')
case "${verb}" in
show)
candidates=('aliases' 'completions' 'plugins')
_compreply_candidates
;;
help)
if [[ "${prev}" == "aliases" ]]; then
candidates=('all' "$(_bash-it-component-list "${file_type}")")
_compreply_candidates
else
candidates=('aliases' 'completions' 'migrate' 'plugins' 'update')
_compreply_candidates
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}")
_bash-it-comp-list-available-not-enabled()
{
subdirectory="$1"
_compreply_candidates
fi
;;
save | list) ;;
*)
candidates=('load' 'save' 'list' 'rm')
_compreply_candidates
;;
esac
;;
doctor)
candidates=('errors' 'warnings' 'all')
_compreply_candidates
;;
update)
if [[ "${cur}" == -* ]]; then
candidates=('-s' '--silent')
else
candidates=('stable' 'dev')
fi
_compreply_candidates
;;
migrate | reload | restart | search | version) ;;
preview)
_bash-it-preview # completes itself
return 0
;;
enable | disable)
if [[ "${verb}" == "enable" ]]; then
suffix="disabled"
else
suffix="enabled"
fi
case "${file_type}" in
alias | completion | plugin)
candidates=('all' "$("_bash-it-component-list-${suffix}" "${file_type}")")
_compreply_candidates
;;
*)
candidates=('alias' 'completion' 'plugin')
_compreply_candidates
;;
esac
;;
*)
_compreply_candidates
;;
esac
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=()
cur="${COMP_WORDS[COMP_CWORD]}"
prev="${COMP_WORDS[COMP_CWORD-1]}"
chose_opt="${COMP_WORDS[1]}"
file_type="${COMP_WORDS[2]}"
opts="disable enable help migrate reload restart doctor search show update version"
case "${chose_opt}" in
show)
local show_args="aliases completions plugins"
COMPREPLY=( $(compgen -W "${show_args}" -- ${cur}) )
return 0
;;
help)
if [ x"${prev}" == x"aliases" ]; then
_bash-it-comp-list-available aliases
return 0
else
local help_args="aliases completions migrate plugins update"
COMPREPLY=( $(compgen -W "${help_args}" -- ${cur}) )
return 0
fi
;;
doctor)
local doctor_args="errors warnings all"
COMPREPLY=( $(compgen -W "${doctor_args}" -- ${cur}) )
return 0
;;
update)
if [[ ${cur} == -* ]];then
local update_args="-s --silent"
else
local update_args="stable dev"
fi
COMPREPLY=( $(compgen -W "${update_args}" -- ${cur}) )
return 0
;;
migrate | reload | search | version)
return 0
;;
enable | disable)
if [ x"${chose_opt}" == x"enable" ];then
suffix="available-not-enabled"
else
suffix="enabled"
fi
case "${file_type}" in
alias)
_bash-it-comp-list-${suffix} aliases
return 0
;;
plugin)
_bash-it-comp-list-${suffix} plugins
return 0
;;
completion)
_bash-it-comp-list-${suffix} completion
return 0
;;
*)
_bash-it-comp-enable-disable
return 0
;;
esac
;;
esac
COMPREPLY=( $(compgen -W "${opts}" -- ${cur}) )
return 0
}
# Activate completion for bash-it and its common misspellings
complete -F _bash-it bash-it
complete -F _bash-it bash-ti
complete -F _bash-it shit
complete -F _bash-it bashit
complete -F _bash-it batshit
complete -F _bash-it bash_it
complete -F _bash-it-comp bash-it
complete -F _bash-it-comp bash-ti
complete -F _bash-it-comp shit
complete -F _bash-it-comp bashit
complete -F _bash-it-comp batshit
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
# BASH_IT_LOAD_PRIORITY: 375
if [[ "$OSTYPE" != 'darwin'* ]]; then
if [[ "$(uname -s)" != 'Darwin' ]]; then
_log_warning "unsupported operating system - only 'Darwin' is supported"
return 0
fi
# 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
# shellcheck disable=1090,1091
source "$BASH_IT_HOMEBREW_PREFIX/etc/bash_completion.d/brew"
BREW_PREFIX=${BREW_PREFIX:-$(brew --prefix)}
elif [[ -r "$BASH_IT_HOMEBREW_PREFIX/Library/Contributions/brew_bash_completion.sh" ]]; then
# shellcheck disable=1090,1091
source "$BASH_IT_HOMEBREW_PREFIX/Library/Contributions/brew_bash_completion.sh"
if [[ -r "$BREW_PREFIX"/etc/bash_completion.d/brew ]]; then
# shellcheck disable=1090
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:
# https://github.com/Bash-it/bash-it/issues/1458
# https://docs.brew.sh/Shell-Completion
# shellcheck disable=1090,1091
source "$BASH_IT_HOMEBREW_PREFIX/completions/bash/brew"
# shellcheck disable=1090
source "$BREW_PREFIX"/completions/bash/brew
fi

View File

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

View File

@ -3,5 +3,5 @@ cite "about-completion"
about-completion "Hashicorp consul completion"
if _command_exists consul; then
complete -C "$(command -v consul)" consul
complete -C "$(which consul)" consul
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 "$_"
fi
_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
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
local completions_func=_docker_compose_${command//-/_}
_is_function $completions_func && $completions_func
declare -F $completions_func >/dev/null && $completions_func
eval "$previous_extglob_setting"
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/)
#
@ -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
case "$OSTYPE" in
'darwin'*|'freebsd'*)
case `uname` in
Darwin|FreeBSD)
__FAB_COMPLETION_MTIME_COMMAND="stat -f '%m'"
;;
*)
@ -91,7 +91,7 @@ function __fab_completion() {
-*)
if [[ -z "${__FAB_COMPLETION_LONG_OPT}" ]]; then
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
opts="${__FAB_COMPLETION_LONG_OPT}"
;;
@ -101,7 +101,7 @@ function __fab_completion() {
# -*)
# if [[ -z "${__FAB_COMPLETION_SHORT_OPT}" ]]; then
# 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
# opts="${__FAB_COMPLETION_SHORT_OPT}"
# ;;

View File

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

View File

@ -1,42 +1,39 @@
# shellcheck shell=bash
#
# Locate and load completions for `git`.
#!/usr/bin/env bash
# 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
_command_exists git || return
_command_exists git || return 0
# Don't handle completion if it's already managed
if complete -p git &> /dev/null; then
_log_warning "completion already loaded - this usually means it is safe to stop using this completion"
return 0
if complete -p git &>/dev/null ; then
_log_warning "completion already loaded - this usually means it is safe to stop using this completion"
return 0
fi
_git_bash_completion_xcrun_git=
if _command_exists xcrun; then
_git_bash_completion_xcrun_git="$(xcrun --find git)"
fi
_git_bash_completion_found=false
_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
"${_git_bash_completion_xcrun_git%/bin/git}/share/git-core/git-completion.bash"
# MacOS non-system locations
'/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
_git_bash_completion_found=false
for _comp_path in "${_git_bash_completion_paths[@]}"; do
if [[ -r "$_comp_path" ]]; then
_git_bash_completion_found=true
# shellcheck disable=SC1090 # don't follow
source "$_comp_path"
break
fi
for _comp_path in "${_git_bash_completion_paths[@]}" ; do
if [ -r "$_comp_path" ] ; then
_git_bash_completion_found=true
source "$_comp_path"
break
fi
done
# Cleanup
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
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
if ! _command_exists __git_find_subcommand
then
if [ -z "`type -t __git_find_subcommand`" ]; then
alias __git_find_subcommand=__git_find_on_cmdline
fi

View File

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

View File

@ -1,5 +1,3 @@
# shellcheck shell=bash
# Copyright (c) 2017 Eric Wendelin
# Permission is hereby granted, free of charge, to any person obtaining a copy of
@ -24,9 +22,17 @@
# Avoid inaccurate completions for subproject tasks
COMP_WORDBREAKS=$(echo "$COMP_WORDBREAKS" | sed -e 's/://g')
function __gradle-set-project-root-dir() {
project_root_dir="$(_bash-it-find-in-ancestor "settings.gradle" "gradlew")"
return "$?"
__gradle-set-project-root-dir() {
local dir=`pwd`
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() {
@ -52,9 +58,9 @@ __gradle-set-cache-name() {
__gradle-set-files-checksum() {
# 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)")
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}')
else
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
# 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
fi
}

View File

@ -23,12 +23,12 @@
# 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 ! _is_function _git && _is_function _completion_loader; then
if ! declare -F _git > /dev/null && declare -F _completion_loader > /dev/null; then
_completion_loader git
fi
# 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
eval "$(declare -f __git_list_all_commands | \
sed 's/__git_list_all_commands/__git_list_all_commands_without_hub/')"
@ -227,7 +227,7 @@ EOF
((c++))
done
if [ -z "$name" ]; then
repo="$(basename "${PWD}")"
repo=$(basename "$(pwd)")
fi
case "$prev" in
-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
about-completion "jboss7 completion"
# shellcheck disable=SC1090
source "${BASH_IT}"/vendor/github.com/rparree/jboss-bash-completion/jboss7
# Completions for JBoss Application Server 7 (EAP 6)
# VERSION: 0.6
# DATE: 2012-10-30
# 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() {
local CACHE_NAME=$1
local CACHE_PATH="$_KNIFE_AUTOCOMPLETE_CACHE_DIR/$CACHE_NAME"
# shellcheck disable=SC2155
local TMP_FILE=$(mktemp "$_KAC_CACHE_TMP_DIR/$CACHE_NAME.XXXX")
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
@ -55,19 +54,18 @@ _KAC_regen_cache() {
# cached files can't have spaces in their names
_KAC_get_cache_name_from_command() {
echo "${@// /_SPACE_}"
echo "${@/ /_SPACE_}"
}
# the reverse operation from the function above
_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
# otherwise it waits for the cache to be generated
# 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)
# shellcheck disable=SC2155
_KAC_get_and_regen_cache() {
# the cache name can't have space in it
local CACHE_NAME=$(_KAC_get_cache_name_from_command "$@")
@ -102,7 +100,7 @@ _KAC_clean_cache() {
# 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.
[[ -n "${KNIFE_CACHE_CLEAN}" ]] && _KAC_clean_cache
[[ "${KNIFE_CACHE_CLEAN}" ]] && _KAC_clean_cache
#####################################
### End of cache helper functions ###
@ -120,7 +118,7 @@ _KAC_get_current_base_command() {
local PREVIOUS="knife"
local I=1
local CURRENT
while [[ "${I}" -le "${COMP_CWORD}" ]]; do
while [ $I -le "$COMP_CWORD" ]; do
# command words are all lower-case
echo "${COMP_WORDS[$I]}" | grep -E "^[a-z]+$" > /dev/null || break
CURRENT="$PREVIOUS ${COMP_WORDS[$I]}"
@ -129,13 +127,12 @@ _KAC_get_current_base_command() {
I=$((I + 1))
done
_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
# (i.e. handles "plural" arguments such as knife cookbook upload cookbook1 cookbook2 and so on...)
# assumes the current base command is complete
# shellcheck disable=SC2155
_KAC_get_current_arg_position() {
local CURRENT_ARG_POS=$((_KAC_CURRENT_COMMAND_NB_WORDS + 1))
local COMPLETE_COMMAND=$(grep -E "^$_KAC_CURRENT_COMMAND" "$_KAC_CACHE_PATH")
@ -153,11 +150,10 @@ _KAC_get_current_arg_position() {
_knife() {
_KAC_get_and_regen_cache _KAC_knife_commands
local RAW_LIST ITEM REGEN_CMD ARG_POSITION
# shellcheck disable=SC2034
COMREPLY=()
# get correct command & arg pos
_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
# NOTE: I chose to explicitely fetch & cache _certain_ informations for the server (cookbooks & node names, etc)

View File

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

View File

@ -1,5 +1,3 @@
# shellcheck shell=bash
# Bash completion for Makefile
# Loosely adapted from http://stackoverflow.com/a/38415982/1472048
@ -19,7 +17,7 @@ _makecomplete() {
for f in "${files[@]}" ; do
while IFS='' read -r line ; do
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
[ "${#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
function __notify-send_completions() {
# shellcheck disable=SC2155
local curr=$(_get_cword)
# shellcheck disable=SC2155
local prev=$(_get_pword)
case $prev in

View File

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

View File

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

View File

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

View File

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

View File

@ -7,7 +7,7 @@ _is_function _rl_enabled ||
_pj() {
_is_function _init_completion || return
_is_function _rl_enabled || return
[ -n "$BASH_IT_PROJECT_PATHS" ] || return
[ -n "$PROJECT_PATHS" ] || return
shift
[ "$1" == "open" ] && shift
@ -21,7 +21,7 @@ _pj() {
local -r mark_dirs=$(_rl_enabled mark-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
k="${#COMPREPLY[@]}"
for j in $( compgen -d $i/$cur ); do

View File

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

View File

@ -1,22 +1,21 @@
# shellcheck shell=bash
#!/bin/bash
# ---------------------------------------------------------------------------+
# |
# Thanks to Alexander Korznikov |
# Thanks to Alexander Korznikov |
# http://www.korznikov.com/2014/12/bash-tab-completion-for-awesome-tool.html |
# |
# ---------------------------------------------------------------------------+
if _command_exists sqlmap
then
if command -v sqlmap > /dev/null; then
function _sqlmap()
_sqlmap()
{
local cur prev
COMPREPLY=()
cur="$(_get_cword)"
prev="$(_get_pword)"
cur=$(_get_cword)
prev=$(_get_pword)
case $prev in
@ -144,7 +143,7 @@ then
--mobile --page-rank --purge-output --smart \
--sqlmap-shell --wizard '
COMPREPLY=( $( \
(while read -d ' ' i; do
(while read -d ' ' i; do
[[ -z "$i" || "${onlyonce/ ${i%% *} / }" == "$onlyonce" ]] &&
continue
# flatten array with spaces on either side,
@ -153,7 +152,7 @@ then
COMPREPLY=" ${COMPREPLY[@]} "
# remove word from list of completions
COMPREPLY=( ${COMPREPLY/ ${i%% *} / } )
done
done
printf '%s ' "${COMPREPLY[@]}") <<<"${COMP_WORDS[@]}"
) )

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.
# If Homebrew is installed (OS X), it's Bash completion modules are loaded.
# Load before other completions
# BASH_IT_LOAD_PRIORITY: 325
if [[ -r /etc/bash_completion ]] ; then
# shellcheck disable=SC1091
source /etc/bash_completion
# 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
# Some distribution makes use of a profile.d script to import completion.
elif [[ -r /etc/profile.d/bash_completion.sh ]]; then
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
elif [[ -r /etc/profile.d/bash_completion.sh ]] ; then
# shellcheck disable=SC1091
source /etc/profile.d/bash_completion.sh
fi
if [[ ${__bash_it_restore_nounset:-false} == "true" ]]; then
shopt -so nounset
if [[ "$(uname -s)" == 'Darwin' ]] && _command_exists brew ; then
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
unset __bash_it_restore_nounset

View File

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

View File

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

View File

@ -1,16 +1,15 @@
# shellcheck shell=bash
#!/usr/bin/bash
_command_exists wpscan || return
if command -v wpscan > /dev/null; then
__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")
COMPREPLY=()
for _opt_ in ${OPTS[@]}; do
if [[ "$_opt_" == "$2"* ]]; then
COMPREPLY+=("$_opt_")
fi
done
}
function __wpscan_completion() {
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=()
for _opt_ in "${OPTS[@]}"; do
if [[ "$_opt_" == "$2"* ]]; then
COMPREPLY+=("$_opt_")
fi
done
}
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)
![Build Status](../../../workflows/CI/badge.svg?event=push)
# Bash-it
![Build Status](https://github.com/Bash-it/bash-it/workflows/CI/badge.svg?branch=master)
![Docs Status](https://readthedocs.org/projects/bash-it/badge/)
![License](https://img.shields.io/github/license/Bash-it/bash-it)
![shell](https://img.shields.io/badge/Shell-Bash-blue)
[![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)
**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:)
@ -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``
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.
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
[List of contributors](https://github.com/Bash-it/bash-it/contributors)
* [List of contributors][contribute]
## License
Bash-it is licensed under the [MIT License](https://github.com/Bash-it/bash-it/blob/master/LICENSE).
[contribute]: https://github.com/Bash-it/bash-it/contributors

View File

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

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