Compare commits
No commits in common. "master" and "gh-pages" have entirely different histories.
|
|
@ -1,36 +0,0 @@
|
|||
# EditorConfig is awesome: http://EditorConfig.org
|
||||
|
||||
[*]
|
||||
indent_style = space
|
||||
indent_size = 2
|
||||
end_of_line = lf
|
||||
charset = utf-8
|
||||
|
||||
trim_trailing_whitespace = true
|
||||
insert_final_newline = true
|
||||
|
||||
[**.{md,rst}]
|
||||
trim_trailing_whitespace = false
|
||||
|
||||
[.git*]
|
||||
indent_size = tab
|
||||
indent_style = tab
|
||||
|
||||
[{**.*sh,test/run,**.bats}]
|
||||
indent_size = tab
|
||||
indent_style = tab
|
||||
|
||||
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
|
||||
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
|
||||
|
|
@ -1,9 +0,0 @@
|
|||
*.sh text eol=lf
|
||||
*.bash text eol=lf
|
||||
|
||||
# Docs allow trailing whitespaces
|
||||
*.md whitespace=-blank-at-eol
|
||||
*.rst whitespace=-blank-at-eol
|
||||
|
||||
# Windows files
|
||||
*.bat text eol=crlf
|
||||
|
|
@ -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.
|
||||
|
|
@ -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
|
||||
|
|
@ -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.
|
||||
|
|
@ -1,30 +0,0 @@
|
|||
<!--- Provide a general summary of your changes in the Title above -->
|
||||
|
||||
## Description
|
||||
<!--- Describe your changes in detail -->
|
||||
|
||||
## Motivation and Context
|
||||
<!--- Why is this change required? What problem does it solve? -->
|
||||
<!--- If it fixes an open issue, please link to the issue here. -->
|
||||
|
||||
## How Has This Been Tested?
|
||||
<!--- Please describe in detail how you tested your changes. -->
|
||||
<!--- Include details of your testing environment, and the tests you ran to -->
|
||||
<!--- see how your change affects other areas of the code, etc. -->
|
||||
|
||||
## Screenshots (if appropriate):
|
||||
|
||||
## Types of changes
|
||||
<!--- What types of changes does your code introduce? Put an `x` in all the boxes that apply: -->
|
||||
- [ ] Bug fix (non-breaking change which fixes an issue)
|
||||
- [ ] New feature (non-breaking change which adds functionality)
|
||||
- [ ] Breaking change (fix or feature that would cause existing functionality to change)
|
||||
|
||||
## Checklist:
|
||||
<!--- Go over all the following points, and put an `x` in all the boxes that apply. -->
|
||||
<!--- If you're unsure about any of these, don't hesitate to ask. We're here to help! -->
|
||||
- [ ] My code follows the code style of this project.
|
||||
- [ ] If my change requires a change to the documentation, I have updated the documentation accordingly.
|
||||
- [ ] I have read the **CONTRIBUTING** document.
|
||||
- [ ] If I have added a new file, I also added it to ``clean_files.txt`` and formatted it using ``lint_clean_files.sh``.
|
||||
- [ ] I have added tests to cover my changes, and all the new and existing tests pass.
|
||||
|
|
@ -1,11 +0,0 @@
|
|||
# Configuration for probot-no-response - https://github.com/probot/no-response
|
||||
|
||||
# Number of days of inactivity before an Issue is closed for lack of response
|
||||
daysUntilClose: 14
|
||||
# Label requiring a response
|
||||
responseRequiredLabel: waiting-for-response
|
||||
# Comment to post when closing an Issue for lack of response. Set to `false` to disable
|
||||
closeComment: >
|
||||
This issue has been automatically closed because there has been no response
|
||||
to our request for more information from the original author.
|
||||
You can always reopen the issue if needed.
|
||||
|
|
@ -1,66 +0,0 @@
|
|||
name: CI
|
||||
|
||||
# Triggers the workflow on push or pull request events
|
||||
on: [push, pull_request]
|
||||
|
||||
jobs:
|
||||
bats-test:
|
||||
strategy:
|
||||
matrix:
|
||||
os: [ubuntu-20.04, ubuntu-22.04, macos-12, macos-11]
|
||||
|
||||
runs-on: ${{ matrix.os }}
|
||||
|
||||
steps:
|
||||
- uses: actions/checkout@v2
|
||||
- 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
|
||||
|
||||
build-docs:
|
||||
runs-on: ubuntu-latest
|
||||
|
||||
steps:
|
||||
- uses: actions/checkout@v2
|
||||
- name: Set up Python
|
||||
uses: actions/setup-python@v2
|
||||
with:
|
||||
python-version: 3.8
|
||||
- name: Install docs dependencies
|
||||
run: python3 -m pip install -r docs/requirements.txt
|
||||
- name: Build the docs
|
||||
run: sphinx-build -W -b html docs docs/_build/html
|
||||
|
||||
lint:
|
||||
runs-on: ubuntu-latest
|
||||
|
||||
steps:
|
||||
- uses: actions/checkout@v2
|
||||
- name: Set up Go
|
||||
uses: actions/setup-go@v2
|
||||
with:
|
||||
go-version: 1.17
|
||||
- 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
|
||||
- name: Install pre-commit
|
||||
run: python3 -m pip install -r test/lint-requirements.txt
|
||||
- name: Run lint
|
||||
run: ./lint_clean_files.sh
|
||||
|
|
@ -1,24 +0,0 @@
|
|||
.atom-build.json
|
||||
*/enabled/*
|
||||
.DS_Store
|
||||
custom/*
|
||||
!custom/example.bash
|
||||
.rvmrc
|
||||
aliases/custom.aliases.bash
|
||||
completion/custom.completion.bash
|
||||
lib/custom.bash
|
||||
plugins/custom.plugins.bash
|
||||
*.swp
|
||||
.*.un~
|
||||
bats
|
||||
.idea
|
||||
*.sublime-workspace
|
||||
*.sublime-project
|
||||
enabled/*
|
||||
/enabled
|
||||
tmp/
|
||||
|
||||
# Do not save profiles
|
||||
profiles/*
|
||||
# apart from the default one
|
||||
!profiles/default.bash_it
|
||||
|
|
@ -1,16 +0,0 @@
|
|||
[submodule "test_lib/bats-core"]
|
||||
path = test_lib/bats-core
|
||||
url = https://github.com/bats-core/bats-core
|
||||
branch = tags/v1.2.0
|
||||
[submodule "test_lib/bats-support"]
|
||||
path = test_lib/bats-support
|
||||
url = https://github.com/bats-core/bats-support
|
||||
branch = tags/v0.3.0
|
||||
[submodule "test_lib/bats-assert"]
|
||||
path = test_lib/bats-assert
|
||||
url = https://github.com/bats-core/bats-assert
|
||||
branch = tags/v2.0.0
|
||||
[submodule "test_lib/bats-file"]
|
||||
path = test_lib/bats-file
|
||||
url = https://github.com/bats-core/bats-file
|
||||
branch = tags/v0.3.0
|
||||
|
|
@ -1,50 +0,0 @@
|
|||
# See https://pre-commit.com for more information
|
||||
# See https://pre-commit.com/hooks.html for more hooks
|
||||
---
|
||||
# fail_fast: true
|
||||
minimum_pre_commit_version: 1.18.1
|
||||
exclude: "docs/_build/"
|
||||
repos:
|
||||
- repo: https://github.com/pre-commit/pre-commit-hooks
|
||||
rev: v2.3.0
|
||||
hooks:
|
||||
- id: trailing-whitespace
|
||||
exclude: ".(md|rst)$"
|
||||
- id: end-of-file-fixer
|
||||
- id: check-merge-conflict
|
||||
- id: mixed-line-ending
|
||||
- id: check-added-large-files
|
||||
- repo: https://github.com/jumanjihouse/pre-commit-hooks
|
||||
rev: 2.1.5
|
||||
hooks:
|
||||
- id: git-check # Configure in .gitattributes
|
||||
- id: shellcheck
|
||||
exclude: ".bats$"
|
||||
- id: shfmt
|
||||
exclude: ".bats$"
|
||||
- repo: https://github.com/Lucas-C/pre-commit-hooks
|
||||
rev: v1.1.7
|
||||
hooks:
|
||||
# - id: forbid-crlf
|
||||
- id: remove-crlf
|
||||
exclude: ".bat$"
|
||||
- repo: local
|
||||
hooks:
|
||||
- id: dot-sh
|
||||
name: Check .sh files against bash-it requirements
|
||||
entry: ./hooks/dot-sh.sh
|
||||
language: system
|
||||
files: "\\.sh$"
|
||||
types: [file]
|
||||
- id: dot-bash
|
||||
name: Check .bash files against bash-it requirements
|
||||
exclude: "test/test_helper.bash"
|
||||
entry: ./hooks/dot-bash.sh
|
||||
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
|
||||
|
|
@ -1,10 +0,0 @@
|
|||
version: 2
|
||||
|
||||
sphinx:
|
||||
builder: htmldir
|
||||
configuration: docs/conf.py
|
||||
|
||||
python:
|
||||
version: 3.7
|
||||
install:
|
||||
- requirements: docs/requirements.txt
|
||||
21
LICENSE
21
LICENSE
|
|
@ -1,21 +0,0 @@
|
|||
MIT License
|
||||
|
||||
Copyright (c) 2020-2021 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
|
||||
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.
|
||||
|
|
@ -1,12 +0,0 @@
|
|||
# shellcheck shell=bash
|
||||
about-alias 'the silver searcher (ag) aliases'
|
||||
|
||||
## Summary for args to less:
|
||||
# less(1)
|
||||
# -M (-M or --LONG-PROMPT) Prompt very verbosely
|
||||
# -I (-I or --IGNORE-CASE) Searches with '/' ignore case
|
||||
# -R (-R or --RAW-CONTROL-CHARS) For handling ANSI colors
|
||||
# -F (-F or --quit-if-one-screen) Auto exit if <1 screen
|
||||
# -X (-X or --no-init) Disable termcap init & deinit
|
||||
|
||||
alias ag='ag --smart-case --pager="less -MIRFX"'
|
||||
|
|
@ -1,5 +0,0 @@
|
|||
# shellcheck shell=bash
|
||||
about-alias 'ansible abbreviations'
|
||||
|
||||
alias ans=ansible
|
||||
alias ap=ansible-playbook
|
||||
|
|
@ -1,27 +0,0 @@
|
|||
# shellcheck shell=bash
|
||||
#
|
||||
# -binaryanomaly
|
||||
|
||||
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
|
||||
alias apts='apt-cache search'
|
||||
alias aptshow='apt-cache show'
|
||||
alias aptinst='sudo apt-get install -V'
|
||||
alias aptupd='sudo apt-get update'
|
||||
alias aptupg='sudo apt-get dist-upgrade -V && sudo apt-get autoremove'
|
||||
alias aptupgd='sudo apt-get update && sudo apt-get dist-upgrade -V && sudo apt-get autoremove'
|
||||
alias aptrm='sudo apt-get remove'
|
||||
alias aptpurge='sudo apt-get remove --purge'
|
||||
|
||||
alias chkup='/usr/lib/update-notifier/apt-check -p --human-readable'
|
||||
alias chkboot='cat /var/run/reboot-required'
|
||||
|
||||
alias pkgfiles='dpkg --listfiles'
|
||||
fi
|
||||
}
|
||||
|
||||
_set_pkg_aliases
|
||||
|
|
@ -1,7 +0,0 @@
|
|||
# shellcheck shell=bash
|
||||
about-alias 'Atom.io editor abbreviations'
|
||||
|
||||
alias a='atom'
|
||||
alias ah='atom .'
|
||||
alias apmup='apm update --no-confirm'
|
||||
alias apmi='apm install'
|
||||
|
|
@ -1,23 +0,0 @@
|
|||
# shellcheck shell=bash
|
||||
about-alias 'Aliases for the bash-it command (these aliases are automatically included with the "general" aliases)'
|
||||
|
||||
# Common misspellings of bash-it
|
||||
alias shit='bash-it'
|
||||
alias batshit='bash-it'
|
||||
alias bashit='bash-it'
|
||||
alias batbsh='bash-it'
|
||||
alias babsh='bash-it'
|
||||
alias bash_it='bash-it'
|
||||
alias bash_ti='bash-it'
|
||||
|
||||
# Additional bash-it aliases for help/show
|
||||
alias bshsa='bash-it show aliases'
|
||||
alias bshsc='bash-it show completions'
|
||||
alias bshsp='bash-it show plugins'
|
||||
alias bshha='bash-it help aliases'
|
||||
alias bshhc='bash-it help completions'
|
||||
alias bshhp='bash-it help plugins'
|
||||
alias bshsch="bash-it search"
|
||||
alias bshenp="bash-it enable plugin"
|
||||
alias bshena="bash-it enable alias"
|
||||
alias bshenc="bash-it enable completion"
|
||||
|
|
@ -1,8 +0,0 @@
|
|||
# shellcheck shell=bash
|
||||
about-alias 'puppet bolt aliases'
|
||||
|
||||
# Aliases
|
||||
alias bolt='bolt command run --tty --no-host-key-check'
|
||||
alias boltas='bolt -p -u'
|
||||
alias sudobolt='bolt --run-as root --sudo-password'
|
||||
alias sudoboltas='sudobolt -p -u'
|
||||
|
|
@ -1,9 +0,0 @@
|
|||
# shellcheck shell=bash
|
||||
about-alias 'ruby bundler'
|
||||
|
||||
# Bundler Commands
|
||||
alias be='bundle exec'
|
||||
alias bi='bundle install'
|
||||
alias bl='bundle list'
|
||||
alias bu='bundle update'
|
||||
alias bp='bundle package'
|
||||
|
|
@ -1,16 +0,0 @@
|
|||
# shellcheck shell=bash
|
||||
about-alias 'xclip shortcuts'
|
||||
|
||||
alias pbcopy="xclip -selection clipboard"
|
||||
alias pbpaste="xclip -selection clipboard -o"
|
||||
|
||||
alias xcpy="xclip -selection clipboard"
|
||||
alias xpst="xclip -selection clipboard -o"
|
||||
# to use it just install xclip on your distribution and it would work like:
|
||||
# $ echo "hello" | xcpy
|
||||
# $ xpst
|
||||
# hello
|
||||
|
||||
# very useful for things like:
|
||||
# cat ~/.ssh/id_rsa.pub | xcpy
|
||||
# have fun!
|
||||
|
|
@ -1,39 +0,0 @@
|
|||
# shellcheck shell=bash
|
||||
about-alias 'common composer abbreviations'
|
||||
|
||||
# Aliases
|
||||
alias coab='composer about'
|
||||
alias coar='composer archive'
|
||||
alias cob='composer browser'
|
||||
alias cocpr='composer check-platform-reqs'
|
||||
alias cocc='composer clear-cache'
|
||||
alias cocfg='composer config'
|
||||
alias cocp='composer create-project'
|
||||
alias codp='composer depends'
|
||||
alias codiag='composer diagnose'
|
||||
alias codmp='composer dump-autoload'
|
||||
alias coex='composer exec'
|
||||
alias coglob='composer global'
|
||||
alias coh='composer help'
|
||||
alias cohome='composer home'
|
||||
alias coi='composer install'
|
||||
alias coinf='composer info'
|
||||
alias coini='composer init'
|
||||
alias coli='composer license'
|
||||
alias colis='composer list'
|
||||
alias coout='composer outdated'
|
||||
alias cop='composer prohibits'
|
||||
alias corem='composer remove'
|
||||
alias coreq='composer require'
|
||||
alias coreqd='composer require --dev'
|
||||
alias cors='composer run-script'
|
||||
alias cos='composer search'
|
||||
alias cosu='composer self-update'
|
||||
alias coshow='composer show'
|
||||
alias costat='composer status'
|
||||
alias cosugg='composer suggest'
|
||||
alias coup='composer update'
|
||||
alias coupg='composer upgrade'
|
||||
alias coval='composer validate'
|
||||
alias cowhy='composer why'
|
||||
alias cowhyn='composer why-not'
|
||||
|
|
@ -1,22 +0,0 @@
|
|||
# shellcheck shell=bash
|
||||
about-alias 'Curl aliases for convenience.'
|
||||
|
||||
# set apt aliases
|
||||
function _set_pkg_aliases() {
|
||||
if _command_exists 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'
|
||||
# see only response headers from a get request
|
||||
alias clhead='curl -D - -so /dev/null'
|
||||
fi
|
||||
}
|
||||
|
||||
_set_pkg_aliases
|
||||
|
|
@ -1,17 +0,0 @@
|
|||
# shellcheck shell=bash
|
||||
about-alias 'dnf aliases for fedora 22+ distros'
|
||||
|
||||
alias dnfl="dnf list" # List packages
|
||||
alias dnfli="dnf list installed" # List installed packages
|
||||
alias dnfgl="dnf grouplist" # List package groups
|
||||
alias dnfmc="dnf makecache" # Generate metadata cache
|
||||
alias dnfp="dnf info" # Show package information
|
||||
alias dnfs="dnf search" # Search package
|
||||
|
||||
alias dnfu="sudo dnf upgrade" # Upgrade package
|
||||
alias dnfi="sudo dnf install" # Install package
|
||||
alias dnfri='sudo dnf reinstall' # Reinstall package
|
||||
alias dnfgi="sudo dnf groupinstall" # Install package group
|
||||
alias dnfr="sudo dnf remove" # Remove package
|
||||
alias dnfgr="sudo dnf groupremove" # Remove package group
|
||||
alias dnfc="sudo dnf clean all" # Clean cache
|
||||
|
|
@ -1,10 +0,0 @@
|
|||
# shellcheck shell=bash
|
||||
about-alias 'docker-compose abbreviations'
|
||||
|
||||
alias dco="docker-compose"
|
||||
|
||||
# Defined in the `docker-compose` plugin, please check there for details.
|
||||
alias dcofresh="docker-compose-fresh"
|
||||
alias dcol="docker-compose logs -f --tail 100"
|
||||
alias dcou="docker-compose up"
|
||||
alias dcouns="dcou --no-start"
|
||||
|
|
@ -1,43 +0,0 @@
|
|||
# shellcheck shell=bash
|
||||
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
|
||||
|
||||
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
|
||||
;;
|
||||
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
|
||||
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)'
|
||||
alias dkbash='dkelc'
|
||||
alias dkex='docker exec -it ' # Useful to run any commands into container without leaving host
|
||||
alias dkri='docker run --rm -i '
|
||||
alias dkric='docker run --rm -i -v $PWD:/cwd -w /cwd '
|
||||
alias dkrit='docker run --rm -it '
|
||||
alias dkritc='docker run --rm -it -v $PWD:/cwd -w /cwd '
|
||||
|
||||
# Added more recent cleanup options from newer docker versions
|
||||
alias dkip='docker image prune -a -f'
|
||||
alias dkvp='docker volume prune -f'
|
||||
alias dksp='docker system prune -a -f'
|
||||
|
|
@ -1,16 +0,0 @@
|
|||
# shellcheck shell=bash
|
||||
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'
|
||||
;;
|
||||
esac
|
||||
|
|
@ -1,10 +0,0 @@
|
|||
# shellcheck shell=bash
|
||||
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)'
|
||||
fi
|
||||
alias please=fuck
|
||||
alias plz=please
|
||||
alias fucking=sudo
|
||||
|
|
@ -1,92 +0,0 @@
|
|||
# shellcheck shell=bash
|
||||
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.
|
||||
fi
|
||||
|
||||
# List directory contents
|
||||
alias sl=ls
|
||||
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'
|
||||
|
||||
# Shortcuts to edit startup files
|
||||
alias vbrc='${VISUAL:-vim} ~/.bashrc'
|
||||
alias vbpf='${VISUAL:-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'
|
||||
fi
|
||||
|
||||
if _command_exists gshuf; then
|
||||
alias shuf=gshuf
|
||||
fi
|
||||
|
||||
alias c='clear'
|
||||
alias cls='clear'
|
||||
|
||||
alias edit='${EDITOR:-${ALTERNATE_EDITOR:-nano}}'
|
||||
alias pager='${PAGER:=less}'
|
||||
|
||||
alias q='exit'
|
||||
|
||||
alias irc='${IRC_CLIENT:=irc}'
|
||||
|
||||
# Language aliases
|
||||
alias rb='ruby'
|
||||
alias py='python'
|
||||
alias ipy='ipython'
|
||||
|
||||
# Pianobar can be found here: http://github.com/PromyLOPh/pianobar/
|
||||
|
||||
alias piano='pianobar'
|
||||
|
||||
alias ..='cd ..' # Go up one directory
|
||||
alias cd..='cd ..' # Common misspelling for going up one directory
|
||||
alias ...='cd ../..' # Go up two directories
|
||||
alias ....='cd ../../..' # Go up three directories
|
||||
alias -- -='cd -' # Go back
|
||||
|
||||
# Shell History
|
||||
alias h='history'
|
||||
|
||||
# Tree
|
||||
if ! _command_exists tree; then
|
||||
alias tree="find . -print | sed -e 's;[^/]*/;|____;g;s;____|; |;g'"
|
||||
fi
|
||||
|
||||
# Directory
|
||||
alias md='mkdir -p'
|
||||
alias rd='rmdir'
|
||||
|
||||
# Shorten extract
|
||||
alias xt='extract'
|
||||
|
||||
# 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
|
||||
}
|
||||
|
||||
# The Bash-it aliases were moved to the `bash-it.aliases.bash` file. The intent of this
|
||||
# is to keep the script readable and less bloated. If you don't need to use
|
||||
# the `general` aliases, but you want the Bash-it aliases, you can disable the `general`
|
||||
# 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
|
||||
source "$BASH_IT/aliases/available/bash-it.aliases.bash"
|
||||
|
|
@ -1,212 +0,0 @@
|
|||
# shellcheck shell=bash
|
||||
about-alias 'common git abbreviations'
|
||||
|
||||
alias g='git'
|
||||
alias get='git'
|
||||
|
||||
# add
|
||||
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 gbt='git branch --track'
|
||||
alias gdel='git branch -D'
|
||||
|
||||
# for-each-ref
|
||||
alias gbc='git for-each-ref --format="%(authorname) %09 %(if)%(HEAD)%(then)*%(else)%(refname:short)%(end) %09 %(creatordate)" refs/remotes/ --sort=authorname DESC' # FROM https://stackoverflow.com/a/58623139/10362396
|
||||
|
||||
# commit
|
||||
alias gc='git commit -v'
|
||||
alias gca='git commit -v -a'
|
||||
alias gcaa='git commit -a --amend -C HEAD' # Add uncommitted and unstaged changes to the last commit
|
||||
alias gcam='git commit -v -am'
|
||||
alias gcamd='git commit --amend'
|
||||
alias gcm='git commit -v -m'
|
||||
alias gci='git commit --interactive'
|
||||
alias gcsam='git commit -S -am'
|
||||
|
||||
# checkout
|
||||
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 gct='git checkout --track'
|
||||
|
||||
# clone
|
||||
alias gcl='git clone'
|
||||
|
||||
# clean
|
||||
alias gclean='git clean -fd'
|
||||
|
||||
# cherry-pick
|
||||
alias gcp='git cherry-pick'
|
||||
alias gcpx='git cherry-pick -x'
|
||||
|
||||
# diff
|
||||
alias gd='git diff'
|
||||
alias gds='git diff --staged'
|
||||
alias gdt='git difftool'
|
||||
|
||||
# archive
|
||||
alias gexport='git archive --format zip --output'
|
||||
|
||||
# fetch
|
||||
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 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'
|
||||
|
||||
# ls-files
|
||||
alias gu='git ls-files . --exclude-standard --others' # Show untracked files
|
||||
alias glsut='gu'
|
||||
alias glsum='git diff --name-only --diff-filter=U' # Show unmerged (conflicted) files
|
||||
|
||||
# gui
|
||||
alias ggui='git gui'
|
||||
|
||||
# home
|
||||
alias ghm='cd "$(git rev-parse --show-toplevel)"' # Git home
|
||||
# appendage to ghm
|
||||
if ! _command_exists gh; then
|
||||
alias gh='ghm'
|
||||
fi
|
||||
|
||||
# merge
|
||||
alias gm='git merge'
|
||||
|
||||
# mv
|
||||
alias gmv='git mv'
|
||||
|
||||
# patch
|
||||
alias gpatch='git format-patch -1'
|
||||
|
||||
# push
|
||||
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 gpu='git push --set-upstream'
|
||||
alias gpunch='git push --force-with-lease'
|
||||
alias gpuo='git push --set-upstream origin'
|
||||
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 gpl='git pull'
|
||||
alias gpp='git pull && git push'
|
||||
alias gpr='git pull --rebase'
|
||||
|
||||
# remote
|
||||
alias gr='git remote'
|
||||
alias gra='git remote add'
|
||||
alias grv='git remote -v'
|
||||
|
||||
# rm
|
||||
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
|
||||
|
||||
# reset
|
||||
alias gus='git reset HEAD'
|
||||
alias gpristine='git reset --hard && git clean -dfx'
|
||||
|
||||
# status
|
||||
alias gs='git status'
|
||||
alias gss='git status -s'
|
||||
|
||||
# shortlog
|
||||
alias gcount='git shortlog -sn'
|
||||
alias gsl='git shortlog -sn'
|
||||
|
||||
# show
|
||||
alias gsh='git show'
|
||||
|
||||
# svn
|
||||
alias gsd='git svn dcommit'
|
||||
alias gsr='git svn rebase' # Git SVN
|
||||
|
||||
# stash
|
||||
alias gst='git stash'
|
||||
alias gstb='git stash branch'
|
||||
alias gstd='git stash drop'
|
||||
alias gstl='git stash list'
|
||||
alias gstp='git stash pop' # kept due to long-standing usage
|
||||
alias gstpo='git stash pop' # recommended for it's symmetry with gstpu (push)
|
||||
|
||||
## 'stash push' introduced in git v2.13.2
|
||||
alias gstpu='git stash push'
|
||||
alias gstpum='git stash push -m'
|
||||
|
||||
## 'stash save' deprecated since git v2.16.0, alias is now push
|
||||
alias gsts='git stash push'
|
||||
alias gstsm='git stash push -m'
|
||||
|
||||
# submodules
|
||||
alias gsu='git submodule update --init --recursive'
|
||||
|
||||
# switch
|
||||
# these aliases requires git v2.23+
|
||||
alias gsw='git switch'
|
||||
alias gswc='git switch --create'
|
||||
alias gswm='git switch $(get_default_branch)'
|
||||
alias gswt='git switch --track'
|
||||
|
||||
# tag
|
||||
alias gt='git tag'
|
||||
alias gta='git tag -a'
|
||||
alias gtd='git tag -d'
|
||||
alias gtl='git tag -l'
|
||||
|
||||
case $OSTYPE in
|
||||
darwin*)
|
||||
alias gtls="git tag -l | gsort -V"
|
||||
;;
|
||||
*)
|
||||
alias gtls='git tag -l | sort -V'
|
||||
;;
|
||||
esac
|
||||
|
||||
# functions
|
||||
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
|
||||
}
|
||||
|
|
@ -1,7 +0,0 @@
|
|||
# shellcheck shell=bash
|
||||
about-alias 'common git-svn abbreviations'
|
||||
|
||||
# Aliases
|
||||
alias gsr='git svn rebase'
|
||||
alias gsc='git svn dcommit'
|
||||
alias gsi='git svn info'
|
||||
|
|
@ -1,34 +0,0 @@
|
|||
# shellcheck shell=bash
|
||||
about-alias 'heroku task abbreviations'
|
||||
|
||||
# heroku
|
||||
alias h='heroku'
|
||||
alias hl='heroku list'
|
||||
alias hi='heroku info'
|
||||
alias ho='heroku open'
|
||||
|
||||
# dynos and workers
|
||||
alias hd='heroku dynos'
|
||||
alias hw='heroku workers'
|
||||
|
||||
# rake console
|
||||
alias hr='heroku rake'
|
||||
alias hcon='heroku console'
|
||||
|
||||
# new and restart
|
||||
alias hnew='heroku create'
|
||||
alias hrestart='heroku restart'
|
||||
|
||||
# logs
|
||||
alias hlog='heroku logs'
|
||||
alias hlogs='heroku logs'
|
||||
|
||||
# maint
|
||||
alias hon='heroku maintenance:on'
|
||||
alias hoff='heroku maintenance:off'
|
||||
|
||||
# heroku configs
|
||||
alias hc='heroku config'
|
||||
alias hca='heroku config:add'
|
||||
alias hcr='heroku config:remove'
|
||||
alias hcc='heroku config:clear'
|
||||
|
|
@ -1,6 +0,0 @@
|
|||
# shellcheck shell=bash
|
||||
about-alias 'mercurial abbreviations'
|
||||
|
||||
alias hs='hg status'
|
||||
alias hsum='hg summary'
|
||||
alias hcm='hg commit -m'
|
||||
|
|
@ -1,11 +0,0 @@
|
|||
# shellcheck shell=bash
|
||||
about-alias 'Some aliases for Homebrew Cask'
|
||||
|
||||
alias bcin='brew cask install'
|
||||
alias bcrm='brew cask uninstall'
|
||||
alias bczp='brew cask zap'
|
||||
alias bccl='brew cask cleanup'
|
||||
alias bcls='brew cask list'
|
||||
alias bcinf='brew cask info'
|
||||
alias bcdr='brew cask doctor'
|
||||
alias bced='brew cask edit'
|
||||
|
|
@ -1,13 +0,0 @@
|
|||
# shellcheck shell=bash
|
||||
about-alias 'Some aliases for Homebrew'
|
||||
|
||||
alias bup='brew update && brew upgrade'
|
||||
alias bout='brew outdated'
|
||||
alias bin='brew install'
|
||||
alias brm='brew uninstall'
|
||||
alias bcl='brew cleanup'
|
||||
alias bls='brew list'
|
||||
alias bsr='brew search'
|
||||
alias binf='brew info'
|
||||
alias bdr='brew doctor'
|
||||
alias bed='brew edit'
|
||||
|
|
@ -1,23 +0,0 @@
|
|||
# shellcheck shell=bash
|
||||
about-alias 'homesick aliases'
|
||||
|
||||
# Aliases
|
||||
alias sikhm="homesick cd dotfiles"
|
||||
alias sikclone="homesick clone"
|
||||
alias sikcomt="homesick commit dotfiles"
|
||||
alias sikdstry="homesick destroy"
|
||||
alias sikdif="homesick diff dotfiles"
|
||||
alias sikexec="homesick exec dotfiles"
|
||||
alias sikexeca="homesick exec_all"
|
||||
alias sikgen="homesick generate"
|
||||
alias sikhlp="homesick help"
|
||||
alias siklnk="homesick link dotfiles"
|
||||
alias sikls="homesick list"
|
||||
alias sikopn="homesick open dotfiles"
|
||||
alias sikpll="homesick pull dotfiles"
|
||||
alias sikpsh="homesick push dotfiles"
|
||||
alias sikrc="homesick rc dotfiles"
|
||||
alias sikpth="homesick show_path dotfiles"
|
||||
alias sikst="homesick status dotfiles"
|
||||
alias sikulnk="homesick unlink dotfiles"
|
||||
alias sikv="homesick version"
|
||||
|
|
@ -1,49 +0,0 @@
|
|||
# shellcheck shell=bash
|
||||
about-alias 'jitsu task abbreviations'
|
||||
|
||||
# jitsu
|
||||
alias j='jitsu'
|
||||
alias jl='jitsu login'
|
||||
alias jo='jitsu logout'
|
||||
|
||||
# deploy and update
|
||||
alias jd='jitsu apps deploy'
|
||||
alias ju='jitsu apps update'
|
||||
|
||||
# new and start, restart, stop
|
||||
alias jn='jitsu apps create'
|
||||
alias js='jitsu apps start'
|
||||
alias jr='jitsu apps restart'
|
||||
alias jx='jitsu apps stop'
|
||||
|
||||
# logs
|
||||
alias jll='jitsu logs'
|
||||
alias jlog='jitsu logs'
|
||||
alias jlogs='jitsu logs'
|
||||
|
||||
# env
|
||||
alias je='jitsu env'
|
||||
alias jel='jitsu env list'
|
||||
alias jes='jitsu env set'
|
||||
alias jeg='jitsu env get'
|
||||
alias jed='jitsu env delete'
|
||||
alias jec='jitsu env clear'
|
||||
alias jesv='jitsu env save'
|
||||
alias jeld='jitsu env load'
|
||||
|
||||
# configuration
|
||||
alias jc='jitsu conf'
|
||||
alias jcl='jitsu config list'
|
||||
alias jcs='jitsu config set'
|
||||
alias jcg='jitsu config get'
|
||||
alias jcd='jitsu config delete'
|
||||
|
||||
# list and install, view
|
||||
alias jls='jitsu list'
|
||||
alias jin='jitsu install'
|
||||
alias jv='jitsu apps view'
|
||||
|
||||
# Database, Snapshots and Tokens
|
||||
alias jdb='jitsu databases'
|
||||
alias jss='jitsu snapshots'
|
||||
alias jto='jitsu tokens'
|
||||
|
|
@ -1,16 +0,0 @@
|
|||
# shellcheck shell=bash
|
||||
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
|
||||
|
|
@ -1,74 +0,0 @@
|
|||
# shellcheck shell=bash
|
||||
about-alias 'laravel artisan abbreviations'
|
||||
|
||||
# A list of useful laravel aliases
|
||||
|
||||
alias laravel='${HOME?}/.composer/vendor/bin/laravel'
|
||||
# asset
|
||||
alias a:apub='php artisan asset:publish'
|
||||
|
||||
# auth
|
||||
alias a:remclear='php artisan auth:clear-reminders'
|
||||
alias a:remcontroller='php artisan auth:reminders-controller'
|
||||
alias a:remtable='php artisan auth:reminders-table'
|
||||
|
||||
# cache
|
||||
alias a:cacheclear='php artisan cache:clear'
|
||||
|
||||
# command
|
||||
alias a:command='php artisan command:make'
|
||||
|
||||
# config
|
||||
alias a:confpub='php artisan config:publish'
|
||||
|
||||
# controller
|
||||
alias a:controller='php artisan make:controller'
|
||||
|
||||
# db
|
||||
alias a:seed='php artisan db:seed'
|
||||
|
||||
# key
|
||||
alias a:key='php artisan key:generate'
|
||||
|
||||
# migrate
|
||||
alias a:migrate='php artisan migrate'
|
||||
alias a:mig='a:migrate'
|
||||
alias a:miginstall='php artisan migrate:install'
|
||||
alias a:migmake='php artisan migrate:make'
|
||||
alias a:migcreate='php artisan migrate:create'
|
||||
alias a:migpublish='php artisan migrate:publish'
|
||||
alias a:migrefresh='php artisan migrate:refresh'
|
||||
alias a:migreset='php artisan migrate:reset'
|
||||
alias a:migrollback='php artisan migrate:rollback'
|
||||
alias a:rollback='a:migrollback'
|
||||
|
||||
# queue
|
||||
alias a:qfailed='php artisan queue:failed'
|
||||
alias a:qfailedtable='php artisan queue:failed-table'
|
||||
alias a:qflush='php artisan queue:flush'
|
||||
alias a:qforget='php artisan queue:forget'
|
||||
alias a:qlisten='php artisan queue:listen'
|
||||
alias a:qretry='php artisan queue:retry'
|
||||
alias a:qsubscribe='php artisan queue:subscribe'
|
||||
alias a:qwork='php artisan queue:work'
|
||||
|
||||
# session
|
||||
alias a:stable='php artisan session:table'
|
||||
|
||||
# view
|
||||
alias a:vpub='php artisan view:publish'
|
||||
|
||||
# misc
|
||||
alias a:='php artisan'
|
||||
alias a:changes='php artisan changes'
|
||||
alias a:down='php artisan down'
|
||||
alias a:env='php artisan env'
|
||||
alias a:help='php artisan help'
|
||||
alias a:list='php artisan list'
|
||||
alias a:optimize='php artisan optimize'
|
||||
alias a:routes='php artisan routes'
|
||||
alias a:serve='php artisan serve'
|
||||
alias a:tail='php artisan tail'
|
||||
alias a:tinker='php artisan tinker'
|
||||
alias a:up='php artisan up'
|
||||
alias a:work='php artisan workbench'
|
||||
|
|
@ -1,14 +0,0 @@
|
|||
# shellcheck shell=bash
|
||||
about-alias 'maven abbreviations'
|
||||
|
||||
alias mci='mvn clean install'
|
||||
alias mi='mvn install'
|
||||
alias mcp='mvn clean package'
|
||||
alias mp='mvn package'
|
||||
alias mrprep='mvn release:prepare'
|
||||
alias mrperf='mvn release:perform'
|
||||
alias mrrb='mvn release:rollback'
|
||||
alias mdep='mvn dependency:tree'
|
||||
alias mpom='mvn help:effective-pom'
|
||||
alias mcisk='mci -Dmaven.test.skip=true'
|
||||
alias mcpsk='mcp -Dmaven.test.skip=true'
|
||||
|
|
@ -1,14 +0,0 @@
|
|||
# shellcheck shell=bash
|
||||
about-alias 'MSYS2 aliases'
|
||||
|
||||
LS_COMMON="-hG"
|
||||
LS_COMMON="$LS_COMMON --color=auto"
|
||||
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:-}'
|
||||
alias ll="ls -l"
|
||||
alias la="ls -a"
|
||||
alias lal="ll -a"
|
||||
alias lf="ls -F"
|
||||
|
|
@ -1,8 +0,0 @@
|
|||
# shellcheck shell=bash
|
||||
about-alias 'the Node.js environment aliases'
|
||||
|
||||
# alias to setup nodejs development environment
|
||||
alias node-dev='export NODE_ENV=development'
|
||||
|
||||
# alias to setup nodejs production environment
|
||||
alias node-prod='export NODE_ENV=production'
|
||||
|
|
@ -1,43 +0,0 @@
|
|||
# shellcheck shell=bash
|
||||
about-alias 'common npm abbreviations'
|
||||
|
||||
# Aliases
|
||||
|
||||
# npm
|
||||
alias ni='npm install'
|
||||
alias nis='npm install --save'
|
||||
alias nid='npm install --save-dev'
|
||||
alias nit='npm install-test'
|
||||
alias nits='npm install-test --save'
|
||||
alias nitd='npm install-test --save-dev'
|
||||
alias nu='npm uninstall'
|
||||
alias nus='npm uninstall --save'
|
||||
alias nusd='npm uninstall --save-dev'
|
||||
alias np='npm publish'
|
||||
alias nup='npm unpublish'
|
||||
alias nlk='npm link'
|
||||
alias nod='npm outdated'
|
||||
alias nrb='npm rebuild'
|
||||
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'
|
||||
alias nxplease='npx $(fc -ln -1)'
|
||||
alias nxn='npx --no-install '
|
||||
alias nxp='npx -p '
|
||||
alias nxnp='npx --no-install -p '
|
||||
alias nxq='npx -q '
|
||||
alias nxnq='npx --no-install -q '
|
||||
alias nxqp='npx -q -p '
|
||||
alias nxnqp='npx --no-install -q -p '
|
||||
alias nxni='npx --no-install --ignore-existing '
|
||||
alias nxip='npx --ignore-existing -p '
|
||||
alias nxnip='npx --no-install --ignore-existing -p '
|
||||
alias nxqi='npx -q --ignore-existing '
|
||||
alias nxniq='npx --no-install --ignore-existing -q '
|
||||
alias nxiqp='npx --ignore-existing -q -p '
|
||||
alias nxniqp='npx --no-install --ignore-existing -q -p '
|
||||
|
|
@ -1,57 +0,0 @@
|
|||
# shellcheck shell=bash
|
||||
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 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"'
|
||||
|
||||
if [[ -s /usr/bin/firefox ]]; then
|
||||
unalias firefox
|
||||
fi
|
||||
|
||||
# Requires growlnotify, which can be found in the Growl DMG under "Extras"
|
||||
alias grnot='growlnotify -s -t Terminal -m "Done"'
|
||||
|
||||
# Get rid of those pesky .DS_Store files recursively
|
||||
alias dsclean='find . -type f -name .DS_Store -delete'
|
||||
|
||||
# Track who is listening to your iTunes music
|
||||
alias whotunes='lsof -r 2 -n -P -F n -c iTunes -a -i TCP@`hostname`:3689'
|
||||
|
||||
# Flush your dns cache
|
||||
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'
|
||||
|
||||
# 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"
|
||||
|
||||
# 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"'
|
||||
|
||||
# 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."'
|
||||
|
|
@ -1,49 +0,0 @@
|
|||
# shellcheck shell=bash
|
||||
about-alias 'phoenix abbreviations'
|
||||
|
||||
# Phoenix Commands
|
||||
alias i='iex'
|
||||
alias ips='iex -S mix phx.server'
|
||||
alias ism='iex -S mix'
|
||||
alias m='mix'
|
||||
alias mab='mix archive.build'
|
||||
alias mai='mix archive.install'
|
||||
alias mat='mix app.tree'
|
||||
alias mc='mix compile'
|
||||
alias mcv='mix compile --verbose'
|
||||
alias mcx='mix compile.xref'
|
||||
alias mdc='mix deps.compile'
|
||||
alias mdg='mix deps.get'
|
||||
alias mdgc='mix do deps.get, deps.compile'
|
||||
alias mdu='mix deps.update'
|
||||
alias mdt='mix deps.tree'
|
||||
alias mdua='mix deps.update --all'
|
||||
alias mdun='mix deps.unlock'
|
||||
alias mduu='mix deps.unlock --unused'
|
||||
alias meb='mix escript.build'
|
||||
alias mec='mix ecto.create'
|
||||
alias mecm='mix do ecto.create, ecto.migrate'
|
||||
alias med='mix ecto.drop'
|
||||
alias mem='mix ecto.migrate'
|
||||
alias megm='mix ecto.gen.migration'
|
||||
alias merb='mix ecto.rollback'
|
||||
alias mers='mix ecto.reset'
|
||||
alias mho='mix hex.outdated'
|
||||
alias mlh='mix local.hex'
|
||||
alias mn='mix new'
|
||||
alias mns='mix new --sup'
|
||||
alias mpgc='mix phx.gen.channel'
|
||||
alias mpgh='mix phx.gen.html'
|
||||
alias mpgj='mix phx.gen.json'
|
||||
alias mpgm='mix phx.gen.model'
|
||||
alias mpgs='mix phx.gen.secret'
|
||||
alias mpn='mix phx.new'
|
||||
alias mpr='mix phx.routes'
|
||||
alias mps='mix phx.server'
|
||||
alias mr='mix run'
|
||||
alias mrnh='mix run --no-halt'
|
||||
alias mrl='mix release'
|
||||
alias mt='mix test'
|
||||
alias mts='mix test --stale'
|
||||
alias mtw='mix test.watch'
|
||||
alias mx='mix xref'
|
||||
|
|
@ -1,9 +0,0 @@
|
|||
# shellcheck shell=bash
|
||||
about-alias 'puppet aliases'
|
||||
|
||||
# Aliases
|
||||
alias pupval="puppet parser validate *.pp"
|
||||
alias puplint="puppet-lint *.pp"
|
||||
alias pupagt="puppet agent -t"
|
||||
alias pupagtd="puppet agent -t --debug"
|
||||
alias pupapp="puppet apply"
|
||||
|
|
@ -1,152 +0,0 @@
|
|||
# shellcheck shell=bash
|
||||
about-alias 'pyrocms abbreviations'
|
||||
|
||||
###
|
||||
## PyroCMS 3.4 bash aliases
|
||||
## @author Denis Efremov <efremov.a.denis@gmail.com>
|
||||
###
|
||||
|
||||
# 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
|
||||
|
||||
# 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.
|
||||
|
||||
# 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
|
||||
|
||||
# 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
|
||||
|
||||
# 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
|
||||
|
||||
# db
|
||||
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.
|
||||
|
||||
# event
|
||||
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.
|
||||
|
||||
# files
|
||||
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
|
||||
|
||||
# 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
|
||||
|
||||
# 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
|
||||
|
||||
# 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
|
||||
|
||||
# package
|
||||
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
|
||||
|
||||
# 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
|
||||
|
||||
# schedule
|
||||
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
|
||||
|
||||
# session
|
||||
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"
|
||||
|
||||
# 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.
|
||||
|
||||
# tntsearch
|
||||
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
|
||||
|
||||
# view
|
||||
alias a:vi:cl="php artisan view:clear" # Clear all compiled view files
|
||||
|
|
@ -1,22 +0,0 @@
|
|||
# shellcheck shell=bash
|
||||
about-alias 'rails abbreviations'
|
||||
|
||||
# Rails Commands
|
||||
alias r='rails'
|
||||
alias rg='rails g'
|
||||
alias rs='rails s'
|
||||
alias rc='rails c'
|
||||
alias rn='rails new'
|
||||
alias rb='rails dbconsole'
|
||||
alias rp='rails plugin'
|
||||
alias ra='rails application'
|
||||
alias rd='rails destroy'
|
||||
alias dbm='rake db:migrate'
|
||||
|
||||
alias ss='script/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 devlog='tail -f log/development.log'
|
||||
alias taild='tail -f log/development.log' # tail dev log
|
||||
|
|
@ -1,15 +0,0 @@
|
|||
# shellcheck shell=bash
|
||||
about-alias 'common svn abbreviations'
|
||||
|
||||
# Aliases
|
||||
alias svs='svn status'
|
||||
alias sa='svn add'
|
||||
alias sci='svn ci -m'
|
||||
alias sco='svn co'
|
||||
alias sup='svn up'
|
||||
alias scu='svn cleanup'
|
||||
alias sli='svn list'
|
||||
alias sdel='svn delete'
|
||||
alias sdif='svn diff'
|
||||
alias slog='svn log'
|
||||
alias smv='svn move'
|
||||
|
|
@ -1,22 +0,0 @@
|
|||
# shellcheck shell=bash
|
||||
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'
|
||||
;;
|
||||
esac
|
||||
|
|
@ -1,9 +0,0 @@
|
|||
# shellcheck shell=bash
|
||||
about-alias 'Aliases for Terraform and Terragrunt'
|
||||
|
||||
alias tf='terraform'
|
||||
alias tfi='tf init'
|
||||
alias tfv='terraform validate'
|
||||
alias tfp='terraform plan'
|
||||
alias tfa='terraform apply'
|
||||
alias tfd='terraform destroy'
|
||||
|
|
@ -1,13 +0,0 @@
|
|||
# shellcheck shell=bash
|
||||
about-alias 'Aliases for Terraform and Terragrunt'
|
||||
|
||||
alias tg='terragrunt'
|
||||
alias tgv='terragrunt validate'
|
||||
alias tgp='terragrunt plan'
|
||||
alias tga='terragrunt apply'
|
||||
alias tgd='terragrunt destroy'
|
||||
|
||||
alias tgva='terragrunt validate-all'
|
||||
alias tgpa='terragrunt plan-all'
|
||||
alias tgaa='terragrunt apply-all'
|
||||
alias tgda='terragrunt destroy-all'
|
||||
|
|
@ -1,10 +0,0 @@
|
|||
# shellcheck shell=bash
|
||||
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 &'
|
||||
;;
|
||||
esac
|
||||
|
|
@ -1,6 +0,0 @@
|
|||
# shellcheck shell=bash
|
||||
about-alias 'Tmux terminal multiplexer'
|
||||
|
||||
alias txl='tmux ls'
|
||||
alias txn='tmux new -s'
|
||||
alias txa='tmux a -t'
|
||||
|
|
@ -1,8 +0,0 @@
|
|||
# shellcheck shell=bash
|
||||
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'
|
||||
|
|
@ -1,11 +0,0 @@
|
|||
# shellcheck shell=bash
|
||||
about-alias 'uuidgen aliases'
|
||||
|
||||
if _command_exists uuid; then # Linux
|
||||
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
|
||||
fi
|
||||
|
|
@ -1,22 +0,0 @@
|
|||
# shellcheck shell=bash
|
||||
about-alias 'vagrant aliases'
|
||||
|
||||
# Aliases
|
||||
alias vhl='vagrant hosts list'
|
||||
alias vscp='vagrant scp'
|
||||
alias vsl='vagrant snapshot list'
|
||||
alias vst='vagrant snapshot take'
|
||||
alias vup="vagrant up"
|
||||
alias vupl="vagrant up 2>&1 | tee vagrant.log"
|
||||
alias vh="vagrant halt"
|
||||
alias vs="vagrant suspend"
|
||||
alias vr="vagrant resume"
|
||||
alias vrl="vagrant reload"
|
||||
alias vssh="vagrant ssh"
|
||||
alias vst="vagrant status"
|
||||
alias vp="vagrant provision"
|
||||
alias vdstr="vagrant destroy"
|
||||
# requires vagrant-list plugin
|
||||
alias vl="vagrant list"
|
||||
# requires vagrant-hostmanager plugin
|
||||
alias vhst="vagrant hostmanager"
|
||||
|
|
@ -1,15 +0,0 @@
|
|||
# shellcheck shell=bash
|
||||
about-alias 'vault aliases'
|
||||
|
||||
# Aliases
|
||||
alias vad="vault delete"
|
||||
alias val="vault list"
|
||||
alias var="vault read"
|
||||
alias varn="vault renew"
|
||||
alias varv="vault revoke"
|
||||
alias vasrv="vault server"
|
||||
alias vas="vault status"
|
||||
alias vav="vault version"
|
||||
alias vaw="vault write"
|
||||
alias vag="vault login -method=github"
|
||||
alias varv="vault read -field=value"
|
||||
|
|
@ -1,14 +0,0 @@
|
|||
# shellcheck shell=bash
|
||||
about-alias 'vim abbreviations'
|
||||
|
||||
_command_exists vim || return
|
||||
|
||||
alias v='vim'
|
||||
# open the vim help in fullscreen incorporated from
|
||||
# https://stackoverflow.com/a/4687513
|
||||
alias vimh='vim -c ":h | only"'
|
||||
|
||||
# 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 "$@"; }
|
||||
|
|
@ -1,26 +0,0 @@
|
|||
# shellcheck shell=bash
|
||||
about-alias 'yarn package manager aliases'
|
||||
|
||||
# Aliases
|
||||
alias ya='yarn'
|
||||
alias yai='yarn init'
|
||||
alias yaa='yarn add'
|
||||
alias yaga='yarn global add'
|
||||
alias yaad='yarn add --dev'
|
||||
alias yau='yarn upgrade'
|
||||
alias yarm='yarn remove'
|
||||
alias yagrm='yarn global remove'
|
||||
alias yaod='yarn outdated'
|
||||
alias yapa='yarn pack'
|
||||
alias yap='yarn publish'
|
||||
alias yasu='yarn self-update'
|
||||
alias yaru='yarn run'
|
||||
alias yat='yarn test'
|
||||
alias yas='yarn serve'
|
||||
alias yacc='yarn cache clean'
|
||||
alias yack='yarn check'
|
||||
alias yals='yarn list'
|
||||
alias yain='yarn info'
|
||||
alias yali='yarn licenses ls'
|
||||
alias yaloi='yarn login'
|
||||
alias yaloo='yarn logout'
|
||||
110
bash_it.sh
110
bash_it.sh
|
|
@ -1,110 +0,0 @@
|
|||
#!/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]}}"
|
||||
|
||||
# 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"
|
||||
# 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)..."
|
||||
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: "
|
||||
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: "
|
||||
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}'."
|
||||
BASH_IT_LOG_PREFIX="themes: githelpers: "
|
||||
source "${BASH_IT}/themes/githelpers.theme.bash"
|
||||
BASH_IT_LOG_PREFIX="themes: p4helpers: "
|
||||
source "${BASH_IT}/themes/p4helpers.theme.bash"
|
||||
BASH_IT_LOG_PREFIX="themes: base: "
|
||||
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
|
||||
source "$APPEARANCE_LIB"
|
||||
BASH_IT_LOG_PREFIX="core: main: "
|
||||
fi
|
||||
|
||||
_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}"
|
||||
_log_debug "Loading component..."
|
||||
# shellcheck disable=SC1090
|
||||
source "${_bash_it_main_file_custom}"
|
||||
fi
|
||||
BASH_IT_LOG_PREFIX="core: main: "
|
||||
done
|
||||
|
||||
# Custom
|
||||
_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}"
|
||||
_log_debug "Loading custom file..."
|
||||
# shellcheck disable=SC1090
|
||||
source "$_bash_it_main_file_custom"
|
||||
fi
|
||||
BASH_IT_LOG_PREFIX="core: main: "
|
||||
done
|
||||
|
||||
if [[ -n "${PROMPT:-}" ]]; then
|
||||
PS1="${PROMPT}"
|
||||
fi
|
||||
|
||||
# Adding Support for other OSes
|
||||
if _command_exists gloobus-preview; then
|
||||
PREVIEW="gloobus-preview"
|
||||
elif [[ -d /Applications/Preview.app ]]; then
|
||||
PREVIEW="/Applications/Preview.app"
|
||||
else
|
||||
PREVIEW="less"
|
||||
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?}'"
|
||||
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_@}"
|
||||
176
clean_files.txt
176
clean_files.txt
|
|
@ -1,176 +0,0 @@
|
|||
#######################################################################
|
||||
# Allow-list of files to be lint-checked by CI
|
||||
#
|
||||
# Directory Support
|
||||
# Directory references are allowed within the file, ie:
|
||||
#
|
||||
# themes/powerline
|
||||
#
|
||||
# All files under the referenced directory will be checked
|
||||
#
|
||||
# Checking Files Locally
|
||||
# You can manually invoke the check via:
|
||||
#
|
||||
# lint_clean_files.sh
|
||||
#
|
||||
|
||||
# root directories
|
||||
#
|
||||
aliases/
|
||||
docs/
|
||||
hooks/
|
||||
scripts/
|
||||
|
||||
# root files
|
||||
#
|
||||
.gitattributes
|
||||
bash_it.sh
|
||||
clean_files.txt
|
||||
install.sh
|
||||
lint_clean_files.sh
|
||||
|
||||
# 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/gcloud.completion.bash
|
||||
completion/available/gem.completion.bash
|
||||
completion/available/git.completion.bash
|
||||
completion/available/github-cli.completion.bash
|
||||
completion/available/go.completion.bash
|
||||
completion/available/helm.completion.bash
|
||||
completion/available/jboss5.completion.bash
|
||||
completion/available/jboss7.completion.bash
|
||||
completion/available/jungle.completion.bash
|
||||
completion/available/knife.completion.bash
|
||||
completion/available/kontena.completion.bash
|
||||
completion/available/kubectl.completion.bash
|
||||
completion/available/laravel.completion.bash
|
||||
completion/available/lerna.completion.bash
|
||||
completion/available/minikube.completion.bash
|
||||
completion/available/ngrok.completion.bash
|
||||
completion/available/notify-send.completion.bash
|
||||
completion/available/npm.completion.bash
|
||||
completion/available/packer.completion.bash
|
||||
completion/available/pip.completion.bash
|
||||
completion/available/pip3.completion.bash
|
||||
completion/available/pipenv.completion.bash
|
||||
completion/available/pipx.completion.bash
|
||||
completion/available/rustup.completion.bash
|
||||
completion/available/sdkman.completion.bash
|
||||
completion/available/system.completion.bash
|
||||
completion/available/vault.completion.bash
|
||||
completion/available/vuejs.completion.bash
|
||||
completion/available/wpscan.completion.bash
|
||||
completion/available/yarn.completion.bash
|
||||
|
||||
# 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
|
||||
#
|
||||
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
|
||||
|
||||
# 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
|
||||
|
|
@ -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
|
||||
|
|
@ -1,4 +0,0 @@
|
|||
# shellcheck shell=bash
|
||||
about-completion "apm completion"
|
||||
# shellcheck disable=SC1090
|
||||
source "${BASH_IT}"/vendor/github.com/vigo/apm-bash-completion/apm
|
||||
|
|
@ -1,5 +0,0 @@
|
|||
# shellcheck shell=bash
|
||||
if _command_exists awless; then
|
||||
# shellcheck disable=SC1090
|
||||
source <(awless completion bash)
|
||||
fi
|
||||
|
|
@ -1,5 +0,0 @@
|
|||
# shellcheck shell=bash
|
||||
|
||||
if _command_exists aws_completer; then
|
||||
complete -C "$(command -v aws_completer)" aws
|
||||
fi
|
||||
|
|
@ -1,95 +0,0 @@
|
|||
# shellcheck shell=bash
|
||||
|
||||
function _compreply_candidates() {
|
||||
local IFS=$'\n'
|
||||
|
||||
read -d '' -ra COMPREPLY < <(compgen -W "${candidates[*]}" -- "${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}")
|
||||
|
||||
_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
|
||||
}
|
||||
|
||||
# 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
|
||||
|
|
@ -1,30 +0,0 @@
|
|||
# shellcheck shell=bash
|
||||
cite "about-completion"
|
||||
about-completion "brew completion"
|
||||
|
||||
# Load late to make sure `system` completion loads first
|
||||
# BASH_IT_LOAD_PRIORITY: 375
|
||||
|
||||
if [[ "$OSTYPE" != '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
|
||||
|
||||
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"
|
||||
|
||||
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"
|
||||
|
||||
elif [[ -f "$BASH_IT_HOMEBREW_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"
|
||||
fi
|
||||
|
|
@ -1,273 +0,0 @@
|
|||
#! bash
|
||||
# bash completion for the `bundle` command.
|
||||
#
|
||||
# Copyright (c) 2008 Daniel Luz
|
||||
|
||||
# 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.
|
||||
#
|
||||
# To use, source this file on bash:
|
||||
# . completion-bundle
|
||||
|
||||
__bundle() {
|
||||
local bundle_bin=("${_RUBY_COMMAND_PREFIX[@]}" "$1")
|
||||
local cur prev
|
||||
_get_comp_words_by_ref -n : cur prev
|
||||
local bundle_command
|
||||
local bundle_command_index
|
||||
__bundle_get_command
|
||||
COMPREPLY=()
|
||||
|
||||
local options
|
||||
if [[ $cur = -* && $bundle_command != exec ]]; then
|
||||
options="-V --help --no-color --no-no-color --verbose --no-verbose"
|
||||
case $bundle_command in
|
||||
"")
|
||||
options="$options --version";;
|
||||
check)
|
||||
options="$options --dry-run --gemfile --path -r --retry";;
|
||||
clean)
|
||||
options="$options --dry-run --force";;
|
||||
config)
|
||||
options="$options --local --global --delete";;
|
||||
doctor)
|
||||
options="$options --gemfile --quiet --no-quiet";;
|
||||
gem)
|
||||
options="$options -b -e -t --bin --coc --no-coc --edit --exe
|
||||
--no-exe --ext --no-ext --mit --no-mit --test";;
|
||||
init)
|
||||
options="$options --gemspec";;
|
||||
install)
|
||||
options="$options --binstubs --clean --deployment --force --frozen
|
||||
--full-index --gemfile --jobs --local --no-cache
|
||||
--no-prune --path --quiet --retry --shebang --standalone
|
||||
--system --trust-policy --with --without";;
|
||||
lock)
|
||||
options="$options --add-platform --conservative --full-index
|
||||
--local --lockfile --major --minor --patch --print
|
||||
--remove-platform --strict --update";;
|
||||
package)
|
||||
options="$options --all --all-platforms";;
|
||||
platform)
|
||||
options="$options --ruby";;
|
||||
show)
|
||||
options="$options --outdated --paths --no-paths";;
|
||||
update)
|
||||
options="$options --bundler --conservative --force --full-index
|
||||
--group --jobs --local --major --minor --patch --quiet
|
||||
--ruby --source --strict";;
|
||||
viz)
|
||||
options="$options -f -F -R -v -W --file --format --requirements
|
||||
--no-requirements --version --no-version --without";;
|
||||
esac
|
||||
else
|
||||
case $bundle_command in
|
||||
"" | help)
|
||||
options="help install update package exec config
|
||||
check show outdated console open lock viz init gem
|
||||
platform clean doctor"
|
||||
;;
|
||||
check | install)
|
||||
case $prev in
|
||||
--binstubs | --path)
|
||||
_filedir -d
|
||||
return;;
|
||||
--standalone | --with | --without)
|
||||
__bundle_complete_groups
|
||||
return;;
|
||||
--trust-policy)
|
||||
options="HighSecurity MediumSecurity LowSecurity
|
||||
AlmostNoSecurity NoSecurity";;
|
||||
esac
|
||||
;;
|
||||
config)
|
||||
case $prev in
|
||||
config | --*)
|
||||
case $cur in
|
||||
local.*)
|
||||
options=($(__bundle_exec_ruby 'puts Bundler.definition.specs.to_hash.keys'))
|
||||
options=("${options[*]/#/local.}")
|
||||
;;
|
||||
*)
|
||||
options=(path frozen without bin gemfile ssl_ca_cert
|
||||
ssl_client_cert cache_path disable_multisource
|
||||
ignore_messages retry redirect timeout
|
||||
force_ruby_platform specific_platform
|
||||
disable_checksum_validation disable_version_check
|
||||
allow_offline_install auto_install
|
||||
cache_all_platforms cache_all clean console
|
||||
disable_exec_load disable_local_branch_check
|
||||
disable_shared_gems jobs major_deprecations
|
||||
no_install no_prune only_update_to_newer_versions
|
||||
plugins shebang silence_root_warning
|
||||
ssl_verify_mode system_bindir user_agent)
|
||||
# We want to suggest the options above as complete words,
|
||||
# and also "local." and "mirror." as prefixes
|
||||
# To achieve that, disable automatic space insertion,
|
||||
# insert it manually, then add the non-spaced prefixes
|
||||
compopt -o nospace
|
||||
options=("${options[@]/%/ }")
|
||||
# And add prefix suggestions
|
||||
options+=(local. mirror.)
|
||||
# Override $IFS for completion to work
|
||||
local IFS=$'\n'
|
||||
COMPREPLY=($(compgen -W '${options[@]}' -- "$cur"))
|
||||
return
|
||||
;;
|
||||
esac
|
||||
;;
|
||||
path | local.*)
|
||||
_filedir -d
|
||||
return;;
|
||||
esac
|
||||
;;
|
||||
exec)
|
||||
if [[ $COMP_CWORD -eq $bundle_command_index ]]; then
|
||||
# Figure out Bundler's binaries dir
|
||||
local bundler_bin=$(__bundle_exec_ruby 'puts Bundler.bundle_path + "bin"')
|
||||
if [[ -d $bundler_bin ]]; then
|
||||
local binaries=("$bundler_bin"/*)
|
||||
# If there are binaries, strip directory name and use them
|
||||
[[ -f "$binaries" ]] && options="${binaries[@]##*/}"
|
||||
else
|
||||
# No binaries found; use full command completion
|
||||
COMPREPLY=($(compgen -c -- "$cur"))
|
||||
return
|
||||
fi
|
||||
else
|
||||
local _RUBY_COMMAND_PREFIX=("${bundle_bin[@]}" exec)
|
||||
_command_offset $bundle_command_index
|
||||
return
|
||||
fi
|
||||
;;
|
||||
gem)
|
||||
case $prev in
|
||||
-e | --edit)
|
||||
COMPREPLY=($(compgen -c -- "$cur"))
|
||||
return;;
|
||||
-t | --test)
|
||||
options="minitest rspec";;
|
||||
esac
|
||||
;;
|
||||
update)
|
||||
case $prev in
|
||||
--group)
|
||||
__bundle_complete_groups
|
||||
return;;
|
||||
*)
|
||||
options=($(__bundle_exec_ruby 'puts Bundler.definition.specs.to_hash.keys'))
|
||||
esac
|
||||
;;
|
||||
viz)
|
||||
case $prev in
|
||||
-F | --format)
|
||||
options="dot jpg png svg";;
|
||||
-W | --without)
|
||||
__bundle_complete_groups
|
||||
return;;
|
||||
esac
|
||||
;;
|
||||
esac
|
||||
fi
|
||||
COMPREPLY=($(compgen -W "${options[*]}" -- "$cur"))
|
||||
}
|
||||
|
||||
__bundle_get_command() {
|
||||
local i
|
||||
for ((i=1; i < $COMP_CWORD; ++i)); do
|
||||
local arg=${COMP_WORDS[$i]}
|
||||
|
||||
case $arg in
|
||||
[^-]*)
|
||||
bundle_command=$arg
|
||||
bundle_command_index=$((i + 1))
|
||||
return;;
|
||||
--version)
|
||||
# Command-killer
|
||||
bundle_command=-
|
||||
return;;
|
||||
--help)
|
||||
bundle_command=help
|
||||
bundle_command_index=$((i + 1))
|
||||
return;;
|
||||
esac
|
||||
done
|
||||
}
|
||||
|
||||
# Provides completion for Bundler group names.
|
||||
#
|
||||
# Multiple groups can be entered, separated either by spaces or by colons.
|
||||
# Input is read from $cur, and the result is directly written to $COMPREPLY.
|
||||
__bundle_complete_groups() {
|
||||
# Group being currently written
|
||||
local cur_group=${cur##*[ :]}
|
||||
# All groups written before
|
||||
local prefix=${cur%"$cur_group"}
|
||||
local groups=$(__bundle_exec_ruby 'puts Bundler.definition.dependencies.map(&:groups).reduce(:|).map(&:to_s)')
|
||||
if [[ ! $groups ]]; then
|
||||
COMPREPLY=()
|
||||
return
|
||||
fi
|
||||
# Duplicate "default" and anything already in $prefix, so that `uniq`
|
||||
# strips it; groups may be separated by ':', ' ', or '\ '
|
||||
local excluded=$'\ndefault\n'${prefix//[: \'\"\\]/$'\n'}
|
||||
# Include them twice to ensure they are duplicates
|
||||
groups=$groups$excluded$excluded
|
||||
COMPREPLY=($(compgen -W "$(sort <<<"$groups" | uniq -u)" -- "$cur_group"))
|
||||
# Prepend prefix to all entries
|
||||
COMPREPLY=("${COMPREPLY[@]/#/$prefix}")
|
||||
__ltrim_colon_completions "$cur"
|
||||
}
|
||||
|
||||
# __bundle_exec_ruby <script> [args...]
|
||||
#
|
||||
# Runs a Ruby script with Bundler loaded.
|
||||
# Results may be cached.
|
||||
__bundle_exec_ruby() {
|
||||
local bundle_bin=(${bundle_bin[@]:-bundle})
|
||||
# Lockfile is inferred here, and might not be correct (for example, when
|
||||
# running on a subdirectory). However, a wrong file path won't be a
|
||||
# cadastrophic mistake; it just means the cache won't be invalidated when
|
||||
# the local gem list changes (but will still invalidate if the command is
|
||||
# run on another directory)
|
||||
local lockfile=$PWD/Gemfile.lock
|
||||
local cachedir=${XDG_CACHE_HOME:-~/.cache}/completion-ruby
|
||||
local cachefile=$cachedir/bundle--exec-ruby
|
||||
# A representation of all arguments with newlines replaced by spaces,
|
||||
# to fit in a single line as a cache identifier
|
||||
local cache_id_line="${bundle_bin[*]} @ $lockfile: ${*//$'\n'/ }"
|
||||
|
||||
if [[ (! -f $lockfile || $cachefile -nt $lockfile) &&
|
||||
$(head -n 1 -- "$cachefile" 2>/dev/null) = "$cache_id_line" ]]; then
|
||||
tail -n +2 -- "$cachefile"
|
||||
else
|
||||
local output=$("${bundle_bin[@]}" exec ruby -e "$@" 2>/dev/null)
|
||||
if [[ $? -eq 0 ]]; then
|
||||
(mkdir -p -- "$cachedir" &&
|
||||
echo "$cache_id_line"$'\n'"$output" >$cachefile) 2>/dev/null
|
||||
echo "$output"
|
||||
fi
|
||||
fi
|
||||
}
|
||||
|
||||
|
||||
complete -F __bundle -o bashdefault -o default bundle
|
||||
# vim: ai ft=sh sw=4 sts=4 et
|
||||
|
|
@ -1,24 +0,0 @@
|
|||
#!/usr/bin/env bash
|
||||
# Bash completion support for Capistrano.
|
||||
|
||||
export COMP_WORDBREAKS=${COMP_WORDBREAKS/\:/}
|
||||
|
||||
_capcomplete() {
|
||||
if [ -f Capfile ]; then
|
||||
recent=`ls -t .cap_tasks~ Capfile **/*.cap 2> /dev/null | head -n 1`
|
||||
if [[ $recent != '.cap_tasks~' ]]; then
|
||||
cap --version | grep 'Capistrano v2.' > /dev/null
|
||||
if [ $? -eq 0 ]; then
|
||||
# Capistrano 2.x
|
||||
cap --tool --verbose --tasks | cut -d " " -f 2 > .cap_tasks~
|
||||
else
|
||||
# Capistrano 3.x
|
||||
cap --all --tasks | cut -d " " -f 2 > .cap_tasks~
|
||||
fi
|
||||
fi
|
||||
COMPREPLY=($(compgen -W "`cat .cap_tasks~`" -- ${COMP_WORDS[COMP_CWORD]}))
|
||||
return 0
|
||||
fi
|
||||
}
|
||||
|
||||
complete -o default -o nospace -F _capcomplete cap
|
||||
|
|
@ -1,6 +0,0 @@
|
|||
# shellcheck shell=bash
|
||||
# cargo (Rust package manager) completion
|
||||
|
||||
if _binary_exists rustup && _binary_exists cargo; then
|
||||
eval "$(rustup completions bash cargo)"
|
||||
fi
|
||||
|
|
@ -1,129 +0,0 @@
|
|||
# shellcheck shell=bash
|
||||
cite "about-completion"
|
||||
about-completion "composer completion"
|
||||
|
||||
function __composer_completion() {
|
||||
local cur coms opts com words
|
||||
COMPREPLY=()
|
||||
_get_comp_words_by_ref -n : cur words
|
||||
|
||||
# lookup for command
|
||||
for word in "${words[@]:1}"; do
|
||||
if [[ "${word}" != -* ]]; then
|
||||
com="${word}"
|
||||
break
|
||||
fi
|
||||
done
|
||||
|
||||
# completing for an option
|
||||
if [[ ${cur} == --* ]]; then
|
||||
opts="--help --quiet --verbose --version --ansi --no-ansi --no-interaction --profile --no-plugins --working-dir"
|
||||
|
||||
case "${com}" in
|
||||
about)
|
||||
opts="${opts} "
|
||||
;;
|
||||
archive)
|
||||
opts="${opts} --format --dir --file"
|
||||
;;
|
||||
browse)
|
||||
opts="${opts} --homepage --show"
|
||||
;;
|
||||
clear-cache)
|
||||
opts="${opts} "
|
||||
;;
|
||||
config)
|
||||
opts="${opts} --global --editor --auth --unset --list --file --absolute"
|
||||
;;
|
||||
create-project)
|
||||
opts="${opts} --stability --prefer-source --prefer-dist --repository --repository-url --dev --no-dev --no-custom-installers --no-scripts --no-progress --no-secure-http --keep-vcs --no-install --ignore-platform-reqs"
|
||||
;;
|
||||
depends)
|
||||
opts="${opts} --recursive --tree"
|
||||
;;
|
||||
diagnose)
|
||||
opts="${opts} "
|
||||
;;
|
||||
dump-autoload)
|
||||
opts="${opts} --no-scripts --optimize --classmap-authoritative --apcu --no-dev"
|
||||
;;
|
||||
exec)
|
||||
opts="${opts} --list"
|
||||
;;
|
||||
global)
|
||||
opts="${opts} "
|
||||
;;
|
||||
help)
|
||||
opts="${opts} --xml --format --raw"
|
||||
;;
|
||||
init)
|
||||
opts="${opts} --name --description --author --type --homepage --require --require-dev --stability --license --repository"
|
||||
;;
|
||||
install)
|
||||
opts="${opts} --prefer-source --prefer-dist --dry-run --dev --no-dev --no-custom-installers --no-autoloader --no-scripts --no-progress --no-suggest --optimize-autoloader --classmap-authoritative --apcu-autoloader --ignore-platform-reqs"
|
||||
;;
|
||||
licenses)
|
||||
opts="${opts} --format --no-dev"
|
||||
;;
|
||||
list)
|
||||
opts="${opts} --xml --raw --format"
|
||||
;;
|
||||
outdated)
|
||||
opts="${opts} --outdated --all --direct --strict"
|
||||
;;
|
||||
prohibits)
|
||||
opts="${opts} --recursive --tree"
|
||||
;;
|
||||
remove)
|
||||
opts="${opts} --dev --no-progress --no-update --no-scripts --update-no-dev --update-with-dependencies --no-update-with-dependencies --ignore-platform-reqs --optimize-autoloader --classmap-authoritative --apcu-autoloader"
|
||||
;;
|
||||
require)
|
||||
opts="${opts} --dev --prefer-source --prefer-dist --no-progress --no-suggest --no-update --no-scripts --update-no-dev --update-with-dependencies --ignore-platform-reqs --prefer-stable --prefer-lowest --sort-packages --optimize-autoloader --classmap-authoritative --apcu-autoloader"
|
||||
;;
|
||||
run-script)
|
||||
opts="${opts} --timeout --dev --no-dev --list"
|
||||
;;
|
||||
search)
|
||||
opts="${opts} --only-name --type"
|
||||
;;
|
||||
self-update)
|
||||
opts="${opts} --rollback --clean-backups --no-progress --update-keys --stable --preview --snapshot"
|
||||
;;
|
||||
show)
|
||||
opts="${opts} --all --installed --platform --available --self --name-only --path --tree --latest --outdated --minor-only --direct --strict"
|
||||
;;
|
||||
status)
|
||||
opts="${opts} "
|
||||
;;
|
||||
suggests)
|
||||
opts="${opts} --by-package --by-suggestion --no-dev"
|
||||
;;
|
||||
update)
|
||||
opts="${opts} --prefer-source --prefer-dist --dry-run --dev --no-dev --lock --no-custom-installers --no-autoloader --no-scripts --no-progress --no-suggest --with-dependencies --optimize-autoloader --classmap-authoritative --apcu-autoloader --ignore-platform-reqs --prefer-stable --prefer-lowest --interactive --root-reqs"
|
||||
;;
|
||||
validate)
|
||||
opts="${opts} --no-check-all --no-check-lock --no-check-publish --with-dependencies --strict"
|
||||
;;
|
||||
|
||||
esac
|
||||
|
||||
# shellcheck disable=SC2207
|
||||
COMPREPLY=($(compgen -W "${opts}" -- "${cur}"))
|
||||
__ltrim_colon_completions "${cur}"
|
||||
|
||||
return 0
|
||||
fi
|
||||
|
||||
# completing for a command
|
||||
if [[ "${cur}" == "${com}" ]]; then
|
||||
coms="about archive browse clear-cache config create-project depends diagnose dump-autoload exec global help init install licenses list outdated prohibits remove require run-script search self-update show status suggests update validate"
|
||||
|
||||
# shellcheck disable=SC2207
|
||||
COMPREPLY=($(compgen -W "${coms}" -- "${cur}"))
|
||||
__ltrim_colon_completions "${cur}"
|
||||
|
||||
return 0
|
||||
fi
|
||||
}
|
||||
|
||||
complete -o default -F __composer_completion composer
|
||||
|
|
@ -1,11 +0,0 @@
|
|||
# shellcheck shell=bash
|
||||
cite "about-completion"
|
||||
about-completion "conda completion"
|
||||
|
||||
if _command_exists conda; then
|
||||
if _command_exists register-python-argcomplete; then
|
||||
eval "$(register-python-argcomplete conda)"
|
||||
else
|
||||
_log_warning "Argcomplete not found. Please run 'conda install argcomplete'"
|
||||
fi
|
||||
fi
|
||||
|
|
@ -1,7 +0,0 @@
|
|||
# shellcheck shell=bash
|
||||
cite "about-completion"
|
||||
about-completion "Hashicorp consul completion"
|
||||
|
||||
if _command_exists consul; then
|
||||
complete -C "$(command -v consul)" consul
|
||||
fi
|
||||
|
|
@ -1 +0,0 @@
|
|||
_log_warning 'Bash completion for "crystal" is now covered by "system". This completion can be disabled.'
|
||||
|
|
@ -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
|
||||
|
|
@ -1,5 +0,0 @@
|
|||
# shellcheck shell=bash
|
||||
|
||||
if test -s "${BASH_IT?}/vendor/github.com/gaelicWizard/bash-progcomp/defaults.completion.bash"; then
|
||||
source "$_"
|
||||
fi
|
||||
|
|
@ -1,15 +0,0 @@
|
|||
#!/usr/bin/env bash
|
||||
# Bash completion support for the 'dirs' plugin (commands G, R).
|
||||
|
||||
_dirs-complete() {
|
||||
local CURRENT_PROMPT="${COMP_WORDS[COMP_CWORD]}"
|
||||
|
||||
# parse all defined shortcuts from ~/.dirs
|
||||
if [ -r "$HOME/.dirs" ]; then
|
||||
COMPREPLY=($(compgen -W "$(grep -v '^#' ~/.dirs | sed -e 's/\(.*\)=.*/\1/')" -- ${CURRENT_PROMPT}) )
|
||||
fi
|
||||
|
||||
return 0
|
||||
}
|
||||
|
||||
complete -o default -o nospace -F _dirs-complete G R
|
||||
|
|
@ -1,4 +0,0 @@
|
|||
# shellcheck shell=bash
|
||||
about-completion "django completion"
|
||||
# shellcheck disable=SC1090
|
||||
source "${BASH_IT}"/vendor/github.com/django/django/extras/django_bash_completion
|
||||
|
|
@ -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
|
||||
|
|
@ -1,688 +0,0 @@
|
|||
#!/bin/bash
|
||||
#
|
||||
|
||||
# Licensed under the Apache License, Version 2.0 (the "License");
|
||||
# you may not use this file except in compliance with the License.
|
||||
# You may obtain a copy of the License at
|
||||
#
|
||||
# http://www.apache.org/licenses/LICENSE-2.0
|
||||
#
|
||||
# Unless required by applicable law or agreed to in writing, software
|
||||
# distributed under the License is distributed on an "AS IS" BASIS,
|
||||
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
# See the License for the specific language governing permissions and
|
||||
# limitations under the License.
|
||||
|
||||
# Copyright (c) 2014 Docker, Inc
|
||||
|
||||
# bash completion for docker-compose
|
||||
#
|
||||
# This work is based on the completion for the docker command.
|
||||
#
|
||||
# This script provides completion of:
|
||||
# - commands and their options
|
||||
# - service names
|
||||
# - filepaths
|
||||
#
|
||||
# To enable the completions either:
|
||||
# - place this file in /etc/bash_completion.d
|
||||
# or
|
||||
# - copy this file to e.g. ~/.docker-compose-completion.sh and add the line
|
||||
# below to your .bashrc after bash completion features are loaded
|
||||
# . ~/.docker-compose-completion.sh
|
||||
|
||||
__docker_compose_previous_extglob_setting=$(shopt -p extglob)
|
||||
shopt -s extglob
|
||||
|
||||
__docker_compose_q() {
|
||||
docker-compose 2>/dev/null "${top_level_options[@]}" "$@"
|
||||
}
|
||||
|
||||
# Transforms a multiline list of strings into a single line string
|
||||
# with the words separated by "|".
|
||||
__docker_compose_to_alternatives() {
|
||||
local parts=( $1 )
|
||||
local IFS='|'
|
||||
echo "${parts[*]}"
|
||||
}
|
||||
|
||||
# Transforms a multiline list of options into an extglob pattern
|
||||
# suitable for use in case statements.
|
||||
__docker_compose_to_extglob() {
|
||||
local extglob=$( __docker_compose_to_alternatives "$1" )
|
||||
echo "@($extglob)"
|
||||
}
|
||||
|
||||
# Determines whether the option passed as the first argument exist on
|
||||
# the commandline. The option may be a pattern, e.g. `--force|-f`.
|
||||
__docker_compose_has_option() {
|
||||
local pattern="$1"
|
||||
for (( i=2; i < $cword; ++i)); do
|
||||
if [[ ${words[$i]} =~ ^($pattern)$ ]] ; then
|
||||
return 0
|
||||
fi
|
||||
done
|
||||
return 1
|
||||
}
|
||||
|
||||
# Returns `key` if we are currently completing the value of a map option (`key=value`)
|
||||
# which matches the extglob passed in as an argument.
|
||||
# This function is needed for key-specific completions.
|
||||
__docker_compose_map_key_of_current_option() {
|
||||
local glob="$1"
|
||||
|
||||
local key glob_pos
|
||||
if [ "$cur" = "=" ] ; then # key= case
|
||||
key="$prev"
|
||||
glob_pos=$((cword - 2))
|
||||
elif [[ $cur == *=* ]] ; then # key=value case (OSX)
|
||||
key=${cur%=*}
|
||||
glob_pos=$((cword - 1))
|
||||
elif [ "$prev" = "=" ] ; then
|
||||
key=${words[$cword - 2]} # key=value case
|
||||
glob_pos=$((cword - 3))
|
||||
else
|
||||
return
|
||||
fi
|
||||
|
||||
[ "${words[$glob_pos]}" = "=" ] && ((glob_pos--)) # --option=key=value syntax
|
||||
|
||||
[[ ${words[$glob_pos]} == @($glob) ]] && echo "$key"
|
||||
}
|
||||
|
||||
# suppress trailing whitespace
|
||||
__docker_compose_nospace() {
|
||||
# compopt is not available in ancient bash versions
|
||||
type compopt &>/dev/null && compopt -o nospace
|
||||
}
|
||||
|
||||
|
||||
# Outputs a list of all defined services, regardless of their running state.
|
||||
# Arguments for `docker-compose ps` may be passed in order to filter the service list,
|
||||
# e.g. `status=running`.
|
||||
__docker_compose_services() {
|
||||
__docker_compose_q ps --services "$@"
|
||||
}
|
||||
|
||||
# Applies completion of services based on the current value of `$cur`.
|
||||
# Arguments for `docker-compose ps` may be passed in order to filter the service list,
|
||||
# see `__docker_compose_services`.
|
||||
__docker_compose_complete_services() {
|
||||
COMPREPLY=( $(compgen -W "$(__docker_compose_services "$@")" -- "$cur") )
|
||||
}
|
||||
|
||||
# The services for which at least one running container exists
|
||||
__docker_compose_complete_running_services() {
|
||||
local names=$(__docker_compose_services --filter status=running)
|
||||
COMPREPLY=( $(compgen -W "$names" -- "$cur") )
|
||||
}
|
||||
|
||||
|
||||
_docker_compose_build() {
|
||||
case "$prev" in
|
||||
--build-arg)
|
||||
COMPREPLY=( $( compgen -e -- "$cur" ) )
|
||||
__docker_compose_nospace
|
||||
return
|
||||
;;
|
||||
--memory|-m)
|
||||
return
|
||||
;;
|
||||
esac
|
||||
|
||||
case "$cur" in
|
||||
-*)
|
||||
COMPREPLY=( $( compgen -W "--build-arg --compress --force-rm --help --memory -m --no-cache --no-rm --pull --parallel -q --quiet" -- "$cur" ) )
|
||||
;;
|
||||
*)
|
||||
__docker_compose_complete_services --filter source=build
|
||||
;;
|
||||
esac
|
||||
}
|
||||
|
||||
|
||||
_docker_compose_bundle() {
|
||||
case "$prev" in
|
||||
--output|-o)
|
||||
_filedir
|
||||
return
|
||||
;;
|
||||
esac
|
||||
|
||||
COMPREPLY=( $( compgen -W "--push-images --help --output -o" -- "$cur" ) )
|
||||
}
|
||||
|
||||
|
||||
_docker_compose_config() {
|
||||
case "$prev" in
|
||||
--hash)
|
||||
if [[ $cur == \\* ]] ; then
|
||||
COMPREPLY=( '\*' )
|
||||
else
|
||||
COMPREPLY=( $(compgen -W "$(__docker_compose_services) \\\* " -- "$cur") )
|
||||
fi
|
||||
return
|
||||
;;
|
||||
esac
|
||||
|
||||
COMPREPLY=( $( compgen -W "--hash --help --quiet -q --resolve-image-digests --services --volumes" -- "$cur" ) )
|
||||
}
|
||||
|
||||
|
||||
_docker_compose_create() {
|
||||
case "$cur" in
|
||||
-*)
|
||||
COMPREPLY=( $( compgen -W "--build --force-recreate --help --no-build --no-recreate" -- "$cur" ) )
|
||||
;;
|
||||
*)
|
||||
__docker_compose_complete_services
|
||||
;;
|
||||
esac
|
||||
}
|
||||
|
||||
|
||||
_docker_compose_docker_compose() {
|
||||
case "$prev" in
|
||||
--tlscacert|--tlscert|--tlskey)
|
||||
_filedir
|
||||
return
|
||||
;;
|
||||
--file|-f)
|
||||
_filedir "y?(a)ml"
|
||||
return
|
||||
;;
|
||||
--log-level)
|
||||
COMPREPLY=( $( compgen -W "debug info warning error critical" -- "$cur" ) )
|
||||
return
|
||||
;;
|
||||
--project-directory)
|
||||
_filedir -d
|
||||
return
|
||||
;;
|
||||
$(__docker_compose_to_extglob "$daemon_options_with_args") )
|
||||
return
|
||||
;;
|
||||
esac
|
||||
|
||||
case "$cur" in
|
||||
-*)
|
||||
COMPREPLY=( $( compgen -W "$daemon_boolean_options $daemon_options_with_args $top_level_options_with_args --help -h --no-ansi --verbose --version -v" -- "$cur" ) )
|
||||
;;
|
||||
*)
|
||||
COMPREPLY=( $( compgen -W "${commands[*]}" -- "$cur" ) )
|
||||
;;
|
||||
esac
|
||||
}
|
||||
|
||||
|
||||
_docker_compose_down() {
|
||||
case "$prev" in
|
||||
--rmi)
|
||||
COMPREPLY=( $( compgen -W "all local" -- "$cur" ) )
|
||||
return
|
||||
;;
|
||||
--timeout|-t)
|
||||
return
|
||||
;;
|
||||
esac
|
||||
|
||||
case "$cur" in
|
||||
-*)
|
||||
COMPREPLY=( $( compgen -W "--help --rmi --timeout -t --volumes -v --remove-orphans" -- "$cur" ) )
|
||||
;;
|
||||
esac
|
||||
}
|
||||
|
||||
|
||||
_docker_compose_events() {
|
||||
case "$prev" in
|
||||
--json)
|
||||
return
|
||||
;;
|
||||
esac
|
||||
|
||||
case "$cur" in
|
||||
-*)
|
||||
COMPREPLY=( $( compgen -W "--help --json" -- "$cur" ) )
|
||||
;;
|
||||
*)
|
||||
__docker_compose_complete_services
|
||||
;;
|
||||
esac
|
||||
}
|
||||
|
||||
|
||||
_docker_compose_exec() {
|
||||
case "$prev" in
|
||||
--index|--user|-u|--workdir|-w)
|
||||
return
|
||||
;;
|
||||
esac
|
||||
|
||||
case "$cur" in
|
||||
-*)
|
||||
COMPREPLY=( $( compgen -W "-d --detach --help --index --privileged -T --user -u --workdir -w" -- "$cur" ) )
|
||||
;;
|
||||
*)
|
||||
__docker_compose_complete_running_services
|
||||
;;
|
||||
esac
|
||||
}
|
||||
|
||||
|
||||
_docker_compose_help() {
|
||||
COMPREPLY=( $( compgen -W "${commands[*]}" -- "$cur" ) )
|
||||
}
|
||||
|
||||
_docker_compose_images() {
|
||||
case "$cur" in
|
||||
-*)
|
||||
COMPREPLY=( $( compgen -W "--help --quiet -q" -- "$cur" ) )
|
||||
;;
|
||||
*)
|
||||
__docker_compose_complete_services
|
||||
;;
|
||||
esac
|
||||
}
|
||||
|
||||
_docker_compose_kill() {
|
||||
case "$prev" in
|
||||
-s)
|
||||
COMPREPLY=( $( compgen -W "SIGHUP SIGINT SIGKILL SIGUSR1 SIGUSR2" -- "$(echo $cur | tr '[:lower:]' '[:upper:]')" ) )
|
||||
return
|
||||
;;
|
||||
esac
|
||||
|
||||
case "$cur" in
|
||||
-*)
|
||||
COMPREPLY=( $( compgen -W "--help -s" -- "$cur" ) )
|
||||
;;
|
||||
*)
|
||||
__docker_compose_complete_running_services
|
||||
;;
|
||||
esac
|
||||
}
|
||||
|
||||
|
||||
_docker_compose_logs() {
|
||||
case "$prev" in
|
||||
--tail)
|
||||
return
|
||||
;;
|
||||
esac
|
||||
|
||||
case "$cur" in
|
||||
-*)
|
||||
COMPREPLY=( $( compgen -W "--follow -f --help --no-color --tail --timestamps -t" -- "$cur" ) )
|
||||
;;
|
||||
*)
|
||||
__docker_compose_complete_services
|
||||
;;
|
||||
esac
|
||||
}
|
||||
|
||||
|
||||
_docker_compose_pause() {
|
||||
case "$cur" in
|
||||
-*)
|
||||
COMPREPLY=( $( compgen -W "--help" -- "$cur" ) )
|
||||
;;
|
||||
*)
|
||||
__docker_compose_complete_running_services
|
||||
;;
|
||||
esac
|
||||
}
|
||||
|
||||
|
||||
_docker_compose_port() {
|
||||
case "$prev" in
|
||||
--protocol)
|
||||
COMPREPLY=( $( compgen -W "tcp udp" -- "$cur" ) )
|
||||
return;
|
||||
;;
|
||||
--index)
|
||||
return;
|
||||
;;
|
||||
esac
|
||||
|
||||
case "$cur" in
|
||||
-*)
|
||||
COMPREPLY=( $( compgen -W "--help --index --protocol" -- "$cur" ) )
|
||||
;;
|
||||
*)
|
||||
__docker_compose_complete_services
|
||||
;;
|
||||
esac
|
||||
}
|
||||
|
||||
|
||||
_docker_compose_ps() {
|
||||
local key=$(__docker_compose_map_key_of_current_option '--filter')
|
||||
case "$key" in
|
||||
source)
|
||||
COMPREPLY=( $( compgen -W "build image" -- "${cur##*=}" ) )
|
||||
return
|
||||
;;
|
||||
status)
|
||||
COMPREPLY=( $( compgen -W "paused restarting running stopped" -- "${cur##*=}" ) )
|
||||
return
|
||||
;;
|
||||
esac
|
||||
|
||||
case "$prev" in
|
||||
--filter)
|
||||
COMPREPLY=( $( compgen -W "source status" -S "=" -- "$cur" ) )
|
||||
__docker_compose_nospace
|
||||
return;
|
||||
;;
|
||||
esac
|
||||
|
||||
case "$cur" in
|
||||
-*)
|
||||
COMPREPLY=( $( compgen -W "--all -a --filter --help --quiet -q --services" -- "$cur" ) )
|
||||
;;
|
||||
*)
|
||||
__docker_compose_complete_services
|
||||
;;
|
||||
esac
|
||||
}
|
||||
|
||||
|
||||
_docker_compose_pull() {
|
||||
case "$cur" in
|
||||
-*)
|
||||
COMPREPLY=( $( compgen -W "--help --ignore-pull-failures --include-deps --no-parallel --quiet -q" -- "$cur" ) )
|
||||
;;
|
||||
*)
|
||||
__docker_compose_complete_services --filter source=image
|
||||
;;
|
||||
esac
|
||||
}
|
||||
|
||||
|
||||
_docker_compose_push() {
|
||||
case "$cur" in
|
||||
-*)
|
||||
COMPREPLY=( $( compgen -W "--help --ignore-push-failures" -- "$cur" ) )
|
||||
;;
|
||||
*)
|
||||
__docker_compose_complete_services
|
||||
;;
|
||||
esac
|
||||
}
|
||||
|
||||
|
||||
_docker_compose_restart() {
|
||||
case "$prev" in
|
||||
--timeout|-t)
|
||||
return
|
||||
;;
|
||||
esac
|
||||
|
||||
case "$cur" in
|
||||
-*)
|
||||
COMPREPLY=( $( compgen -W "--help --timeout -t" -- "$cur" ) )
|
||||
;;
|
||||
*)
|
||||
__docker_compose_complete_running_services
|
||||
;;
|
||||
esac
|
||||
}
|
||||
|
||||
|
||||
_docker_compose_rm() {
|
||||
case "$cur" in
|
||||
-*)
|
||||
COMPREPLY=( $( compgen -W "--force -f --help --stop -s -v" -- "$cur" ) )
|
||||
;;
|
||||
*)
|
||||
if __docker_compose_has_option "--stop|-s" ; then
|
||||
__docker_compose_complete_services
|
||||
else
|
||||
__docker_compose_complete_services --filter status=stopped
|
||||
fi
|
||||
;;
|
||||
esac
|
||||
}
|
||||
|
||||
|
||||
_docker_compose_run() {
|
||||
case "$prev" in
|
||||
-e)
|
||||
COMPREPLY=( $( compgen -e -- "$cur" ) )
|
||||
__docker_compose_nospace
|
||||
return
|
||||
;;
|
||||
--entrypoint|--label|-l|--name|--user|-u|--volume|-v|--workdir|-w)
|
||||
return
|
||||
;;
|
||||
esac
|
||||
|
||||
case "$cur" in
|
||||
-*)
|
||||
COMPREPLY=( $( compgen -W "--detach -d --entrypoint -e --help --label -l --name --no-deps --publish -p --rm --service-ports -T --use-aliases --user -u --volume -v --workdir -w" -- "$cur" ) )
|
||||
;;
|
||||
*)
|
||||
__docker_compose_complete_services
|
||||
;;
|
||||
esac
|
||||
}
|
||||
|
||||
|
||||
_docker_compose_scale() {
|
||||
case "$prev" in
|
||||
=)
|
||||
COMPREPLY=("$cur")
|
||||
return
|
||||
;;
|
||||
--timeout|-t)
|
||||
return
|
||||
;;
|
||||
esac
|
||||
|
||||
case "$cur" in
|
||||
-*)
|
||||
COMPREPLY=( $( compgen -W "--help --timeout -t" -- "$cur" ) )
|
||||
;;
|
||||
*)
|
||||
COMPREPLY=( $(compgen -S "=" -W "$(__docker_compose_services)" -- "$cur") )
|
||||
__docker_compose_nospace
|
||||
;;
|
||||
esac
|
||||
}
|
||||
|
||||
|
||||
_docker_compose_start() {
|
||||
case "$cur" in
|
||||
-*)
|
||||
COMPREPLY=( $( compgen -W "--help" -- "$cur" ) )
|
||||
;;
|
||||
*)
|
||||
__docker_compose_complete_services --filter status=stopped
|
||||
;;
|
||||
esac
|
||||
}
|
||||
|
||||
|
||||
_docker_compose_stop() {
|
||||
case "$prev" in
|
||||
--timeout|-t)
|
||||
return
|
||||
;;
|
||||
esac
|
||||
|
||||
case "$cur" in
|
||||
-*)
|
||||
COMPREPLY=( $( compgen -W "--help --timeout -t" -- "$cur" ) )
|
||||
;;
|
||||
*)
|
||||
__docker_compose_complete_running_services
|
||||
;;
|
||||
esac
|
||||
}
|
||||
|
||||
|
||||
_docker_compose_top() {
|
||||
case "$cur" in
|
||||
-*)
|
||||
COMPREPLY=( $( compgen -W "--help" -- "$cur" ) )
|
||||
;;
|
||||
*)
|
||||
__docker_compose_complete_running_services
|
||||
;;
|
||||
esac
|
||||
}
|
||||
|
||||
|
||||
_docker_compose_unpause() {
|
||||
case "$cur" in
|
||||
-*)
|
||||
COMPREPLY=( $( compgen -W "--help" -- "$cur" ) )
|
||||
;;
|
||||
*)
|
||||
__docker_compose_complete_services --filter status=paused
|
||||
;;
|
||||
esac
|
||||
}
|
||||
|
||||
|
||||
_docker_compose_up() {
|
||||
case "$prev" in
|
||||
=)
|
||||
COMPREPLY=("$cur")
|
||||
return
|
||||
;;
|
||||
--exit-code-from)
|
||||
__docker_compose_complete_services
|
||||
return
|
||||
;;
|
||||
--scale)
|
||||
COMPREPLY=( $(compgen -S "=" -W "$(__docker_compose_services)" -- "$cur") )
|
||||
__docker_compose_nospace
|
||||
return
|
||||
;;
|
||||
--timeout|-t)
|
||||
return
|
||||
;;
|
||||
esac
|
||||
|
||||
case "$cur" in
|
||||
-*)
|
||||
COMPREPLY=( $( compgen -W "--abort-on-container-exit --always-recreate-deps --build -d --detach --exit-code-from --force-recreate --help --no-build --no-color --no-deps --no-recreate --no-start --renew-anon-volumes -V --remove-orphans --scale --timeout -t" -- "$cur" ) )
|
||||
;;
|
||||
*)
|
||||
__docker_compose_complete_services
|
||||
;;
|
||||
esac
|
||||
}
|
||||
|
||||
|
||||
_docker_compose_version() {
|
||||
case "$cur" in
|
||||
-*)
|
||||
COMPREPLY=( $( compgen -W "--short" -- "$cur" ) )
|
||||
;;
|
||||
esac
|
||||
}
|
||||
|
||||
|
||||
_docker_compose() {
|
||||
local previous_extglob_setting=$(shopt -p extglob)
|
||||
shopt -s extglob
|
||||
|
||||
local commands=(
|
||||
build
|
||||
bundle
|
||||
config
|
||||
create
|
||||
down
|
||||
events
|
||||
exec
|
||||
help
|
||||
images
|
||||
kill
|
||||
logs
|
||||
pause
|
||||
port
|
||||
ps
|
||||
pull
|
||||
push
|
||||
restart
|
||||
rm
|
||||
run
|
||||
scale
|
||||
start
|
||||
stop
|
||||
top
|
||||
unpause
|
||||
up
|
||||
version
|
||||
)
|
||||
|
||||
# Options for the docker daemon that have to be passed to secondary calls to
|
||||
# docker-compose executed by this script.
|
||||
local daemon_boolean_options="
|
||||
--skip-hostname-check
|
||||
--tls
|
||||
--tlsverify
|
||||
"
|
||||
local daemon_options_with_args="
|
||||
--file -f
|
||||
--host -H
|
||||
--project-directory
|
||||
--project-name -p
|
||||
--tlscacert
|
||||
--tlscert
|
||||
--tlskey
|
||||
"
|
||||
|
||||
# These options are require special treatment when searching the command.
|
||||
local top_level_options_with_args="
|
||||
--log-level
|
||||
"
|
||||
|
||||
COMPREPLY=()
|
||||
local cur prev words cword
|
||||
_get_comp_words_by_ref -n : cur prev words cword
|
||||
|
||||
# search subcommand and invoke its handler.
|
||||
# special treatment of some top-level options
|
||||
local command='docker_compose'
|
||||
local top_level_options=()
|
||||
local counter=1
|
||||
|
||||
while [ $counter -lt $cword ]; do
|
||||
case "${words[$counter]}" in
|
||||
$(__docker_compose_to_extglob "$daemon_boolean_options") )
|
||||
local opt=${words[counter]}
|
||||
top_level_options+=($opt)
|
||||
;;
|
||||
$(__docker_compose_to_extglob "$daemon_options_with_args") )
|
||||
local opt=${words[counter]}
|
||||
local arg=${words[++counter]}
|
||||
top_level_options+=($opt $arg)
|
||||
;;
|
||||
$(__docker_compose_to_extglob "$top_level_options_with_args") )
|
||||
(( counter++ ))
|
||||
;;
|
||||
-*)
|
||||
;;
|
||||
*)
|
||||
command="${words[$counter]}"
|
||||
break
|
||||
;;
|
||||
esac
|
||||
(( counter++ ))
|
||||
done
|
||||
|
||||
local completions_func=_docker_compose_${command//-/_}
|
||||
_is_function $completions_func && $completions_func
|
||||
|
||||
eval "$previous_extglob_setting"
|
||||
return 0
|
||||
}
|
||||
|
||||
eval "$__docker_compose_previous_extglob_setting"
|
||||
unset __docker_compose_previous_extglob_setting
|
||||
|
||||
complete -F _docker_compose docker-compose docker-compose.exe
|
||||
|
|
@ -1,3 +0,0 @@
|
|||
# shellcheck shell=bash
|
||||
_log_warning '"docker-machine" is now deprecated, and as such the bash completion for it is also deprecated.
|
||||
Please disable this completion.'
|
||||
|
|
@ -1,24 +0,0 @@
|
|||
# shellcheck shell=bash
|
||||
cite "about-completion"
|
||||
about-completion "docker completion"
|
||||
|
||||
# Make sure docker is installed
|
||||
_command_exists docker || return
|
||||
|
||||
# Don't handle completion if it's already managed
|
||||
_completion_exists docker && return
|
||||
|
||||
_docker_bash_completion_paths=(
|
||||
# MacOS
|
||||
'/Applications/Docker.app/Contents/Resources/etc/docker.bash-completion'
|
||||
# Linux
|
||||
'/usr/share/bash-completion/completions/docker'
|
||||
)
|
||||
|
||||
for fn in "${_docker_bash_completion_paths[@]}"; do
|
||||
if [ -r "$fn" ]; then
|
||||
# shellcheck disable=SC1090
|
||||
source "$fn"
|
||||
break
|
||||
fi
|
||||
done
|
||||
|
|
@ -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
|
||||
|
|
@ -1,2 +0,0 @@
|
|||
_log_warning 'Bash completion for "drush" is now deprecated, as it used code with incompatible license.
|
||||
Please disable this completion and use the instructions from "drush" developers instead.'
|
||||
|
|
@ -1 +0,0 @@
|
|||
complete -o nospace -S = -W '$(printenv | awk -F= "{print \$1}")' export
|
||||
|
|
@ -1,133 +0,0 @@
|
|||
# shellcheck shell=bash
|
||||
#
|
||||
# Bash completion support for Fabric (http://fabfile.org/)
|
||||
#
|
||||
#
|
||||
# Copyright (C) 2011 by Konstantin Bakulin
|
||||
#
|
||||
# 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.
|
||||
#
|
||||
# Thanks to:
|
||||
# - Adam Vandenberg,
|
||||
# https://github.com/adamv/dotfiles/blob/master/completion_scripts/fab_completion.bash
|
||||
#
|
||||
# - Enrico Batista da Luz,
|
||||
# https://github.com/ricobl/dotfiles/blob/master/bin/fab_bash_completion
|
||||
#
|
||||
|
||||
|
||||
# Use cache files for fab tasks or not.
|
||||
# If set to "false" command "fab --shortlist" will be executed every time.
|
||||
export FAB_COMPLETION_CACHE_TASKS=true
|
||||
|
||||
# File name where tasks cache will be stored (in current dir).
|
||||
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'*)
|
||||
__FAB_COMPLETION_MTIME_COMMAND="stat -f '%m'"
|
||||
;;
|
||||
*)
|
||||
__FAB_COMPLETION_MTIME_COMMAND="stat -c '%Y'"
|
||||
;;
|
||||
esac
|
||||
|
||||
|
||||
#
|
||||
# Get time of last fab cache file modification as seconds since Epoch
|
||||
#
|
||||
function __fab_chache_mtime() {
|
||||
${__FAB_COMPLETION_MTIME_COMMAND} \
|
||||
$FAB_COMPLETION_CACHED_TASKS_FILENAME | xargs -n 1 expr
|
||||
}
|
||||
|
||||
|
||||
#
|
||||
# Get time of last fabfile file/module modification as seconds since Epoch
|
||||
#
|
||||
function __fab_fabfile_mtime() {
|
||||
local f="fabfile"
|
||||
if [[ -e "$f.py" ]]; then
|
||||
${__FAB_COMPLETION_MTIME_COMMAND} "$f.py" | xargs -n 1 expr
|
||||
else
|
||||
# Suppose that it's a fabfile dir
|
||||
find $f/*.py -exec ${__FAB_COMPLETION_MTIME_COMMAND} {} + \
|
||||
| xargs -n 1 expr | sort -n -r | head -1
|
||||
fi
|
||||
}
|
||||
|
||||
|
||||
#
|
||||
# Completion for "fab" command
|
||||
#
|
||||
function __fab_completion() {
|
||||
# Return if "fab" command doesn't exists
|
||||
[[ -e `which fab 2> /dev/null` ]] || return 0
|
||||
|
||||
# Variables to hold the current word and possible matches
|
||||
local cur="${COMP_WORDS[COMP_CWORD]}"
|
||||
local opts=()
|
||||
|
||||
# Generate possible matches and store them in variable "opts"
|
||||
case "${cur}" in
|
||||
-*)
|
||||
if [[ -z "${__FAB_COMPLETION_LONG_OPT}" ]]; then
|
||||
export __FAB_COMPLETION_LONG_OPT=$(
|
||||
fab --help | grep -E -o "\-\-[A-Za-z_\-]+\=?" | sort -u)
|
||||
fi
|
||||
opts="${__FAB_COMPLETION_LONG_OPT}"
|
||||
;;
|
||||
|
||||
# Completion for short options is not nessary.
|
||||
# It's left here just for history.
|
||||
# -*)
|
||||
# if [[ -z "${__FAB_COMPLETION_SHORT_OPT}" ]]; then
|
||||
# export __FAB_COMPLETION_SHORT_OPT=$(
|
||||
# fab --help | grep -E -o "^ +\-[A-Za-z_\]" | sort -u)
|
||||
# fi
|
||||
# opts="${__FAB_COMPLETION_SHORT_OPT}"
|
||||
# ;;
|
||||
|
||||
*)
|
||||
# If "fabfile.py" or "fabfile" dir with "__init__.py" file exists
|
||||
local f="fabfile"
|
||||
if [[ -e "$f.py" || (-d "$f" && -e "$f/__init__.py") ]]; then
|
||||
# Build a list of the available tasks
|
||||
if $FAB_COMPLETION_CACHE_TASKS; then
|
||||
# If use cache
|
||||
if [[ ! -s ${FAB_COMPLETION_CACHED_TASKS_FILENAME} ||
|
||||
$(__fab_fabfile_mtime) -gt $(__fab_chache_mtime) ]]; then
|
||||
fab --shortlist > ${FAB_COMPLETION_CACHED_TASKS_FILENAME} \
|
||||
2> /dev/null
|
||||
fi
|
||||
opts=$(cat ${FAB_COMPLETION_CACHED_TASKS_FILENAME})
|
||||
else
|
||||
# Without cache
|
||||
opts=$(fab --shortlist 2> /dev/null)
|
||||
fi
|
||||
fi
|
||||
;;
|
||||
esac
|
||||
|
||||
# Set possible completions
|
||||
COMPREPLY=($(compgen -W "${opts}" -- ${cur}))
|
||||
}
|
||||
complete -o default -o nospace -F __fab_completion fab
|
||||
|
|
@ -1,5 +0,0 @@
|
|||
# shellcheck shell=bash
|
||||
|
||||
if _command_exists flutter; then
|
||||
eval "$(flutter bash-completion)"
|
||||
fi
|
||||
|
|
@ -1,14 +0,0 @@
|
|||
# shellcheck shell=bash
|
||||
cite "about-completion"
|
||||
about-completion "Google Cloud SDK completion"
|
||||
|
||||
if _command_exists gcloud; then
|
||||
# get install path
|
||||
GOOGLE_SDK_ROOT=${GOOGLE_SDK_ROOT:-$(gcloud info --format="value(installation.sdk_root)")}
|
||||
|
||||
# source all the bash completion file that are available
|
||||
for i in "${GOOGLE_SDK_ROOT}"/*.bash.inc; do
|
||||
# shellcheck disable=SC1090
|
||||
source "$i"
|
||||
done
|
||||
fi
|
||||
|
|
@ -1,35 +0,0 @@
|
|||
# shellcheck shell=bash
|
||||
cite "about-completion"
|
||||
about-completion "gem completion"
|
||||
|
||||
__gem_completion() {
|
||||
local cur=${COMP_WORDS[COMP_CWORD]}
|
||||
local prev=${COMP_WORDS[COMP_CWORD - 1]}
|
||||
case $prev in
|
||||
install)
|
||||
# list the remote gems and add to completion
|
||||
if [ -z "$REMOTE_GEMS" ]; then
|
||||
read -r -a REMOTE_GEMS <<< "$(gem list --remote --no-versions | sed 's/\*\*\* REMOTE GEMS \*\*\*//' | tr '\n' ' ')"
|
||||
fi
|
||||
|
||||
local cur=${COMP_WORDS[COMP_CWORD]}
|
||||
# shellcheck disable=SC2207
|
||||
COMPREPLY=($(compgen -W "${REMOTE_GEMS[*]}" -- "$cur"))
|
||||
return 0
|
||||
;;
|
||||
uninstall)
|
||||
# list all local installed gems and add to completion
|
||||
read -r -a LOCAL_GEMS <<< "$(gem list --no-versions | sed 's/\*\*\* LOCAL GEMS \*\*\*//' | tr '\n' ' ')"
|
||||
|
||||
local cur=${COMP_WORDS[COMP_CWORD]}
|
||||
# shellcheck disable=SC2207
|
||||
COMPREPLY=($(compgen -W "${LOCAL_GEMS[*]}" -- "$cur"))
|
||||
return 0
|
||||
;;
|
||||
esac
|
||||
local commands=(build cert check cleanup contents dependency environment fetch generate_index help install list lock outdated owner pristine push query rdoc search server sources specification stale uninstall unpack update which)
|
||||
# shellcheck disable=SC2207
|
||||
COMPREPLY=($(compgen -W "${commands[*]}" -- "$cur"))
|
||||
}
|
||||
|
||||
complete -F __gem_completion gem
|
||||
|
|
@ -1,42 +0,0 @@
|
|||
# shellcheck shell=bash
|
||||
#
|
||||
# Locate and load completions for `git`.
|
||||
|
||||
# Make sure git is installed
|
||||
_command_exists git || return
|
||||
|
||||
# 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
|
||||
fi
|
||||
|
||||
_git_bash_completion_xcrun_git=
|
||||
if _command_exists xcrun; then
|
||||
_git_bash_completion_xcrun_git="$(xcrun --find git)"
|
||||
fi
|
||||
_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"
|
||||
)
|
||||
|
||||
# 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
|
||||
done
|
||||
|
||||
# Cleanup
|
||||
if [[ "${_git_bash_completion_found}" == false ]]; then
|
||||
_log_warning "no completion files found - please try enabling the 'system' completion instead."
|
||||
fi
|
||||
unset "${!_git_bash_completion@}"
|
||||
|
|
@ -1,178 +0,0 @@
|
|||
#!bash
|
||||
#
|
||||
# git-flow-completion
|
||||
# ===================
|
||||
#
|
||||
# Bash completion support for [git-flow](http://github.com/nvie/gitflow)
|
||||
#
|
||||
# The contained completion routines provide support for completing:
|
||||
#
|
||||
# * git-flow init and version
|
||||
# * feature, hotfix and release branches
|
||||
# * remote feature branch names (for `git-flow feature track`)
|
||||
#
|
||||
#
|
||||
# Installation
|
||||
# ------------
|
||||
#
|
||||
# To achieve git-flow completion nirvana:
|
||||
#
|
||||
# 0. Install git-completion.
|
||||
#
|
||||
# 1. Install this file. Either:
|
||||
#
|
||||
# a. Place it in a `bash-completion.d` folder:
|
||||
#
|
||||
# * /etc/bash-completion.d
|
||||
# * /usr/local/etc/bash-completion.d
|
||||
# * ~/bash-completion.d
|
||||
#
|
||||
# b. Or, copy it somewhere (e.g. ~/.git-flow-completion.sh) and put the following line in
|
||||
# your .bashrc:
|
||||
#
|
||||
# source ~/.git-flow-completion.sh
|
||||
#
|
||||
# 2. If you are using Git < 1.7.1: Edit git-completion.sh and add the following line to the giant
|
||||
# $command case in _git:
|
||||
#
|
||||
# flow) _git_flow ;;
|
||||
#
|
||||
#
|
||||
# The Fine Print
|
||||
# --------------
|
||||
#
|
||||
# Copyright (c) 2010 [Justin Hileman](http://justinhileman.com)
|
||||
#
|
||||
# Distributed under the [MIT License](http://creativecommons.org/licenses/MIT/)
|
||||
|
||||
_git_flow ()
|
||||
{
|
||||
local subcommands="init feature release hotfix"
|
||||
local subcommand="$(__git_find_subcommand "$subcommands")"
|
||||
if [ -z "$subcommand" ]; then
|
||||
__gitcomp "$subcommands"
|
||||
return
|
||||
fi
|
||||
|
||||
case "$subcommand" in
|
||||
feature)
|
||||
__git_flow_feature
|
||||
return
|
||||
;;
|
||||
release)
|
||||
__git_flow_release
|
||||
return
|
||||
;;
|
||||
hotfix)
|
||||
__git_flow_hotfix
|
||||
return
|
||||
;;
|
||||
*)
|
||||
COMPREPLY=()
|
||||
;;
|
||||
esac
|
||||
}
|
||||
|
||||
__git_flow_feature ()
|
||||
{
|
||||
local subcommands="list start finish publish track diff rebase checkout pull"
|
||||
local subcommand="$(__git_find_subcommand "$subcommands")"
|
||||
if [ -z "$subcommand" ]; then
|
||||
__gitcomp "$subcommands"
|
||||
return
|
||||
fi
|
||||
|
||||
case "$subcommand" in
|
||||
pull)
|
||||
__gitcomp "$(__git_remotes)"
|
||||
return
|
||||
;;
|
||||
checkout|finish|diff|rebase)
|
||||
__gitcomp "$(__git_flow_list_features)"
|
||||
return
|
||||
;;
|
||||
publish)
|
||||
__gitcomp "$(comm -23 <(__git_flow_list_features) <(__git_flow_list_remote_features))"
|
||||
return
|
||||
;;
|
||||
track)
|
||||
__gitcomp "$(__git_flow_list_remote_features)"
|
||||
return
|
||||
;;
|
||||
*)
|
||||
COMPREPLY=()
|
||||
;;
|
||||
esac
|
||||
}
|
||||
|
||||
__git_flow_list_features ()
|
||||
{
|
||||
git flow feature list 2> /dev/null | tr -d ' |*'
|
||||
}
|
||||
|
||||
__git_flow_list_remote_features ()
|
||||
{
|
||||
git branch -r 2> /dev/null | grep "origin/$(__git_flow_feature_prefix)" | awk '{ sub(/^origin\/$(__git_flow_feature_prefix)/, "", $1); print }'
|
||||
}
|
||||
|
||||
__git_flow_feature_prefix ()
|
||||
{
|
||||
git config gitflow.prefix.feature 2> /dev/null || echo "feature/"
|
||||
}
|
||||
|
||||
__git_flow_release ()
|
||||
{
|
||||
local subcommands="list start finish"
|
||||
local subcommand="$(__git_find_subcommand "$subcommands")"
|
||||
if [ -z "$subcommand" ]; then
|
||||
__gitcomp "$subcommands"
|
||||
return
|
||||
fi
|
||||
|
||||
case "$subcommand" in
|
||||
finish)
|
||||
__gitcomp "$(__git_flow_list_releases)"
|
||||
return
|
||||
;;
|
||||
*)
|
||||
COMPREPLY=()
|
||||
;;
|
||||
esac
|
||||
|
||||
}
|
||||
|
||||
__git_flow_list_releases ()
|
||||
{
|
||||
git flow release list 2> /dev/null
|
||||
}
|
||||
|
||||
__git_flow_hotfix ()
|
||||
{
|
||||
local subcommands="list start finish"
|
||||
local subcommand="$(__git_find_subcommand "$subcommands")"
|
||||
if [ -z "$subcommand" ]; then
|
||||
__gitcomp "$subcommands"
|
||||
return
|
||||
fi
|
||||
|
||||
case "$subcommand" in
|
||||
finish)
|
||||
__gitcomp "$(__git_flow_list_hotfixes)"
|
||||
return
|
||||
;;
|
||||
*)
|
||||
COMPREPLY=()
|
||||
;;
|
||||
esac
|
||||
}
|
||||
|
||||
__git_flow_list_hotfixes ()
|
||||
{
|
||||
git flow hotfix list 2> /dev/null
|
||||
}
|
||||
|
||||
# temporarily wrap __git_find_on_cmdline() for backwards compatibility
|
||||
if ! _command_exists __git_find_subcommand
|
||||
then
|
||||
alias __git_find_subcommand=__git_find_on_cmdline
|
||||
fi
|
||||
|
|
@ -1,511 +0,0 @@
|
|||
#!bash
|
||||
#
|
||||
# git-flow-completion
|
||||
# ===================
|
||||
#
|
||||
# Bash completion support for [git-flow (AVH Edition)](http://github.com/petervanderdoes/gitflow)
|
||||
#
|
||||
# The contained completion routines provide support for completing:
|
||||
#
|
||||
# * git-flow init and version
|
||||
# * feature, hotfix and release branches
|
||||
# * remote feature, hotfix and release branch names
|
||||
#
|
||||
#
|
||||
# Installation
|
||||
# ------------
|
||||
#
|
||||
# To achieve git-flow completion nirvana:
|
||||
#
|
||||
# 0. Install git-completion.
|
||||
#
|
||||
# 1. Install this file. Either:
|
||||
#
|
||||
# a. Place it in a `bash-completion.d` folder:
|
||||
#
|
||||
# * /etc/bash-completion.d
|
||||
# * /usr/local/etc/bash-completion.d
|
||||
# * ~/bash-completion.d
|
||||
#
|
||||
# b. Or, copy it somewhere (e.g. ~/.git-flow-completion.sh) and put the following line in
|
||||
# your .bashrc:
|
||||
#
|
||||
# source ~/.git-flow-completion.sh
|
||||
#
|
||||
# 2. If you are using Git < 1.7.1: Edit git-completion.sh and add the following line to the giant
|
||||
# $command case in _git:
|
||||
#
|
||||
# flow) _git_flow ;;
|
||||
#
|
||||
#
|
||||
# The Fine Print
|
||||
# --------------
|
||||
#
|
||||
# Author:
|
||||
# Copyright 2012-2013 Peter van der Does.
|
||||
#
|
||||
# Original Author:
|
||||
# Copyright (c) 2011 [Justin Hileman](http://justinhileman.com)
|
||||
#
|
||||
# Distributed under the [MIT License](http://creativecommons.org/licenses/MIT/)
|
||||
|
||||
__git_flow_config_file_options="
|
||||
--local --global --system --file=
|
||||
"
|
||||
|
||||
_git_flow ()
|
||||
{
|
||||
local subcommands="init feature release hotfix support help version config finish delete publish rebase"
|
||||
local subcommand="$(__git_find_on_cmdline "$subcommands")"
|
||||
if [ -z "$subcommand" ]; then
|
||||
__gitcomp "$subcommands"
|
||||
return
|
||||
fi
|
||||
|
||||
case "$subcommand" in
|
||||
init)
|
||||
__git_flow_init
|
||||
return
|
||||
;;
|
||||
feature)
|
||||
__git_flow_feature
|
||||
return
|
||||
;;
|
||||
release)
|
||||
__git_flow_release
|
||||
return
|
||||
;;
|
||||
hotfix)
|
||||
__git_flow_hotfix
|
||||
return
|
||||
;;
|
||||
support)
|
||||
__git_flow_support
|
||||
return
|
||||
;;
|
||||
config)
|
||||
__git_flow_config
|
||||
return
|
||||
;;
|
||||
*)
|
||||
COMPREPLY=()
|
||||
;;
|
||||
esac
|
||||
}
|
||||
|
||||
__git_flow_init ()
|
||||
{
|
||||
local subcommands="help"
|
||||
local subcommand="$(__git_find_on_cmdline "$subcommands")"
|
||||
if [ -z "$subcommand" ]; then
|
||||
__gitcomp "$subcommands"
|
||||
fi
|
||||
|
||||
case "$cur" in
|
||||
--*)
|
||||
__gitcomp "
|
||||
--nodefaults --defaults
|
||||
--noforce --force
|
||||
$__git_flow_config_file_options
|
||||
"
|
||||
return
|
||||
;;
|
||||
esac
|
||||
}
|
||||
|
||||
__git_flow_feature ()
|
||||
{
|
||||
local subcommands="list start finish publish track diff rebase checkout pull help delete"
|
||||
local subcommand="$(__git_find_on_cmdline "$subcommands")"
|
||||
|
||||
if [ -z "$subcommand" ]; then
|
||||
__gitcomp "$subcommands"
|
||||
return
|
||||
fi
|
||||
|
||||
case "$subcommand" in
|
||||
pull)
|
||||
__gitcomp_nl "$(__git_remotes)"
|
||||
return
|
||||
;;
|
||||
checkout)
|
||||
__gitcomp_nl "$(__git_flow_list_local_branches 'feature')"
|
||||
return
|
||||
;;
|
||||
delete)
|
||||
case "$cur" in
|
||||
--*)
|
||||
__gitcomp "
|
||||
--noforce --force
|
||||
--noremote --remote
|
||||
"
|
||||
return
|
||||
;;
|
||||
esac
|
||||
__gitcomp_nl "$(__git_flow_list_local_branches 'feature')"
|
||||
return
|
||||
;;
|
||||
finish)
|
||||
case "$cur" in
|
||||
--*)
|
||||
__gitcomp "
|
||||
--nofetch --fetch
|
||||
--norebase --rebase
|
||||
--nopreserve-merges --preserve-merges
|
||||
--nokeep --keep
|
||||
--keepremote
|
||||
--keeplocal
|
||||
--noforce_delete --force_delete
|
||||
--nosquash --squash
|
||||
--no-ff
|
||||
"
|
||||
return
|
||||
;;
|
||||
esac
|
||||
__gitcomp_nl "$(__git_flow_list_local_branches 'feature')"
|
||||
return
|
||||
;;
|
||||
diff)
|
||||
__gitcomp_nl "$(__git_flow_list_local_branches 'feature')"
|
||||
return
|
||||
;;
|
||||
rebase)
|
||||
case "$cur" in
|
||||
--*)
|
||||
__gitcomp "
|
||||
--nointeractive --interactive
|
||||
--nopreserve-merges --preserve-merges
|
||||
"
|
||||
return
|
||||
;;
|
||||
esac
|
||||
__gitcomp_nl "$(__git_flow_list_local_branches 'feature')"
|
||||
return
|
||||
;;
|
||||
publish)
|
||||
__gitcomp_nl "$(__git_flow_list_branches 'feature')"
|
||||
return
|
||||
;;
|
||||
track)
|
||||
__gitcomp_nl "$(__git_flow_list_branches 'feature')"
|
||||
return
|
||||
;;
|
||||
*)
|
||||
COMPREPLY=()
|
||||
;;
|
||||
esac
|
||||
}
|
||||
|
||||
__git_flow_release ()
|
||||
{
|
||||
local subcommands="list start finish track publish help delete"
|
||||
local subcommand="$(__git_find_on_cmdline "$subcommands")"
|
||||
if [ -z "$subcommand" ]; then
|
||||
__gitcomp "$subcommands"
|
||||
return
|
||||
fi
|
||||
|
||||
case "$subcommand" in
|
||||
finish)
|
||||
case "$cur" in
|
||||
--*)
|
||||
__gitcomp "
|
||||
--nofetch --fetch
|
||||
--sign
|
||||
--signingkey
|
||||
--message
|
||||
--nomessagefile --messagefile=
|
||||
--nopush --push
|
||||
--nokeep --keep
|
||||
--keepremote
|
||||
--keeplocal
|
||||
--noforce_delete --force_delete
|
||||
--notag --tag
|
||||
--nonobackmerge --nobackmerge
|
||||
--nosquash --squash
|
||||
"
|
||||
return
|
||||
;;
|
||||
esac
|
||||
__gitcomp_nl "$(__git_flow_list_local_branches 'release')"
|
||||
return
|
||||
;;
|
||||
rebase)
|
||||
case "$cur" in
|
||||
--*)
|
||||
__gitcomp "
|
||||
--nointeractive --interactive
|
||||
--nopreserve-merges --preserve-merges
|
||||
"
|
||||
return
|
||||
;;
|
||||
esac
|
||||
__gitcomp_nl "$(__git_flow_list_local_branches 'release')"
|
||||
return
|
||||
;;
|
||||
delete)
|
||||
case "$cur" in
|
||||
--*)
|
||||
__gitcomp "
|
||||
--noforce --force
|
||||
--noremote --remote
|
||||
"
|
||||
return
|
||||
;;
|
||||
esac
|
||||
__gitcomp_nl "$(__git_flow_list_local_branches 'release')"
|
||||
return
|
||||
;;
|
||||
publish)
|
||||
__gitcomp_nl "$(__git_flow_list_branches 'release')"
|
||||
return
|
||||
;;
|
||||
track)
|
||||
__gitcomp_nl "$(__git_flow_list_branches 'release')"
|
||||
return
|
||||
;;
|
||||
start)
|
||||
case "$cur" in
|
||||
--*)
|
||||
__gitcomp "
|
||||
--nofetch --fetch
|
||||
"
|
||||
return
|
||||
;;
|
||||
esac
|
||||
return
|
||||
;;
|
||||
*)
|
||||
COMPREPLY=()
|
||||
;;
|
||||
esac
|
||||
|
||||
}
|
||||
|
||||
__git_flow_hotfix ()
|
||||
{
|
||||
local subcommands="list start finish track publish help delete"
|
||||
local subcommand="$(__git_find_on_cmdline "$subcommands")"
|
||||
if [ -z "$subcommand" ]; then
|
||||
__gitcomp "$subcommands"
|
||||
return
|
||||
fi
|
||||
|
||||
case "$subcommand" in
|
||||
finish)
|
||||
case "$cur" in
|
||||
--*)
|
||||
__gitcomp "
|
||||
--nofetch --fetch
|
||||
--sign
|
||||
--signingkey
|
||||
--message
|
||||
--nomessagefile --messagefile=
|
||||
--nopush --push
|
||||
--nokeep --keep
|
||||
--keepremote
|
||||
--keeplocal
|
||||
--noforce_delete --force_delete
|
||||
--notag --tag
|
||||
--nonobackmerge --nobackmerge
|
||||
"
|
||||
return
|
||||
;;
|
||||
esac
|
||||
__gitcomp_nl "$(__git_flow_list_local_branches 'hotfix')"
|
||||
return
|
||||
;;
|
||||
rebase)
|
||||
case "$cur" in
|
||||
--*)
|
||||
__gitcomp "
|
||||
--nointeractive --interactive
|
||||
--nopreserve-merges --preserve-merges
|
||||
"
|
||||
return
|
||||
;;
|
||||
esac
|
||||
__gitcomp_nl "$(__git_flow_list_local_branches 'hotfix')"
|
||||
return
|
||||
;;
|
||||
delete)
|
||||
case "$cur" in
|
||||
--*)
|
||||
__gitcomp "
|
||||
--noforce --force
|
||||
--noremote --remote
|
||||
"
|
||||
return
|
||||
;;
|
||||
esac
|
||||
__gitcomp_nl "$(__git_flow_list_local_branches 'hotfix')"
|
||||
return
|
||||
;;
|
||||
publish)
|
||||
__gitcomp_nl "$(__git_flow_list_branches 'hotfix')"
|
||||
return
|
||||
;;
|
||||
track)
|
||||
__gitcomp_nl "$(__git_flow_list_branches 'hotfix')"
|
||||
return
|
||||
;;
|
||||
start)
|
||||
case "$cur" in
|
||||
--*)
|
||||
__gitcomp "
|
||||
--nofetch --fetch
|
||||
"
|
||||
return
|
||||
;;
|
||||
esac
|
||||
return
|
||||
;;
|
||||
*)
|
||||
COMPREPLY=()
|
||||
;;
|
||||
esac
|
||||
}
|
||||
|
||||
__git_flow_support ()
|
||||
{
|
||||
local subcommands="list start help"
|
||||
local subcommand="$(__git_find_on_cmdline "$subcommands")"
|
||||
if [ -z "$subcommand" ]; then
|
||||
__gitcomp "$subcommands"
|
||||
return
|
||||
fi
|
||||
|
||||
case "$subcommand" in
|
||||
start)
|
||||
case "$cur" in
|
||||
--*)
|
||||
__gitcomp "
|
||||
--nofetch --fetch
|
||||
"
|
||||
return
|
||||
;;
|
||||
esac
|
||||
return
|
||||
;;
|
||||
rebase)
|
||||
case "$cur" in
|
||||
--*)
|
||||
__gitcomp "
|
||||
--nointeractive --interactive
|
||||
--nopreserve-merges --preserve-merges
|
||||
"
|
||||
return
|
||||
;;
|
||||
esac
|
||||
__gitcomp_nl "$(__git_flow_list_local_branches 'support')"
|
||||
return
|
||||
;;
|
||||
*)
|
||||
COMPREPLY=()
|
||||
;;
|
||||
esac
|
||||
}
|
||||
|
||||
__git_flow_config ()
|
||||
{
|
||||
local subcommands="list set base"
|
||||
local subcommand="$(__git_find_on_cmdline "$subcommands")"
|
||||
if [ -z "$subcommand" ]; then
|
||||
__gitcomp "$subcommands"
|
||||
return
|
||||
fi
|
||||
|
||||
case "$subcommand" in
|
||||
set)
|
||||
case "$cur" in
|
||||
--*)
|
||||
__gitcomp "
|
||||
$__git_flow_config_file_options
|
||||
"
|
||||
return
|
||||
;;
|
||||
esac
|
||||
__gitcomp "
|
||||
master develop
|
||||
feature hotfix release support
|
||||
versiontagprefix
|
||||
"
|
||||
return
|
||||
;;
|
||||
base)
|
||||
case "$cur" in
|
||||
--*)
|
||||
__gitcomp "
|
||||
set get
|
||||
"
|
||||
return
|
||||
;;
|
||||
esac
|
||||
__gitcomp_nl "$(__git_flow_list_local_branches)"
|
||||
return
|
||||
;;
|
||||
*)
|
||||
COMPREPLY=()
|
||||
;;
|
||||
esac
|
||||
}
|
||||
|
||||
__git_flow_prefix ()
|
||||
{
|
||||
case "$1" in
|
||||
feature|release|hotfix|support)
|
||||
git config "gitflow.prefix.$1" 2> /dev/null || echo "$1/"
|
||||
return
|
||||
;;
|
||||
esac
|
||||
}
|
||||
|
||||
__git_flow_list_local_branches ()
|
||||
{
|
||||
if [ -n "$1" ]; then
|
||||
local prefix="$(__git_flow_prefix $1)"
|
||||
git for-each-ref --shell --format="ref=%(refname:short)" refs/heads/$prefix | \
|
||||
while read -r entry; do
|
||||
eval "$entry"
|
||||
ref="${ref#$prefix}"
|
||||
echo "$ref"
|
||||
done | sort
|
||||
else
|
||||
git for-each-ref --format="ref=%(refname:short)" refs/heads/ | sort
|
||||
|
||||
fi
|
||||
}
|
||||
|
||||
__git_flow_list_remote_branches ()
|
||||
{
|
||||
local prefix="$(__git_flow_prefix $1)"
|
||||
local origin="$(git config gitflow.origin 2> /dev/null || echo "origin")"
|
||||
git for-each-ref --shell --format='%(refname:short)' refs/remotes/$origin/$prefix | \
|
||||
while read -r entry; do
|
||||
eval "$entry"
|
||||
ref="${ref##$prefix}"
|
||||
echo "$ref"
|
||||
done | sort
|
||||
}
|
||||
|
||||
__git_flow_list_branches ()
|
||||
{
|
||||
local origin="$(git config gitflow.origin 2> /dev/null || echo "origin")"
|
||||
if [ -n "$1" ]; then
|
||||
local prefix="$(__git_flow_prefix $1)"
|
||||
git for-each-ref --shell --format="ref=%(refname:short)" refs/heads/$prefix refs/remotes/$origin/$prefix | \
|
||||
while read -r entry; do
|
||||
eval "$entry"
|
||||
ref="${ref##$prefix}"
|
||||
echo "$ref"
|
||||
done | sort
|
||||
else
|
||||
git for-each-ref --format="%(refname:short)" refs/heads/ refs/remotes/$origin | sort
|
||||
fi
|
||||
}
|
||||
|
||||
# alias __git_find_on_cmdline for backwards compatibility
|
||||
if ! _command_exists __git_find_on_cmdline
|
||||
then
|
||||
alias __git_find_on_cmdline=__git_find_subcommand
|
||||
fi
|
||||
|
|
@ -1,9 +0,0 @@
|
|||
# shellcheck shell=bash
|
||||
cite "about-completion"
|
||||
about-completion "GitHub CLI completion"
|
||||
|
||||
if _binary_exists gh; then
|
||||
# If gh already completed, stop
|
||||
_completion_exists gh && return
|
||||
eval "$(gh completion --shell=bash)"
|
||||
fi
|
||||
|
|
@ -1,15 +0,0 @@
|
|||
# shellcheck shell=bash
|
||||
about-completion "completion for go command using gocomplete"
|
||||
|
||||
# bash completion for go tool
|
||||
# https://github.com/posener/complete
|
||||
|
||||
# Test `go version` because goenv creates shim scripts that will be found in PATH
|
||||
# but do not always resolve to a working install.
|
||||
if _command_exists go && go version &> /dev/null; then
|
||||
# Same idea here, but no need to test a subcommand
|
||||
if _command_exists gocomplete && gocomplete &> /dev/null; then
|
||||
# finally, apply completion
|
||||
complete -C gocomplete go
|
||||
fi
|
||||
fi
|
||||
|
|
@ -1,318 +0,0 @@
|
|||
# shellcheck shell=bash
|
||||
|
||||
# Copyright (c) 2017 Eric Wendelin
|
||||
|
||||
# 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.
|
||||
|
||||
# Bash breaks words on : by default. Subproject tasks have ':'
|
||||
# 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-init-cache-dir() {
|
||||
cache_dir="$HOME/.gradle/completion"
|
||||
mkdir -p $cache_dir
|
||||
}
|
||||
|
||||
__gradle-set-build-file() {
|
||||
# Look for default build script in the settings file (settings.gradle by default)
|
||||
# Otherwise, default is the file 'build.gradle' in the current directory.
|
||||
gradle_build_file="$project_root_dir/build.gradle"
|
||||
if [[ -f "$project_root_dir/settings.gradle" ]]; then
|
||||
local build_file_name=$(grep "^rootProject\.buildFileName" "$project_root_dir/settings.gradle" | \
|
||||
sed -n -e "s/rootProject\.buildFileName = [\'\"]\(.*\)[\'\"]/\1/p")
|
||||
gradle_build_file="$project_root_dir/${build_file_name:-build.gradle}"
|
||||
fi
|
||||
}
|
||||
|
||||
__gradle-set-cache-name() {
|
||||
# Cache name is constructed from the absolute path of the build file.
|
||||
cache_name=$(echo $gradle_build_file | sed -e 's/\//_/g')
|
||||
}
|
||||
|
||||
__gradle-set-files-checksum() {
|
||||
# Cache MD5 sum of all Gradle scripts and modified timestamps
|
||||
if _command_exists md5; then
|
||||
gradle_files_checksum=$(md5 -q -s "$(cat "$cache_dir/$cache_name" | xargs ls -o 2>/dev/null)")
|
||||
elif _command_exists md5sum; 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"
|
||||
fi
|
||||
}
|
||||
|
||||
__gradle-generate-script-cache() {
|
||||
# Invalidate cache after 3 weeks by default
|
||||
local cache_ttl_mins=${GRADLE_CACHE_TTL_MINUTES:-30240}
|
||||
local script_exclude_pattern=${GRADLE_COMPLETION_EXCLUDE_PATTERN:-"/(build|integTest|out)/"}
|
||||
|
||||
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")
|
||||
printf "%s\n" "${gradle_build_scripts[@]}" > $cache_dir/$cache_name
|
||||
fi
|
||||
}
|
||||
|
||||
__gradle-long-options() {
|
||||
local args="--build-cache - Enables the Gradle build cache
|
||||
--build-file - Specifies the build file
|
||||
--configure-on-demand - Only relevant projects are configured
|
||||
--console - Type of console output to generate (plain auto rich)
|
||||
--continue - Continues task execution after a task failure
|
||||
--continuous - Continuous mode. Automatically re-run build after changes
|
||||
--daemon - Use the Gradle Daemon
|
||||
--debug - Log at the debug level
|
||||
--dry-run - Runs the build with all task actions disabled
|
||||
--exclude-task - Specify a task to be excluded
|
||||
--full-stacktrace - Print out the full (very verbose) stacktrace
|
||||
--gradle-user-home - Specifies the Gradle user home directory
|
||||
--gui - Launches the Gradle GUI app (Deprecated)
|
||||
--help - Shows a help message
|
||||
--include-build - Run the build as a composite, including the specified build
|
||||
--info - Set log level to INFO
|
||||
--init-script - Specifies an initialization script
|
||||
--max-workers - Set the maximum number of workers that Gradle may use
|
||||
--no-build-cache - Do not use the Gradle build cache
|
||||
--no-daemon - Do not use the Gradle Daemon
|
||||
--no-rebuild - Do not rebuild project dependencies
|
||||
--no-scan - Do not create a build scan
|
||||
--no-search-upwards - Do not search in parent directories for a settings.gradle
|
||||
--offline - Build without accessing network resources
|
||||
--parallel - Build projects in parallel
|
||||
--profile - Profile build time and create report
|
||||
--project-cache-dir - Specifies the project-specific cache directory
|
||||
--project-dir - Specifies the start directory for Gradle
|
||||
--project-prop - Sets a project property of the root project
|
||||
--quiet - Log errors only
|
||||
--recompile-scripts - Forces scripts to be recompiled, bypassing caching
|
||||
--refresh-dependencies - Refresh the state of dependencies
|
||||
--rerun-tasks - Specifies that any task optimization is ignored
|
||||
--scan - Create a build scan
|
||||
--settings-file - Specifies the settings file
|
||||
--stacktrace - Print out the stacktrace also for user exceptions
|
||||
--status - Print Gradle Daemon status
|
||||
--stop - Stop all Gradle Daemons
|
||||
--system-prop - Set a system property
|
||||
--version - Prints Gradle version info
|
||||
--warn - Log warnings and errors only"
|
||||
COMPREPLY=( $(compgen -W "$args" -- "${COMP_WORDS[COMP_CWORD]}") )
|
||||
}
|
||||
|
||||
__gradle-properties() {
|
||||
local args="-Dorg.gradle.cache.reserved.mb= - Reserve Gradle Daemon memory for operations
|
||||
-Dorg.gradle.caching= - Set true to enable Gradle build cache
|
||||
-Dorg.gradle.daemon.debug= - Set true to debug Gradle Daemon
|
||||
-Dorg.gradle.daemon.idletimeout= - Kill Gradle Daemon after # idle millis
|
||||
-Dorg.gradle.debug= - Set true to debug Gradle Client
|
||||
-Dorg.gradle.jvmargs= - Set JVM arguments
|
||||
-Dorg.gradle.java.home= - Set JDK home dir
|
||||
-Dorg.gradle.logging.level= - Set default Gradle log level (quiet warn lifecycle info debug)
|
||||
-Dorg.gradle.parallel= - Set true to enable parallel project builds (incubating)
|
||||
-Dorg.gradle.parallel.intra= - Set true to enable intra-project parallel builds (incubating)
|
||||
-Dorg.gradle.workers.max= - Set the number of workers Gradle is allowed to use"
|
||||
COMPREPLY=( $(compgen -W "$args" -- "${COMP_WORDS[COMP_CWORD]}") )
|
||||
return 0
|
||||
}
|
||||
|
||||
__gradle-short-options() {
|
||||
local args="-? - Shows a help message
|
||||
-a - Do not rebuild project dependencies
|
||||
-b - Specifies the build file
|
||||
-c - Specifies the settings file
|
||||
-d - Log at the debug level
|
||||
-g - Specifies the Gradle user home directory
|
||||
-h - Shows a help message
|
||||
-i - Set log level to INFO
|
||||
-m - Runs the build with all task actions disabled
|
||||
-p - Specifies the start directory for Gradle
|
||||
-q - Log errors only
|
||||
-s - Print out the stacktrace also for user exceptions
|
||||
-t - Continuous mode. Automatically re-run build after changes
|
||||
-u - Do not search in parent directories for a settings.gradle
|
||||
-v - Prints Gradle version info
|
||||
-w - Log warnings and errors only
|
||||
-x - Specify a task to be excluded
|
||||
-D - Set a system property
|
||||
-I - Specifies an initialization script
|
||||
-P - Sets a project property of the root project
|
||||
-S - Print out the full (very verbose) stacktrace"
|
||||
COMPREPLY=( $(compgen -W "$args" -- "${COMP_WORDS[COMP_CWORD]}") )
|
||||
}
|
||||
|
||||
__gradle-notify-tasks-cache-build() {
|
||||
# Notify user of cache rebuild
|
||||
echo -e " (Building completion cache. Please wait)\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\c"
|
||||
__gradle-generate-tasks-cache
|
||||
# Remove "please wait" message by writing a bunch of spaces then moving back to the left
|
||||
echo -e " \b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\c"
|
||||
}
|
||||
|
||||
__gradle-generate-tasks-cache() {
|
||||
__gradle-set-files-checksum
|
||||
|
||||
# Use Gradle wrapper when it exists.
|
||||
local gradle_cmd="gradle"
|
||||
if [[ -x "$project_root_dir/gradlew" ]]; then
|
||||
gradle_cmd="$project_root_dir/gradlew"
|
||||
fi
|
||||
|
||||
# Run gradle to retrieve possible tasks and cache.
|
||||
# Reuse Gradle Daemon if IDLE but don't start a new one.
|
||||
local gradle_tasks_output
|
||||
if [[ ! -z "$($gradle_cmd --status 2>/dev/null | grep IDLE)" ]]; then
|
||||
gradle_tasks_output="$($gradle_cmd -b $gradle_build_file --daemon -q tasks --all)"
|
||||
else
|
||||
gradle_tasks_output="$($gradle_cmd -b $gradle_build_file --no-daemon -q tasks --all)"
|
||||
fi
|
||||
local output_line
|
||||
local task_description
|
||||
local -a gradle_all_tasks=()
|
||||
local -a root_tasks=()
|
||||
local -a subproject_tasks=()
|
||||
for output_line in $gradle_tasks_output; do
|
||||
if [[ $output_line =~ ^([[:lower:]][[:alnum:][:punct:]]*)([[:space:]]-[[:space:]]([[:print:]]*))? ]]; then
|
||||
task_name="${BASH_REMATCH[1]}"
|
||||
task_description="${BASH_REMATCH[3]}"
|
||||
gradle_all_tasks+=( "$task_name - $task_description" )
|
||||
# Completion for subproject tasks with ':' prefix
|
||||
if [[ $task_name =~ ^([[:alnum:][:punct:]]+):([[:alnum:]]+) ]]; then
|
||||
gradle_all_tasks+=( ":$task_name - $task_description" )
|
||||
subproject_tasks+=( "${BASH_REMATCH[2]}" )
|
||||
else
|
||||
root_tasks+=( "$task_name" )
|
||||
fi
|
||||
fi
|
||||
done
|
||||
|
||||
# subproject tasks can be referenced implicitly from root project
|
||||
if [[ $GRADLE_COMPLETION_UNQUALIFIED_TASKS == "true" ]]; then
|
||||
local -a implicit_tasks=()
|
||||
implicit_tasks=( $(comm -23 <(printf "%s\n" "${subproject_tasks[@]}" | sort) <(printf "%s\n" "${root_tasks[@]}" | sort)) )
|
||||
for task in $(printf "%s\n" "${implicit_tasks[@]}"); do
|
||||
gradle_all_tasks+=( $task )
|
||||
done
|
||||
fi
|
||||
|
||||
printf "%s\n" "${gradle_all_tasks[@]}" > $cache_dir/$gradle_files_checksum
|
||||
echo $gradle_files_checksum > $cache_dir/$cache_name.md5
|
||||
}
|
||||
|
||||
__gradle-completion-init() {
|
||||
local cache_dir cache_name gradle_build_file gradle_files_checksum project_root_dir
|
||||
|
||||
local OLDIFS="$IFS"
|
||||
local IFS=$'\n'
|
||||
|
||||
__gradle-init-cache-dir
|
||||
__gradle-set-project-root-dir
|
||||
__gradle-set-build-file
|
||||
if [[ -f $gradle_build_file ]]; then
|
||||
__gradle-set-cache-name
|
||||
__gradle-generate-script-cache
|
||||
__gradle-set-files-checksum
|
||||
__gradle-notify-tasks-cache-build
|
||||
fi
|
||||
|
||||
IFS="$OLDIFS"
|
||||
|
||||
return 0
|
||||
}
|
||||
|
||||
_gradle() {
|
||||
local cache_dir cache_name gradle_build_file gradle_files_checksum project_root_dir
|
||||
local cur=${COMP_WORDS[COMP_CWORD]}
|
||||
# Set bash internal field separator to '\n'
|
||||
# This allows us to provide descriptions for options and tasks
|
||||
local OLDIFS="$IFS"
|
||||
local IFS=$'\n'
|
||||
|
||||
if [[ ${cur} == --* ]]; then
|
||||
__gradle-long-options
|
||||
elif [[ ${cur} == -D* ]]; then
|
||||
__gradle-properties
|
||||
elif [[ ${cur} == -* ]]; then
|
||||
__gradle-short-options
|
||||
else
|
||||
__gradle-init-cache-dir
|
||||
__gradle-set-project-root-dir
|
||||
__gradle-set-build-file
|
||||
if [[ -f $gradle_build_file ]]; then
|
||||
__gradle-set-cache-name
|
||||
__gradle-generate-script-cache
|
||||
__gradle-set-files-checksum
|
||||
|
||||
# The cache key is md5 sum of all gradle scripts, so it's valid if it exists.
|
||||
if [[ -f $cache_dir/$cache_name.md5 ]]; then
|
||||
local cached_checksum="$(cat $cache_dir/$cache_name.md5)"
|
||||
local -a cached_tasks
|
||||
if [[ -z $cur ]]; then
|
||||
cached_tasks=( $(cat $cache_dir/$cached_checksum) )
|
||||
else
|
||||
cached_tasks=( $(grep "^$cur" $cache_dir/$cached_checksum) )
|
||||
fi
|
||||
COMPREPLY=( $(compgen -W "${cached_tasks[*]}" -- "$cur") )
|
||||
else
|
||||
__gradle-notify-tasks-cache-build
|
||||
fi
|
||||
|
||||
# Regenerate tasks cache in the background
|
||||
if [[ $gradle_files_checksum != "$(cat $cache_dir/$cache_name.md5)" || ! -f $cache_dir/$gradle_files_checksum ]]; then
|
||||
$(__gradle-generate-tasks-cache 1>&2 2>/dev/null &)
|
||||
fi
|
||||
else
|
||||
# Default tasks available outside Gradle projects
|
||||
local args="buildEnvironment - Displays all buildscript dependencies declared in root project.
|
||||
components - Displays the components produced by root project.
|
||||
dependencies - Displays all dependencies declared in root project.
|
||||
dependencyInsight - Displays the insight into a specific dependency in root project.
|
||||
dependentComponents - Displays the dependent components of components in root project.
|
||||
help - Displays a help message.
|
||||
init - Initializes a new Gradle build.
|
||||
model - Displays the configuration model of root project.
|
||||
projects - Displays the sub-projects of root project.
|
||||
properties - Displays the properties of root project.
|
||||
tasks - Displays the tasks runnable from root project.
|
||||
wrapper - Generates Gradle wrapper files."
|
||||
COMPREPLY=( $(compgen -W "$args" -- "${COMP_WORDS[COMP_CWORD]}") )
|
||||
fi
|
||||
fi
|
||||
|
||||
IFS="$OLDIFS"
|
||||
|
||||
# Remove description ("[:space:]" and after) if only one possibility
|
||||
if [[ ${#COMPREPLY[*]} -eq 1 ]]; then
|
||||
COMPREPLY=( ${COMPREPLY[0]%% *} )
|
||||
fi
|
||||
|
||||
return 0
|
||||
}
|
||||
complete -F _gradle gradle
|
||||
complete -F _gradle gradle.bat
|
||||
complete -F _gradle gradlew
|
||||
complete -F _gradle gradlew.bat
|
||||
complete -F _gradle ./gradlew
|
||||
complete -F _gradle ./gradlew.bat
|
||||
|
||||
if hash gw 2>/dev/null || alias gw >/dev/null 2>&1; then
|
||||
complete -F _gradle gw
|
||||
fi
|
||||
|
|
@ -1,75 +0,0 @@
|
|||
#!/bin/bash
|
||||
|
||||
# grunt-cli
|
||||
# http://gruntjs.com/
|
||||
#
|
||||
# Copyright jQuery Foundation and other contributors, https://jquery.org/
|
||||
|
||||
# This software consists of voluntary contributions made by many
|
||||
# individuals. For exact contribution history, see the revision history
|
||||
# available at https://github.com/gruntjs/grunt .
|
||||
|
||||
# The following license applies to all parts of this software except as
|
||||
# documented below:
|
||||
|
||||
# ====
|
||||
|
||||
# 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.
|
||||
|
||||
# Usage:
|
||||
#
|
||||
# To enable bash <tab> completion for grunt, add the following line (minus the
|
||||
# leading #, which is the bash comment character) to your ~/.bashrc file:
|
||||
#
|
||||
# eval "$(grunt --completion=bash)"
|
||||
|
||||
# Search the current directory and all parent directories for a gruntfile.
|
||||
function _grunt_gruntfile() {
|
||||
local curpath="$PWD"
|
||||
while [[ "$curpath" ]]; do
|
||||
for gruntfile in "$curpath/"{G,g}runtfile.{js,coffee}; do
|
||||
if [[ -e "$gruntfile" ]]; then
|
||||
echo "$gruntfile"
|
||||
return
|
||||
fi
|
||||
done
|
||||
curpath="${curpath%/*}"
|
||||
done
|
||||
return 1
|
||||
}
|
||||
|
||||
# Enable bash autocompletion.
|
||||
function _grunt_completions() {
|
||||
# The currently-being-completed word.
|
||||
local cur="${COMP_WORDS[COMP_CWORD]}"
|
||||
# The current gruntfile, if it exists.
|
||||
local gruntfile="$(_grunt_gruntfile)"
|
||||
# The current grunt version, available tasks, options, etc.
|
||||
local gruntinfo="$(grunt --version --verbose 2>/dev/null)"
|
||||
# Options and tasks.
|
||||
local opts="$(echo "$gruntinfo" | awk '/Available options: / {$1=$2=""; print $0}')"
|
||||
local compls="$(echo "$gruntinfo" | awk '/Available tasks: / {$1=$2=""; print $0}')"
|
||||
# Only add -- or - options if the user has started typing -
|
||||
[[ "$cur" == -* ]] && compls="$compls $opts"
|
||||
# Tell complete what stuff to show.
|
||||
COMPREPLY=($(compgen -W "$compls" -- "$cur"))
|
||||
}
|
||||
|
||||
complete -o default -F _grunt_completions grunt
|
||||
|
|
@ -1,50 +0,0 @@
|
|||
#!/bin/bash
|
||||
# Borrowed from grunt-cli
|
||||
# http://gruntjs.com/
|
||||
#
|
||||
# Copyright jQuery Foundation and other contributors, https://jquery.org/
|
||||
|
||||
# This software consists of voluntary contributions made by many
|
||||
# individuals. For exact contribution history, see the revision history
|
||||
# available at https://github.com/gruntjs/grunt .
|
||||
|
||||
# The following license applies to all parts of this software except as
|
||||
# documented below:
|
||||
|
||||
# ====
|
||||
|
||||
# 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.
|
||||
|
||||
# Usage:
|
||||
#
|
||||
# To enable bash <tab> completion for gulp, add the following line (minus the
|
||||
# leading #, which is the bash comment character) to your ~/.bashrc file:
|
||||
#
|
||||
# eval "$(gulp --completion=bash)"
|
||||
# Enable bash autocompletion.
|
||||
function _gulp_completions() {
|
||||
# The currently-being-completed word.
|
||||
local cur="${COMP_WORDS[COMP_CWORD]}"
|
||||
#Grab tasks
|
||||
local compls=$(gulp --tasks-simple)
|
||||
# Tell complete what stuff to show.
|
||||
COMPREPLY=($(compgen -W "$compls" -- "$cur"))
|
||||
}
|
||||
complete -o default -F _gulp_completions gulp
|
||||
|
|
@ -1,7 +0,0 @@
|
|||
# shellcheck shell=bash
|
||||
cite "about-completion"
|
||||
about-completion "helm (Kubernetes Package Manager) completion"
|
||||
|
||||
if _command_exists helm; then
|
||||
eval "$(helm completion bash)"
|
||||
fi
|
||||
Some files were not shown because too many files have changed in this diff Show More
Loading…
Reference in New Issue