Compare commits
No commits in common. "master" and "v2.1.0" have entirely different histories.
|
|
@ -13,24 +13,18 @@ insert_final_newline = true
|
||||||
trim_trailing_whitespace = false
|
trim_trailing_whitespace = false
|
||||||
|
|
||||||
[.git*]
|
[.git*]
|
||||||
indent_size = tab
|
|
||||||
indent_style = tab
|
indent_style = tab
|
||||||
|
|
||||||
[{**.*sh,test/run,**.bats}]
|
[{**.*sh,test/run}]
|
||||||
indent_size = tab
|
|
||||||
indent_style = tab
|
indent_style = tab
|
||||||
|
indent_size = 4
|
||||||
|
|
||||||
shell_variant = bash
|
shell_variant = bash
|
||||||
binary_next_line = true # like -bn
|
binary_next_line = true # like -bn
|
||||||
switch_case_indent = true # like -ci
|
switch_case_indent = true # like -ci
|
||||||
space_redirects = true # like -sr
|
space_redirects = true # like -sr
|
||||||
keep_padding = false # like -kp
|
keep_padding = false # like -kp
|
||||||
end_of_line = lf
|
end_of_line = lf
|
||||||
charset = utf-8
|
charset = utf-8
|
||||||
trim_trailing_whitespace = true
|
trim_trailing_whitespace = true
|
||||||
insert_final_newline = true
|
insert_final_newline = true
|
||||||
|
|
||||||
[**.bats]
|
|
||||||
indent_size = tab
|
|
||||||
indent_style = tab
|
|
||||||
shell_variant = bats
|
|
||||||
|
|
|
||||||
|
|
@ -0,0 +1,46 @@
|
||||||
|
---
|
||||||
|
name: Bug report
|
||||||
|
about: Create a bug report to help us improve
|
||||||
|
title: ''
|
||||||
|
labels: bug:general
|
||||||
|
assignees: ''
|
||||||
|
|
||||||
|
---
|
||||||
|
|
||||||
|
<!--- Provide a general summary of the issue in the Title above -->
|
||||||
|
|
||||||
|
## Expected Behavior
|
||||||
|
<!--- Tell us what should happen -->
|
||||||
|
|
||||||
|
## Current Behavior
|
||||||
|
<!--- Tell us what happens instead of the expected behavior -->
|
||||||
|
|
||||||
|
## Possible Solution
|
||||||
|
<!--- Not obligatory, but suggest a fix/reason for the bug, -->
|
||||||
|
|
||||||
|
## Context
|
||||||
|
<!--- How has this issue affected you? What are you trying to accomplish? -->
|
||||||
|
<!--- Providing context helps us come up with a solution that is most useful in the real world -->
|
||||||
|
|
||||||
|
## Steps to Reproduce
|
||||||
|
<!--- Provide a link to a live example, or an unambiguous set of steps to -->
|
||||||
|
<!--- reproduce this bug. Include code to reproduce, if relevant -->
|
||||||
|
1.
|
||||||
|
2.
|
||||||
|
3.
|
||||||
|
4.
|
||||||
|
|
||||||
|
## Your Environment
|
||||||
|
<!--- Include as many relevant details about the environment you experienced the bug in -->
|
||||||
|
* Bash-it version used:
|
||||||
|
* List of enabled plugins, themes and aliases (use ``bash-it show (plugins/themes/aliases)``):
|
||||||
|
* ``bash-it doctor`` output:
|
||||||
|
* Bash version:
|
||||||
|
* Operating System and version:
|
||||||
|
|
||||||
|
## Your Bash Config File
|
||||||
|
<!--- Please paste here your bash config file (.bashrc/.bash_profile) -->
|
||||||
|
<!--- This will help us debug and locate the problem -->
|
||||||
|
```bash
|
||||||
|
# Your bash config file should be here
|
||||||
|
```
|
||||||
|
|
@ -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
|
|
||||||
|
|
@ -0,0 +1,23 @@
|
||||||
|
---
|
||||||
|
name: Feature request
|
||||||
|
about: Suggest an idea for this project
|
||||||
|
title: ''
|
||||||
|
labels: feature request
|
||||||
|
assignees: ''
|
||||||
|
|
||||||
|
---
|
||||||
|
|
||||||
|
<!--- Provide a general summary of the issue in the Title above -->
|
||||||
|
|
||||||
|
## Expected Behavior
|
||||||
|
<!--- Tell us how your feature should work -->
|
||||||
|
|
||||||
|
## Current Behavior
|
||||||
|
<!--- Explain the difference your feature will have from current behavior -->
|
||||||
|
|
||||||
|
## Possible Solution
|
||||||
|
<!--- Not obligatory, but suggest ideas on how to implement the addition or change -->
|
||||||
|
|
||||||
|
## Context
|
||||||
|
<!--- How has this issue affected you? What are you trying to accomplish? -->
|
||||||
|
<!--- Providing context helps us come up with a solution that is most useful in the real world -->
|
||||||
|
|
@ -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,13 +1,17 @@
|
||||||
name: CI
|
name: CI
|
||||||
|
|
||||||
# Triggers the workflow on push or pull request events
|
# Triggers the workflow on push or pull request events
|
||||||
on: [push, pull_request]
|
on:
|
||||||
|
push:
|
||||||
|
branches: [ master ]
|
||||||
|
pull_request:
|
||||||
|
branches: [ master ]
|
||||||
|
|
||||||
jobs:
|
jobs:
|
||||||
bats-test:
|
bats-test:
|
||||||
strategy:
|
strategy:
|
||||||
matrix:
|
matrix:
|
||||||
os: [ubuntu-20.04, ubuntu-22.04, macos-12, macos-11]
|
os: [ubuntu-20.04, ubuntu-18.04, ubuntu-16.04, macos-10.15]
|
||||||
|
|
||||||
runs-on: ${{ matrix.os }}
|
runs-on: ${{ matrix.os }}
|
||||||
|
|
||||||
|
|
@ -16,9 +20,6 @@ jobs:
|
||||||
- name: Install greadlink
|
- name: Install greadlink
|
||||||
if: startsWith(runner.os, 'macOS')
|
if: startsWith(runner.os, 'macOS')
|
||||||
run: brew install coreutils
|
run: brew install coreutils
|
||||||
- name: Install parallel
|
|
||||||
if: startsWith(runner.os, 'macOS')
|
|
||||||
run: brew install parallel
|
|
||||||
- name: Test code
|
- name: Test code
|
||||||
run: test/run
|
run: test/run
|
||||||
|
|
||||||
|
|
@ -44,22 +45,15 @@ jobs:
|
||||||
- name: Set up Go
|
- name: Set up Go
|
||||||
uses: actions/setup-go@v2
|
uses: actions/setup-go@v2
|
||||||
with:
|
with:
|
||||||
go-version: 1.17
|
go-version: 1.14
|
||||||
- name: Set up Python
|
- name: Set up Python
|
||||||
uses: actions/setup-python@v2
|
uses: actions/setup-python@v2
|
||||||
with:
|
with:
|
||||||
python-version: 3.8
|
python-version: 3.8
|
||||||
# - name: Update APT Package Lists
|
|
||||||
# run: sudo apt-get update
|
|
||||||
- name: Install shfmt
|
- name: Install shfmt
|
||||||
run: GO111MODULE=on go get mvdan.cc/sh/v3/cmd/shfmt
|
run: GO111MODULE=on go get mvdan.cc/sh/v3/cmd/shfmt
|
||||||
- name: Install shellcheck
|
- name: Install shellcheck
|
||||||
env:
|
run: brew install shellcheck
|
||||||
scversion: stable # Or latest, vxx, etc
|
|
||||||
run: |
|
|
||||||
wget -qO- "https://github.com/koalaman/shellcheck/releases/download/${scversion?}/shellcheck-${scversion?}.linux.x86_64.tar.xz" | tar -xJv "shellcheck-${scversion}/shellcheck"
|
|
||||||
sudo cp "shellcheck-${scversion}/shellcheck" /usr/bin/
|
|
||||||
shellcheck --version
|
|
||||||
- name: Install pre-commit
|
- name: Install pre-commit
|
||||||
run: python3 -m pip install -r test/lint-requirements.txt
|
run: python3 -m pip install -r test/lint-requirements.txt
|
||||||
- name: Run lint
|
- name: Run lint
|
||||||
|
|
|
||||||
|
|
@ -17,8 +17,3 @@ bats
|
||||||
enabled/*
|
enabled/*
|
||||||
/enabled
|
/enabled
|
||||||
tmp/
|
tmp/
|
||||||
|
|
||||||
# Do not save profiles
|
|
||||||
profiles/*
|
|
||||||
# apart from the default one
|
|
||||||
!profiles/default.bash_it
|
|
||||||
|
|
|
||||||
|
|
@ -15,7 +15,7 @@ repos:
|
||||||
- id: mixed-line-ending
|
- id: mixed-line-ending
|
||||||
- id: check-added-large-files
|
- id: check-added-large-files
|
||||||
- repo: https://github.com/jumanjihouse/pre-commit-hooks
|
- repo: https://github.com/jumanjihouse/pre-commit-hooks
|
||||||
rev: 2.1.5
|
rev: 2.1.4
|
||||||
hooks:
|
hooks:
|
||||||
- id: git-check # Configure in .gitattributes
|
- id: git-check # Configure in .gitattributes
|
||||||
- id: shellcheck
|
- id: shellcheck
|
||||||
|
|
@ -43,8 +43,3 @@ repos:
|
||||||
language: system
|
language: system
|
||||||
files: "\\.bash$"
|
files: "\\.bash$"
|
||||||
types: [file]
|
types: [file]
|
||||||
- id: clean-files-txt
|
|
||||||
name: Check that clean_files.txt is sorted alphabetically.
|
|
||||||
entry: ./hooks/check-clean-files-txt.sh
|
|
||||||
language: system
|
|
||||||
files: clean_files.txt
|
|
||||||
|
|
|
||||||
|
|
@ -0,0 +1,6 @@
|
||||||
|
# We use colors and not assigned
|
||||||
|
disable=SC2154
|
||||||
|
# Hard to fix
|
||||||
|
disable=SC2155
|
||||||
|
# shellcheck is wrong on some
|
||||||
|
disable=SC2034
|
||||||
2
LICENSE
2
LICENSE
|
|
@ -1,6 +1,6 @@
|
||||||
MIT License
|
MIT License
|
||||||
|
|
||||||
Copyright (c) 2020-2021 Bash-it
|
Copyright (c) 2020 Bash-it
|
||||||
|
|
||||||
Permission is hereby granted, free of charge, to any person obtaining a copy
|
Permission is hereby granted, free of charge, to any person obtaining a copy
|
||||||
of this software and associated documentation files (the "Software"), to deal
|
of this software and associated documentation files (the "Software"), to deal
|
||||||
|
|
|
||||||
|
|
@ -1,4 +1,4 @@
|
||||||
# shellcheck shell=bash
|
cite 'about-alias'
|
||||||
about-alias 'the silver searcher (ag) aliases'
|
about-alias 'the silver searcher (ag) aliases'
|
||||||
|
|
||||||
## Summary for args to less:
|
## Summary for args to less:
|
||||||
|
|
|
||||||
|
|
@ -1,4 +1,4 @@
|
||||||
# shellcheck shell=bash
|
cite 'about-alias'
|
||||||
about-alias 'ansible abbreviations'
|
about-alias 'ansible abbreviations'
|
||||||
|
|
||||||
alias ans=ansible
|
alias ans=ansible
|
||||||
|
|
|
||||||
|
|
@ -1,4 +1,4 @@
|
||||||
# shellcheck shell=bash
|
#!/bin/bash
|
||||||
#
|
#
|
||||||
# -binaryanomaly
|
# -binaryanomaly
|
||||||
|
|
||||||
|
|
@ -6,8 +6,9 @@ cite 'about-alias'
|
||||||
about-alias 'Apt and dpkg aliases for Ubuntu and Debian distros.'
|
about-alias 'Apt and dpkg aliases for Ubuntu and Debian distros.'
|
||||||
|
|
||||||
# set apt aliases
|
# set apt aliases
|
||||||
function _set_pkg_aliases() {
|
function _set_pkg_aliases()
|
||||||
if _command_exists apt; then
|
{
|
||||||
|
if [ -x $(which apt) ]; then
|
||||||
alias apts='apt-cache search'
|
alias apts='apt-cache search'
|
||||||
alias aptshow='apt-cache show'
|
alias aptshow='apt-cache show'
|
||||||
alias aptinst='sudo apt-get install -V'
|
alias aptinst='sudo apt-get install -V'
|
||||||
|
|
|
||||||
|
|
@ -1,4 +1,4 @@
|
||||||
# shellcheck shell=bash
|
cite 'about-alias'
|
||||||
about-alias 'Atom.io editor abbreviations'
|
about-alias 'Atom.io editor abbreviations'
|
||||||
|
|
||||||
alias a='atom'
|
alias a='atom'
|
||||||
|
|
|
||||||
|
|
@ -1,4 +1,4 @@
|
||||||
# shellcheck shell=bash
|
cite about-alias
|
||||||
about-alias 'Aliases for the bash-it command (these aliases are automatically included with the "general" aliases)'
|
about-alias 'Aliases for the bash-it command (these aliases are automatically included with the "general" aliases)'
|
||||||
|
|
||||||
# Common misspellings of bash-it
|
# Common misspellings of bash-it
|
||||||
|
|
|
||||||
|
|
@ -1,4 +1,4 @@
|
||||||
# shellcheck shell=bash
|
cite 'about-alias'
|
||||||
about-alias 'puppet bolt aliases'
|
about-alias 'puppet bolt aliases'
|
||||||
|
|
||||||
# Aliases
|
# Aliases
|
||||||
|
|
|
||||||
|
|
@ -1,4 +1,4 @@
|
||||||
# shellcheck shell=bash
|
cite 'about-alias'
|
||||||
about-alias 'ruby bundler'
|
about-alias 'ruby bundler'
|
||||||
|
|
||||||
# Bundler Commands
|
# Bundler Commands
|
||||||
|
|
|
||||||
|
|
@ -1,4 +1,5 @@
|
||||||
# shellcheck shell=bash
|
# shellcheck shell=bash
|
||||||
|
cite 'about-alias'
|
||||||
about-alias 'xclip shortcuts'
|
about-alias 'xclip shortcuts'
|
||||||
|
|
||||||
alias pbcopy="xclip -selection clipboard"
|
alias pbcopy="xclip -selection clipboard"
|
||||||
|
|
|
||||||
|
|
@ -1,4 +1,4 @@
|
||||||
# shellcheck shell=bash
|
cite 'about-alias'
|
||||||
about-alias 'common composer abbreviations'
|
about-alias 'common composer abbreviations'
|
||||||
|
|
||||||
# Aliases
|
# Aliases
|
||||||
|
|
|
||||||
|
|
@ -1,19 +1,22 @@
|
||||||
# shellcheck shell=bash
|
#!/bin/bash
|
||||||
|
|
||||||
|
cite 'about-alias'
|
||||||
about-alias 'Curl aliases for convenience.'
|
about-alias 'Curl aliases for convenience.'
|
||||||
|
|
||||||
# set apt aliases
|
# set apt aliases
|
||||||
function _set_pkg_aliases() {
|
function _set_pkg_aliases()
|
||||||
if _command_exists curl; then
|
{
|
||||||
|
if [ -x $(which curl) ]; then
|
||||||
# follow redirects
|
# follow redirects
|
||||||
alias cl='curl -L'
|
alias cl='curl -L'
|
||||||
# follow redirects, download as original name
|
# follow redirects, download as original name
|
||||||
alias clo='curl -L -O'
|
alias clo='curl -L -O'
|
||||||
# follow redirects, download as original name, continue
|
# follow redirects, download as original name, continue
|
||||||
alias cloc='curl -L -C - -O'
|
alias cloc='curl -L -C - -O'
|
||||||
# follow redirects, download as original name, continue, retry 5 times
|
# follow redirects, download as original name, continue, retry 5 times
|
||||||
alias clocr='curl -L -C - -O --retry 5'
|
alias clocr='curl -L -C - -O --retry 5'
|
||||||
# follow redirects, fetch banner
|
# follow redirects, fetch banner
|
||||||
alias clb='curl -L -I'
|
alias clb='curl -L -I'
|
||||||
# see only response headers from a get request
|
# see only response headers from a get request
|
||||||
alias clhead='curl -D - -so /dev/null'
|
alias clhead='curl -D - -so /dev/null'
|
||||||
fi
|
fi
|
||||||
|
|
|
||||||
|
|
@ -1,4 +1,5 @@
|
||||||
# shellcheck shell=bash
|
# shellcheck shell=bash
|
||||||
|
cite 'about-alias'
|
||||||
about-alias 'dnf aliases for fedora 22+ distros'
|
about-alias 'dnf aliases for fedora 22+ distros'
|
||||||
|
|
||||||
alias dnfl="dnf list" # List packages
|
alias dnfl="dnf list" # List packages
|
||||||
|
|
|
||||||
|
|
@ -1,4 +1,4 @@
|
||||||
# shellcheck shell=bash
|
cite 'about-alias'
|
||||||
about-alias 'docker-compose abbreviations'
|
about-alias 'docker-compose abbreviations'
|
||||||
|
|
||||||
alias dco="docker-compose"
|
alias dco="docker-compose"
|
||||||
|
|
@ -7,4 +7,3 @@ alias dco="docker-compose"
|
||||||
alias dcofresh="docker-compose-fresh"
|
alias dcofresh="docker-compose-fresh"
|
||||||
alias dcol="docker-compose logs -f --tail 100"
|
alias dcol="docker-compose logs -f --tail 100"
|
||||||
alias dcou="docker-compose up"
|
alias dcou="docker-compose up"
|
||||||
alias dcouns="dcou --no-start"
|
|
||||||
|
|
|
||||||
|
|
@ -1,32 +1,32 @@
|
||||||
# shellcheck shell=bash
|
cite 'about-alias'
|
||||||
about-alias 'docker abbreviations'
|
about-alias 'docker abbreviations'
|
||||||
|
|
||||||
alias dk='docker'
|
alias dk='docker'
|
||||||
alias dklc='docker ps -l' # List last Docker container
|
alias dklc='docker ps -l' # List last Docker container
|
||||||
alias dklcid='docker ps -l -q' # List last Docker container ID
|
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 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 dkps='docker ps' # List running Docker containers
|
||||||
alias dkpsa='docker ps -a' # List all Docker containers
|
alias dkpsa='docker ps -a' # List all Docker containers
|
||||||
alias dki='docker images' # List Docker images
|
alias dki='docker images' # List Docker images
|
||||||
alias dkrmac='docker rm $(docker ps -a -q)' # Delete all Docker containers
|
alias dkrmac='docker rm $(docker ps -a -q)' # Delete all Docker containers
|
||||||
|
|
||||||
case $OSTYPE in
|
case $OSTYPE in
|
||||||
darwin* | *bsd* | *BSD*)
|
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 docker rmi' # Delete all untagged Docker images
|
||||||
;;
|
;;
|
||||||
*)
|
*)
|
||||||
alias dkrmui='docker images -q -f dangling=true | xargs -r 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
|
esac
|
||||||
|
|
||||||
if _bash-it-component-item-is-enabled plugin docker; then
|
if [ ! -z "$(command ls "${BASH_IT}/enabled/"{[0-9][0-9][0-9]${BASH_IT_LOAD_PRIORITY_SEPARATOR}docker,docker}.plugin.bash 2>/dev/null | head -1)" ]; then
|
||||||
# Function aliases from docker plugin:
|
# Function aliases from docker plugin:
|
||||||
alias dkrmlc='docker-remove-most-recent-container' # Delete most recent (i.e., last) Docker container
|
alias dkrmlc='docker-remove-most-recent-container' # Delete most recent (i.e., last) Docker container
|
||||||
alias dkrmall='docker-remove-stale-assets' # Delete all untagged images and exited containers
|
alias dkrmall='docker-remove-stale-assets' # Delete all untagged images and exited containers
|
||||||
alias dkrmli='docker-remove-most-recent-image' # Delete most recent (i.e., last) Docker image
|
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 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 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
|
alias dkre='docker-runtime-environment' # List environmental variables of the supplied image ID
|
||||||
fi
|
fi
|
||||||
alias dkelc='docker exec -it $(dklcid) bash --login' # Enter last container (works with Docker 1.3 and above)
|
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 dkrmflast='docker rm -f $(dklcid)'
|
||||||
|
|
|
||||||
|
|
@ -1,16 +1,16 @@
|
||||||
# shellcheck shell=bash
|
cite 'about-alias'
|
||||||
about-alias 'emacs editor'
|
about-alias 'emacs editor'
|
||||||
|
|
||||||
case $OSTYPE in
|
case $OSTYPE in
|
||||||
linux*)
|
linux*)
|
||||||
alias em='emacs'
|
alias em='emacs'
|
||||||
alias en='emacs -nw'
|
alias en='emacs -nw'
|
||||||
alias e='emacsclient -n'
|
alias e='emacsclient -n'
|
||||||
alias et='emacsclient -t'
|
alias et='emacsclient -t'
|
||||||
alias ed='emacs --daemon'
|
alias ed='emacs --daemon'
|
||||||
alias E='SUDO_EDITOR=emacsclient sudo -e'
|
alias E='SUDO_EDITOR=emacsclient sudo -e'
|
||||||
;;
|
;;
|
||||||
darwin*)
|
darwin*)
|
||||||
alias em='open -a emacs'
|
alias em='open -a emacs'
|
||||||
;;
|
;;
|
||||||
esac
|
esac
|
||||||
|
|
|
||||||
|
|
@ -1,9 +1,9 @@
|
||||||
# shellcheck shell=bash
|
cite 'about-alias'
|
||||||
about-alias 'fuck/please to retry last command with sudo'
|
about-alias 'fuck/please to retry last command with sudo'
|
||||||
|
|
||||||
# Play nicely with 'thefuck' plugin
|
# Play nicely with 'thefuck' plugin
|
||||||
if ! _command_exists fuck; then
|
if ! _command_exists fuck ; then
|
||||||
alias fuck='sudo $(fc -ln -1)'
|
alias fuck='sudo $(fc -ln -1)'
|
||||||
fi
|
fi
|
||||||
alias please=fuck
|
alias please=fuck
|
||||||
alias plz=please
|
alias plz=please
|
||||||
|
|
|
||||||
|
|
@ -1,45 +1,50 @@
|
||||||
# shellcheck shell=bash
|
cite about-alias
|
||||||
about-alias 'general aliases'
|
about-alias 'general aliases'
|
||||||
|
|
||||||
if command ls --color -d . &> /dev/null; then
|
if ls --color -d . &> /dev/null
|
||||||
alias ls='ls --color=auto'
|
then
|
||||||
# BSD `ls` doesn't need an argument (`-G`) when `$CLICOLOR` is set.
|
alias ls="ls --color=auto"
|
||||||
|
elif ls -G -d . &> /dev/null
|
||||||
|
then
|
||||||
|
alias ls='ls -G' # Compact view, show colors
|
||||||
fi
|
fi
|
||||||
|
|
||||||
# List directory contents
|
# List directory contents
|
||||||
alias sl=ls
|
alias sl=ls
|
||||||
alias la='ls -AF' # Compact view, show hidden
|
alias la='ls -AF' # Compact view, show hidden
|
||||||
alias ll='ls -al'
|
alias ll='ls -al'
|
||||||
alias l='ls -a'
|
alias l='ls -a'
|
||||||
alias l1='ls -1'
|
alias l1='ls -1'
|
||||||
alias lf='ls -F'
|
|
||||||
|
|
||||||
alias _='sudo'
|
alias _="sudo"
|
||||||
|
|
||||||
# Shortcuts to edit startup files
|
# Shortcuts to edit startup files
|
||||||
alias vbrc='${VISUAL:-vim} ~/.bashrc'
|
alias vbrc="vim ~/.bashrc"
|
||||||
alias vbpf='${VISUAL:-vim} ~/.bash_profile'
|
alias vbpf="vim ~/.bash_profile"
|
||||||
|
|
||||||
# colored grep
|
# colored grep
|
||||||
# Need to check an existing file for a pattern that will be found to ensure
|
# Need to check an existing file for a pattern that will be found to ensure
|
||||||
# that the check works when on an OS that supports the color option
|
# that the check works when on an OS that supports the color option
|
||||||
if command grep --color=auto "a" "${BASH_IT?}"/*.md &> /dev/null; then
|
if grep --color=auto "a" "${BASH_IT}/"*.md &> /dev/null
|
||||||
alias grep='grep --color=auto'
|
then
|
||||||
|
alias grep='grep --color=auto'
|
||||||
fi
|
fi
|
||||||
|
|
||||||
if _command_exists gshuf; then
|
if which gshuf &> /dev/null
|
||||||
alias shuf=gshuf
|
then
|
||||||
|
alias shuf=gshuf
|
||||||
fi
|
fi
|
||||||
|
|
||||||
alias c='clear'
|
alias c='clear'
|
||||||
|
alias k='clear'
|
||||||
alias cls='clear'
|
alias cls='clear'
|
||||||
|
|
||||||
alias edit='${EDITOR:-${ALTERNATE_EDITOR:-nano}}'
|
alias edit="$EDITOR"
|
||||||
alias pager='${PAGER:=less}'
|
alias pager="$PAGER"
|
||||||
|
|
||||||
alias q='exit'
|
alias q='exit'
|
||||||
|
|
||||||
alias irc='${IRC_CLIENT:=irc}'
|
alias irc="${IRC_CLIENT:=irc}"
|
||||||
|
|
||||||
# Language aliases
|
# Language aliases
|
||||||
alias rb='ruby'
|
alias rb='ruby'
|
||||||
|
|
@ -60,8 +65,9 @@ alias -- -='cd -' # Go back
|
||||||
alias h='history'
|
alias h='history'
|
||||||
|
|
||||||
# Tree
|
# Tree
|
||||||
if ! _command_exists tree; then
|
if [ ! -x "$(which tree 2>/dev/null)" ]
|
||||||
alias tree="find . -print | sed -e 's;[^/]*/;|____;g;s;____|; |;g'"
|
then
|
||||||
|
alias tree="find . -print | sed -e 's;[^/]*/;|____;g;s;____|; |;g'"
|
||||||
fi
|
fi
|
||||||
|
|
||||||
# Directory
|
# Directory
|
||||||
|
|
@ -69,17 +75,21 @@ alias md='mkdir -p'
|
||||||
alias rd='rmdir'
|
alias rd='rmdir'
|
||||||
|
|
||||||
# Shorten extract
|
# Shorten extract
|
||||||
alias xt='extract'
|
alias xt="extract"
|
||||||
|
|
||||||
|
# sudo editors
|
||||||
|
alias svim="sudo vim"
|
||||||
|
alias snano="sudo nano"
|
||||||
|
|
||||||
# Display whatever file is regular file or folder
|
# Display whatever file is regular file or folder
|
||||||
function catt() {
|
catt() {
|
||||||
for i in "$@"; do
|
for i in "$@"; do
|
||||||
if [[ -d "$i" ]]; then
|
if [ -d "$i" ]; then
|
||||||
ls "$i"
|
ls "$i"
|
||||||
else
|
else
|
||||||
cat "$i"
|
cat "$i"
|
||||||
fi
|
fi
|
||||||
done
|
done
|
||||||
}
|
}
|
||||||
|
|
||||||
# The Bash-it aliases were moved to the `bash-it.aliases.bash` file. The intent of this
|
# The Bash-it aliases were moved to the `bash-it.aliases.bash` file. The intent of this
|
||||||
|
|
@ -88,5 +98,5 @@ function catt() {
|
||||||
# aliases and enable just the ones for Bash-it explicitly:
|
# aliases and enable just the ones for Bash-it explicitly:
|
||||||
# bash-it disable alias general
|
# bash-it disable alias general
|
||||||
# bash-it enable alias bash-it
|
# bash-it enable alias bash-it
|
||||||
# shellcheck source-path=SCRIPTDIR
|
# shellcheck source=./bash-it.aliases.bash
|
||||||
source "$BASH_IT/aliases/available/bash-it.aliases.bash"
|
source "$BASH_IT/aliases/available/bash-it.aliases.bash"
|
||||||
|
|
|
||||||
|
|
@ -1,4 +1,5 @@
|
||||||
# shellcheck shell=bash
|
# shellcheck shell=bash
|
||||||
|
cite 'about-alias'
|
||||||
about-alias 'common git abbreviations'
|
about-alias 'common git abbreviations'
|
||||||
|
|
||||||
alias g='git'
|
alias g='git'
|
||||||
|
|
@ -8,18 +9,13 @@ alias get='git'
|
||||||
alias ga='git add'
|
alias ga='git add'
|
||||||
alias gall='git add -A'
|
alias gall='git add -A'
|
||||||
alias gap='git add -p'
|
alias gap='git add -p'
|
||||||
alias gav='git add -v'
|
|
||||||
|
|
||||||
# branch
|
# branch
|
||||||
alias gb='git branch'
|
alias gb='git branch'
|
||||||
alias gba='git branch --all'
|
|
||||||
alias gbd='git branch -d'
|
|
||||||
alias gbD='git branch -D'
|
alias gbD='git branch -D'
|
||||||
alias gbl='git branch --list'
|
alias gba='git branch -a'
|
||||||
alias gbla='git branch --list --all'
|
alias gbd='git branch -d'
|
||||||
alias gblr='git branch --list --remotes'
|
alias gbm='git branch -m'
|
||||||
alias gbm='git branch --move'
|
|
||||||
alias gbr='git branch --remotes'
|
|
||||||
alias gbt='git branch --track'
|
alias gbt='git branch --track'
|
||||||
alias gdel='git branch -D'
|
alias gdel='git branch -D'
|
||||||
|
|
||||||
|
|
@ -41,8 +37,8 @@ alias gcb='git checkout -b'
|
||||||
alias gco='git checkout'
|
alias gco='git checkout'
|
||||||
alias gcob='git checkout -b'
|
alias gcob='git checkout -b'
|
||||||
alias gcobu='git checkout -b ${USER}/'
|
alias gcobu='git checkout -b ${USER}/'
|
||||||
alias gcom='git checkout $(get_default_branch)'
|
alias gcom='git checkout master'
|
||||||
alias gcpd='git checkout $(get_default_branch); git pull; git branch -D'
|
alias gcpd='git checkout master; git pull; git branch -D'
|
||||||
alias gct='git checkout --track'
|
alias gct='git checkout --track'
|
||||||
|
|
||||||
# clone
|
# clone
|
||||||
|
|
@ -68,14 +64,13 @@ alias gf='git fetch --all --prune'
|
||||||
alias gft='git fetch --all --prune --tags'
|
alias gft='git fetch --all --prune --tags'
|
||||||
alias gftv='git fetch --all --prune --tags --verbose'
|
alias gftv='git fetch --all --prune --tags --verbose'
|
||||||
alias gfv='git fetch --all --prune --verbose'
|
alias gfv='git fetch --all --prune --verbose'
|
||||||
alias gmu='git fetch origin -v; git fetch upstream -v; git merge upstream/$(get_default_branch)'
|
alias gmu='git fetch origin -v; git fetch upstream -v; git merge upstream/master'
|
||||||
alias gup='git fetch && git rebase'
|
alias gup='git fetch && git rebase'
|
||||||
|
|
||||||
# log
|
# log
|
||||||
alias gg='git log --graph --pretty=format:'\''%C(bold)%h%Creset%C(magenta)%d%Creset %s %C(yellow)<%an> %C(cyan)(%cr)%Creset'\'' --abbrev-commit --date=relative'
|
alias gg='git log --graph --pretty=format:'\''%C(bold)%h%Creset%C(magenta)%d%Creset %s %C(yellow)<%an> %C(cyan)(%cr)%Creset'\'' --abbrev-commit --date=relative'
|
||||||
alias ggf='git log --graph --date=short --pretty=format:'\''%C(auto)%h %Cgreen%an%Creset %Cblue%cd%Creset %C(auto)%d %s'\'''
|
alias ggf='git log --graph --date=short --pretty=format:'\''%C(auto)%h %Cgreen%an%Creset %Cblue%cd%Creset %C(auto)%d %s'\'''
|
||||||
alias ggs='gg --stat'
|
alias ggs='gg --stat'
|
||||||
alias ggup='git log --branches --not --remotes --no-walk --decorate --oneline' # FROM https://stackoverflow.com/questions/39220870/in-git-list-names-of-branches-with-unpushed-commits
|
|
||||||
alias gll='git log --graph --pretty=oneline --abbrev-commit'
|
alias gll='git log --graph --pretty=oneline --abbrev-commit'
|
||||||
alias gnew='git log HEAD@{1}..HEAD@{0}' # Show commits since last pull, see http://blogs.atlassian.com/2014/10/advanced-git-aliases/
|
alias gnew='git log HEAD@{1}..HEAD@{0}' # Show commits since last pull, see http://blogs.atlassian.com/2014/10/advanced-git-aliases/
|
||||||
alias gwc='git whatchanged'
|
alias gwc='git whatchanged'
|
||||||
|
|
@ -89,7 +84,7 @@ alias glsum='git diff --name-only --diff-filter=U' # Show unmerged (conflicted)
|
||||||
alias ggui='git gui'
|
alias ggui='git gui'
|
||||||
|
|
||||||
# home
|
# home
|
||||||
alias ghm='cd "$(git rev-parse --show-toplevel)"' # Git home
|
alias ghm='cd '\''$(git rev-parse --show-toplevel)'\''' # Git home
|
||||||
# appendage to ghm
|
# appendage to ghm
|
||||||
if ! _command_exists gh; then
|
if ! _command_exists gh; then
|
||||||
alias gh='ghm'
|
alias gh='ghm'
|
||||||
|
|
@ -109,7 +104,7 @@ alias gp='git push'
|
||||||
alias gpd='git push --delete'
|
alias gpd='git push --delete'
|
||||||
alias gpf='git push --force'
|
alias gpf='git push --force'
|
||||||
alias gpo='git push origin HEAD'
|
alias gpo='git push origin HEAD'
|
||||||
alias gpom='git push origin $(get_default_branch)'
|
alias gpom='git push origin master'
|
||||||
alias gpu='git push --set-upstream'
|
alias gpu='git push --set-upstream'
|
||||||
alias gpunch='git push --force-with-lease'
|
alias gpunch='git push --force-with-lease'
|
||||||
alias gpuo='git push --set-upstream origin'
|
alias gpuo='git push --set-upstream origin'
|
||||||
|
|
@ -117,7 +112,7 @@ alias gpuoc='git push --set-upstream origin $(git symbolic-ref --short HEAD)'
|
||||||
|
|
||||||
# pull
|
# pull
|
||||||
alias gl='git pull'
|
alias gl='git pull'
|
||||||
alias glum='git pull upstream $(get_default_branch)'
|
alias glum='git pull upstream master'
|
||||||
alias gpl='git pull'
|
alias gpl='git pull'
|
||||||
alias gpp='git pull && git push'
|
alias gpp='git pull && git push'
|
||||||
alias gpr='git pull --rebase'
|
alias gpr='git pull --rebase'
|
||||||
|
|
@ -132,11 +127,9 @@ alias grm='git rm'
|
||||||
|
|
||||||
# rebase
|
# rebase
|
||||||
alias grb='git rebase'
|
alias grb='git rebase'
|
||||||
alias grbc='git rebase --continue'
|
alias grm='git rebase master'
|
||||||
alias grm='git rebase $(get_default_branch)'
|
alias grmi='git rebase master -i'
|
||||||
alias grmi='git rebase $(get_default_branch) -i'
|
alias gprom='git fetch origin master && git rebase origin/master && git update-ref refs/heads/master origin/master' # Rebase with latest remote master
|
||||||
alias grma='GIT_SEQUENCE_EDITOR=: git rebase $(get_default_branch) -i --autosquash'
|
|
||||||
alias gprom='git fetch origin $(get_default_branch) && git rebase origin/$(get_default_branch) && git update-ref refs/heads/$(get_default_branch) origin/$(get_default_branch)' # Rebase with latest remote
|
|
||||||
|
|
||||||
# reset
|
# reset
|
||||||
alias gus='git reset HEAD'
|
alias gus='git reset HEAD'
|
||||||
|
|
@ -180,7 +173,7 @@ alias gsu='git submodule update --init --recursive'
|
||||||
# these aliases requires git v2.23+
|
# these aliases requires git v2.23+
|
||||||
alias gsw='git switch'
|
alias gsw='git switch'
|
||||||
alias gswc='git switch --create'
|
alias gswc='git switch --create'
|
||||||
alias gswm='git switch $(get_default_branch)'
|
alias gswm='git switch master'
|
||||||
alias gswt='git switch --track'
|
alias gswt='git switch --track'
|
||||||
|
|
||||||
# tag
|
# tag
|
||||||
|
|
@ -202,11 +195,3 @@ esac
|
||||||
function gdv() {
|
function gdv() {
|
||||||
git diff --ignore-all-space "$@" | vim -R -
|
git diff --ignore-all-space "$@" | vim -R -
|
||||||
}
|
}
|
||||||
|
|
||||||
function get_default_branch() {
|
|
||||||
if git branch | grep -q '^. main\s*$'; then
|
|
||||||
echo main
|
|
||||||
else
|
|
||||||
echo master
|
|
||||||
fi
|
|
||||||
}
|
|
||||||
|
|
|
||||||
|
|
@ -1,4 +1,4 @@
|
||||||
# shellcheck shell=bash
|
cite 'about-alias'
|
||||||
about-alias 'common git-svn abbreviations'
|
about-alias 'common git-svn abbreviations'
|
||||||
|
|
||||||
# Aliases
|
# Aliases
|
||||||
|
|
|
||||||
|
|
@ -1,4 +1,4 @@
|
||||||
# shellcheck shell=bash
|
cite 'about-alias'
|
||||||
about-alias 'heroku task abbreviations'
|
about-alias 'heroku task abbreviations'
|
||||||
|
|
||||||
# heroku
|
# heroku
|
||||||
|
|
|
||||||
|
|
@ -1,4 +1,4 @@
|
||||||
# shellcheck shell=bash
|
cite 'about-alias'
|
||||||
about-alias 'mercurial abbreviations'
|
about-alias 'mercurial abbreviations'
|
||||||
|
|
||||||
alias hs='hg status'
|
alias hs='hg status'
|
||||||
|
|
|
||||||
|
|
@ -1,5 +1,7 @@
|
||||||
# shellcheck shell=bash
|
# Some aliases for Homebrew Cask
|
||||||
about-alias 'Some aliases for Homebrew Cask'
|
|
||||||
|
cite 'about-alias'
|
||||||
|
about-alias 'homebrew-cask abbreviations'
|
||||||
|
|
||||||
alias bcin='brew cask install'
|
alias bcin='brew cask install'
|
||||||
alias bcrm='brew cask uninstall'
|
alias bcrm='brew cask uninstall'
|
||||||
|
|
|
||||||
|
|
@ -1,5 +1,7 @@
|
||||||
# shellcheck shell=bash
|
# Some aliases for Homebrew
|
||||||
about-alias 'Some aliases for Homebrew'
|
|
||||||
|
cite 'about-alias'
|
||||||
|
about-alias 'homebrew abbreviations'
|
||||||
|
|
||||||
alias bup='brew update && brew upgrade'
|
alias bup='brew update && brew upgrade'
|
||||||
alias bout='brew outdated'
|
alias bout='brew outdated'
|
||||||
|
|
|
||||||
|
|
@ -1,4 +1,4 @@
|
||||||
# shellcheck shell=bash
|
cite 'about-alias'
|
||||||
about-alias 'homesick aliases'
|
about-alias 'homesick aliases'
|
||||||
|
|
||||||
# Aliases
|
# Aliases
|
||||||
|
|
@ -19,5 +19,6 @@ alias sikpsh="homesick push dotfiles"
|
||||||
alias sikrc="homesick rc dotfiles"
|
alias sikrc="homesick rc dotfiles"
|
||||||
alias sikpth="homesick show_path dotfiles"
|
alias sikpth="homesick show_path dotfiles"
|
||||||
alias sikst="homesick status dotfiles"
|
alias sikst="homesick status dotfiles"
|
||||||
|
alias siktrk="homesick track $1 dotfiles"
|
||||||
alias sikulnk="homesick unlink dotfiles"
|
alias sikulnk="homesick unlink dotfiles"
|
||||||
alias sikv="homesick version"
|
alias sikv="homesick version"
|
||||||
|
|
|
||||||
|
|
@ -1,4 +1,4 @@
|
||||||
# shellcheck shell=bash
|
cite 'about-alias'
|
||||||
about-alias 'jitsu task abbreviations'
|
about-alias 'jitsu task abbreviations'
|
||||||
|
|
||||||
# jitsu
|
# jitsu
|
||||||
|
|
|
||||||
|
|
@ -1,16 +1,25 @@
|
||||||
# shellcheck shell=bash
|
#!/bin/bash
|
||||||
|
#
|
||||||
|
# -binaryanomaly
|
||||||
|
|
||||||
|
cite 'about-alias'
|
||||||
about-alias 'kubectl aliases'
|
about-alias 'kubectl aliases'
|
||||||
|
|
||||||
if _command_exists kubectl; then
|
function _set_pkg_aliases()
|
||||||
alias kc='kubectl'
|
{
|
||||||
alias kcgp='kubectl get pods'
|
if _command_exists kubectl; then
|
||||||
alias kcgd='kubectl get deployments'
|
alias kc='kubectl'
|
||||||
alias kcgn='kubectl get nodes'
|
alias kcgp='kubectl get pods'
|
||||||
alias kcdp='kubectl describe pod'
|
alias kcgd='kubectl get deployments'
|
||||||
alias kcdd='kubectl describe deployment'
|
alias kcgn='kubectl get nodes'
|
||||||
alias kcdn='kubectl describe node'
|
alias kcdp='kubectl describe pod'
|
||||||
alias kcgpan='kubectl get pods --all-namespaces'
|
alias kcdd='kubectl describe deployment'
|
||||||
alias kcgdan='kubectl get deployments --all-namespaces'
|
alias kcdn='kubectl describe node'
|
||||||
# launches a disposable netshoot pod in the k8s cluster
|
alias kcgpan='kubectl get pods --all-namespaces'
|
||||||
alias kcnetshoot='kubectl run netshoot-$(date +%s) --rm -i --tty --image nicolaka/netshoot -- /bin/bash'
|
alias kcgdan='kubectl get deployments --all-namespaces'
|
||||||
fi
|
# launches a disposable netshoot pod in the k8s cluster
|
||||||
|
alias kcnetshoot='kubectl run --generator=run-pod/v1 netshoot-$(date +%s) --rm -i --tty --image nicolaka/netshoot -- /bin/bash'
|
||||||
|
fi
|
||||||
|
}
|
||||||
|
|
||||||
|
_set_pkg_aliases
|
||||||
|
|
|
||||||
|
|
@ -1,9 +1,9 @@
|
||||||
# shellcheck shell=bash
|
cite 'about-alias'
|
||||||
about-alias 'laravel artisan abbreviations'
|
about-alias 'laravel artisan abbreviations'
|
||||||
|
|
||||||
# A list of useful laravel aliases
|
# A list of useful laravel aliases
|
||||||
|
|
||||||
alias laravel='${HOME?}/.composer/vendor/bin/laravel'
|
alias laravel="${HOME}/.composer/vendor/bin/laravel"
|
||||||
# asset
|
# asset
|
||||||
alias a:apub='php artisan asset:publish'
|
alias a:apub='php artisan asset:publish'
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -1,4 +1,4 @@
|
||||||
# shellcheck shell=bash
|
cite 'about-alias'
|
||||||
about-alias 'maven abbreviations'
|
about-alias 'maven abbreviations'
|
||||||
|
|
||||||
alias mci='mvn clean install'
|
alias mci='mvn clean install'
|
||||||
|
|
|
||||||
|
|
@ -1,4 +1,6 @@
|
||||||
# shellcheck shell=bash
|
#!/bin/bash
|
||||||
|
|
||||||
|
cite 'about-alias'
|
||||||
about-alias 'MSYS2 aliases'
|
about-alias 'MSYS2 aliases'
|
||||||
|
|
||||||
LS_COMMON="-hG"
|
LS_COMMON="-hG"
|
||||||
|
|
@ -7,8 +9,7 @@ LS_COMMON="$LS_COMMON -I NTUSER.DAT\* -I ntuser.dat\*"
|
||||||
|
|
||||||
# alias
|
# alias
|
||||||
# setup the main ls alias if we've established common args
|
# setup the main ls alias if we've established common args
|
||||||
alias ls='command ls ${LS_COMMON:-}'
|
test -n "$LS_COMMON" && alias ls="command ls $LS_COMMON"
|
||||||
alias ll="ls -l"
|
alias ll="ls -l"
|
||||||
alias la="ls -a"
|
alias la="ls -a"
|
||||||
alias lal="ll -a"
|
alias lal="ll -a"
|
||||||
alias lf="ls -F"
|
|
||||||
|
|
|
||||||
|
|
@ -1,4 +1,4 @@
|
||||||
# shellcheck shell=bash
|
cite 'about-alias'
|
||||||
about-alias 'the Node.js environment aliases'
|
about-alias 'the Node.js environment aliases'
|
||||||
|
|
||||||
# alias to setup nodejs development environment
|
# alias to setup nodejs development environment
|
||||||
|
|
|
||||||
|
|
@ -1,4 +1,4 @@
|
||||||
# shellcheck shell=bash
|
cite 'about-alias'
|
||||||
about-alias 'common npm abbreviations'
|
about-alias 'common npm abbreviations'
|
||||||
|
|
||||||
# Aliases
|
# Aliases
|
||||||
|
|
@ -22,7 +22,6 @@ alias nud='npm update'
|
||||||
alias nr='npm run'
|
alias nr='npm run'
|
||||||
alias nls='npm list --depth=0 2>/dev/null'
|
alias nls='npm list --depth=0 2>/dev/null'
|
||||||
alias nlsg='npm list -g --depth=0 2>/dev/null'
|
alias nlsg='npm list -g --depth=0 2>/dev/null'
|
||||||
alias nt='npm test'
|
|
||||||
|
|
||||||
# npx
|
# npx
|
||||||
alias nx='npx'
|
alias nx='npx'
|
||||||
|
|
|
||||||
|
|
@ -1,28 +1,27 @@
|
||||||
# shellcheck shell=bash
|
cite 'about-alias'
|
||||||
about-alias 'osx-specific aliases'
|
about-alias 'osx-specific aliases'
|
||||||
|
|
||||||
# Desktop Programs
|
# Desktop Programs
|
||||||
alias fireworks='open -a "/Applications/Adobe Fireworks CS3/Adobe Fireworks CS3.app"'
|
alias fireworks="open -a '/Applications/Adobe Fireworks CS3/Adobe Fireworks CS3.app'"
|
||||||
alias photoshop='open -a "/Applications/Adobe Photoshop CS3/Adobe Photoshop.app"'
|
alias photoshop="open -a '/Applications/Adobe Photoshop CS3/Adobe Photoshop.app'"
|
||||||
alias preview='open -a "${PREVIEW?}"'
|
alias preview="open -a '$PREVIEW'"
|
||||||
alias xcode='open -a "/Applications/XCode.app"'
|
alias xcode="open -a '/Applications/XCode.app'"
|
||||||
alias filemerge='open -a "/Developer/Applications/Utilities/FileMerge.app"'
|
alias filemerge="open -a '/Developer/Applications/Utilities/FileMerge.app'"
|
||||||
alias safari='open -a safari'
|
alias safari="open -a safari"
|
||||||
alias firefox='open -a firefox'
|
alias firefox="open -a firefox"
|
||||||
alias chrome='open -a "Google Chrome"'
|
alias chrome="open -a google\ chrome"
|
||||||
alias chromium='open -a chromium'
|
alias chromium="open -a chromium"
|
||||||
alias brave='open -a "Brave Browser"'
|
alias dashcode="open -a dashcode"
|
||||||
alias dashcode='open -a dashcode'
|
|
||||||
alias f='open -a Finder '
|
alias f='open -a Finder '
|
||||||
alias fh='open -a Finder .'
|
alias fh='open -a Finder .'
|
||||||
alias textedit='open -a TextEdit'
|
alias textedit='open -a TextEdit'
|
||||||
alias hex='open -a "Hex Fiend"'
|
alias hex='open -a "Hex Fiend"'
|
||||||
alias skype='open -a Skype'
|
alias skype='open -a Skype'
|
||||||
alias mou='open -a Mou'
|
alias mou='open -a Mou'
|
||||||
alias subl='open -a "Sublime Text"'
|
alias subl='open -a Sublime\ Text'
|
||||||
|
|
||||||
if [[ -s /usr/bin/firefox ]]; then
|
if [ -s /usr/bin/firefox ] ; then
|
||||||
unalias firefox
|
unalias firefox
|
||||||
fi
|
fi
|
||||||
|
|
||||||
# Requires growlnotify, which can be found in the Growl DMG under "Extras"
|
# Requires growlnotify, which can be found in the Growl DMG under "Extras"
|
||||||
|
|
@ -38,20 +37,19 @@ alias whotunes='lsof -r 2 -n -P -F n -c iTunes -a -i TCP@`hostname`:3689'
|
||||||
alias flush='dscacheutil -flushcache'
|
alias flush='dscacheutil -flushcache'
|
||||||
|
|
||||||
# Show/hide hidden files (for Mac OS X Mavericks)
|
# Show/hide hidden files (for Mac OS X Mavericks)
|
||||||
alias showhidden='defaults write com.apple.finder AppleShowAllFiles TRUE'
|
alias showhidden="defaults write com.apple.finder AppleShowAllFiles TRUE"
|
||||||
alias hidehidden='defaults write com.apple.finder AppleShowAllFiles FALSE'
|
alias hidehidden="defaults write com.apple.finder AppleShowAllFiles FALSE"
|
||||||
|
|
||||||
# From http://apple.stackexchange.com/questions/110343/copy-last-command-in-terminal
|
# From http://apple.stackexchange.com/questions/110343/copy-last-command-in-terminal
|
||||||
# shellcheck disable=SC2142 # The quoting confuses `shellcheck`...
|
alias copyLastCmd='fc -ln -1 | awk '\''{$1=$1}1'\'' ORS='\'''\'' | pbcopy'
|
||||||
alias copyLastCmd="fc -ln -1 | awk '{\$1=\$1}1' ORS='' | pbcopy"
|
|
||||||
|
|
||||||
# Use Finder's Quick Look on a file (^C or space to close)
|
# Use Finder's Quick Look on a file (^C or space to close)
|
||||||
alias ql='qlmanage -p 2>/dev/null'
|
alias ql='qlmanage -p 2>/dev/null'
|
||||||
|
|
||||||
# Mute/Unmute the system volume. Plays nice with all other volume settings.
|
# Mute/Unmute the system volume. Plays nice with all other volume settings.
|
||||||
alias mute='osascript -e "set volume output muted true"'
|
alias mute="osascript -e 'set volume output muted true'"
|
||||||
alias unmute='osascript -e "set volume output muted false"'
|
alias unmute="osascript -e 'set volume output muted false'"
|
||||||
|
|
||||||
# Pin to the tail of long commands for an audible alert after long processes
|
# Pin to the tail of long commands for an audible alert after long processes
|
||||||
## curl http://downloads.com/hugefile.zip; lmk
|
## curl http://downloads.com/hugefile.zip; lmk
|
||||||
alias lmk='say "Process complete."'
|
alias lmk="say 'Process complete.'"
|
||||||
|
|
|
||||||
|
|
@ -1,4 +1,4 @@
|
||||||
# shellcheck shell=bash
|
cite 'about-alias'
|
||||||
about-alias 'phoenix abbreviations'
|
about-alias 'phoenix abbreviations'
|
||||||
|
|
||||||
# Phoenix Commands
|
# Phoenix Commands
|
||||||
|
|
|
||||||
|
|
@ -1,4 +1,4 @@
|
||||||
# shellcheck shell=bash
|
cite 'about-alias'
|
||||||
about-alias 'puppet aliases'
|
about-alias 'puppet aliases'
|
||||||
|
|
||||||
# Aliases
|
# Aliases
|
||||||
|
|
|
||||||
|
|
@ -1,4 +1,4 @@
|
||||||
# shellcheck shell=bash
|
cite 'about-alias'
|
||||||
about-alias 'pyrocms abbreviations'
|
about-alias 'pyrocms abbreviations'
|
||||||
|
|
||||||
###
|
###
|
||||||
|
|
@ -7,146 +7,146 @@ about-alias 'pyrocms abbreviations'
|
||||||
###
|
###
|
||||||
|
|
||||||
# general
|
# general
|
||||||
alias a:cl="php artisan clear-compiled" # Remove the compiled class file
|
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:d="php artisan down" # Put the application into maintenance mode
|
||||||
alias a:e="php artisan env" # Display the current framework environment
|
alias a:e="php artisan env" # Display the current framework environment
|
||||||
alias a:h="php artisan help" # Displays help for a command
|
alias a:h="php artisan help" # Displays help for a command
|
||||||
alias a:i="php artisan install" # Install the Streams Platform.
|
alias a:i="php artisan install" # Install the Streams Platform.
|
||||||
alias a:ls="php artisan list" # Lists commands
|
alias a:ls="php artisan list" # Lists commands
|
||||||
alias a:mg="php artisan migrate" # Run the database migrations
|
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: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: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:s="php artisan serve" # Serve the application on the PHP development server
|
||||||
alias a:u="php artisan up" # Bring the application out of maintenance mode
|
alias a:u="php artisan up" # Bring the application out of maintenance mode
|
||||||
|
|
||||||
# addon
|
# addon
|
||||||
alias a:ad:i="php artisan addon:install" # Install an addon.
|
alias a:ad:i="php artisan addon:install" # Install an addon.
|
||||||
alias a:ad:p="php artisan addon:publish" # Publish an the configuration and translations for an addon.
|
alias a:ad: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:r="php artisan addon:reinstall" # Reinstall an addon.
|
||||||
alias a:ad:u="php artisan addon:uninstall" # Uninstall an addon.
|
alias a:ad:u="php artisan addon:uninstall" # Uninstall an addon.
|
||||||
|
|
||||||
# app
|
# app
|
||||||
alias a:ap:n="php artisan app:name" # Set the application namespace
|
alias a:ap:n="php artisan app:name" # Set the application namespace
|
||||||
alias a:ap:p="php artisan app:publish" # Publish general application override files.
|
alias a:ap:p="php artisan app:publish" # Publish general application override files.
|
||||||
|
|
||||||
# assets
|
# assets
|
||||||
alias a:as:cl="php artisan assets:clear" # Clear compiled public assets.
|
alias a:as:cl="php artisan assets:clear" # Clear compiled public assets.
|
||||||
|
|
||||||
# auth
|
# auth
|
||||||
alias a:au:clrs="php artisan auth:clear-resets" # Flush expired password reset tokens
|
alias a:au:clrs="php artisan auth:clear-resets" # Flush expired password reset tokens
|
||||||
|
|
||||||
# cache
|
# cache
|
||||||
alias a:ca:cl="php artisan cache:clear" # Flush the application 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:f="php artisan cache:forget" # Remove an item from the cache
|
||||||
alias a:ca:t="php artisan cache:table" # Create a migration for the cache database table
|
alias a:ca:t="php artisan cache:table" # Create a migration for the cache database table
|
||||||
|
|
||||||
# config
|
# config
|
||||||
alias a:co:ca="php artisan config:cache" # Create a cache file for faster configuration loading
|
alias a:co:ca="php artisan config:cache" # Create a cache file for faster configuration loading
|
||||||
alias a:co:cl="php artisan config:clear" # Remove the configuration cache file
|
alias a:co:cl="php artisan config:clear" # Remove the configuration cache file
|
||||||
|
|
||||||
# db
|
# db
|
||||||
alias a:db:s="php artisan db:seed" # Seed the database with records
|
alias a:db:s="php artisan db:seed" # Seed the database with records
|
||||||
|
|
||||||
# env
|
# env
|
||||||
alias a:en:s="php artisan env:set" # Set an environmental value.
|
alias a:en:s="php artisan env:set" # Set an environmental value.
|
||||||
|
|
||||||
# event
|
# event
|
||||||
alias a:ev:g="php artisan event:generate" # Generate the missing events and listeners based on registration
|
alias a:ev:g="php artisan event:generate" # Generate the missing events and listeners based on registration
|
||||||
|
|
||||||
# extension
|
# extension
|
||||||
alias a:ex:i="php artisan extension:install" # Install a extension.
|
alias a:ex:i="php artisan extension:install" # Install a extension.
|
||||||
alias a:ex:r="php artisan extension:reinstall" # Reinstall a extension.
|
alias a:ex:r="php artisan extension:reinstall" # Reinstall a extension.
|
||||||
alias a:ex:u="php artisan extension:uninstall" # Uninstall a extension.
|
alias a:ex:u="php artisan extension:uninstall" # Uninstall a extension.
|
||||||
|
|
||||||
# files
|
# files
|
||||||
alias a:fi:cl="php artisan files:clean" # Clean missing files from the files table.
|
alias a:fi:cl="php artisan files:clean" # Clean missing files from the files table.
|
||||||
|
|
||||||
# key
|
# key
|
||||||
alias a:ke:g="php artisan key:generate" # Set the application key
|
alias a:ke:g="php artisan key:generate" # Set the application key
|
||||||
|
|
||||||
# make
|
# make
|
||||||
alias a:mk:ad="php artisan make:addon" # Create a new addon.
|
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: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: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: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: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: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: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: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: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: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: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: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: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: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: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: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: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: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: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:st="php artisan make:stream" # Make a streams entity namespace.
|
||||||
alias a:mk:ts="php artisan make:test" # Create a new test class
|
alias a:mk:ts="php artisan make:test" # Create a new test class
|
||||||
|
|
||||||
# migrate
|
# migrate
|
||||||
alias a:mg:fr="php artisan migrate:fresh" # Drop all tables and re-run all migrations
|
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: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: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: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:rl="php artisan migrate:rollback" # Rollback the last database migration
|
||||||
alias a:mg:st="php artisan migrate:status" # Show the status of each migration
|
alias a:mg:st="php artisan migrate:status" # Show the status of each migration
|
||||||
|
|
||||||
# module
|
# module
|
||||||
alias a:mo:i="php artisan module:install" # Install a module.
|
alias a:mo:i="php artisan module:install" # Install a module.
|
||||||
alias a:mo:r="php artisan module:reinstall" # Reinstall a module.
|
alias a:mo:r="php artisan module:reinstall" # Reinstall a module.
|
||||||
alias a:mo:u="php artisan module:uninstall" # Uninstall a module.
|
alias a:mo:u="php artisan module:uninstall" # Uninstall a module.
|
||||||
|
|
||||||
# notifications
|
# notifications
|
||||||
alias a:no:tb="php artisan notifications:table" # Create a migration for the notifications table
|
alias a:no:tb="php artisan notifications:table" # Create a migration for the notifications table
|
||||||
|
|
||||||
# package
|
# package
|
||||||
alias a:pk:d="php artisan package:discover" # Rebuild the cached package manifest
|
alias a:pk:d="php artisan package:discover" # Rebuild the cached package manifest
|
||||||
|
|
||||||
# queue
|
# queue
|
||||||
alias a:qu:fa="php artisan queue:failed" # List all of the failed queue jobs
|
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: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: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: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: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: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: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:tb="php artisan queue:table" # Create a migration for the queue jobs database table
|
||||||
alias a:qu:w="php artisan queue:work" # Start processing jobs on the queue as a daemon
|
alias a:qu:w="php artisan queue:work" # Start processing jobs on the queue as a daemon
|
||||||
|
|
||||||
# route
|
# route
|
||||||
alias a:ro:ca="php artisan route:cache" # Create a route cache file for faster route registration
|
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:cl="php artisan route:clear" # Remove the route cache file
|
||||||
alias a:ro:ls="php artisan route:list" # List all registered routes
|
alias a:ro:ls="php artisan route:list" # List all registered routes
|
||||||
|
|
||||||
# schedule
|
# schedule
|
||||||
alias a:sc:r="php artisan schedule:run" # Run the scheduled commands
|
alias a:sc:r="php artisan schedule:run" # Run the scheduled commands
|
||||||
|
|
||||||
# scout
|
# scout
|
||||||
alias a:su:fl="php artisan scout:flush" # Flush all of the model's records from the index
|
alias a:su:fl="php artisan scout:flush" # Flush all of the model's records from the index
|
||||||
alias a:su:im="php artisan scout:import" # Import the given model into the search index
|
alias a:su:im="php artisan scout:import" # Import the given model into the search index
|
||||||
|
|
||||||
# session
|
# session
|
||||||
alias a:se:tb="php artisan session:table" # Create a migration for the session database table
|
alias a:se:tb="php artisan session:table" # Create a migration for the session database table
|
||||||
|
|
||||||
# storage
|
# storage
|
||||||
alias a:sg:l="php artisan storage:link" # Create a symbolic link from "public/storage" to "storage/app/public"
|
alias a:sg:l="php artisan storage:link" # Create a symbolic link from "public/storage" to "storage/app/public"
|
||||||
|
|
||||||
# streams
|
# streams
|
||||||
alias a:st:cl="php artisan streams:cleanup" # Cleanup streams entry models.
|
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:co="php artisan streams:compile" # Compile streams entry models.
|
||||||
alias a:st:d="php artisan streams:destroy" # Destroy a namespace.
|
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:p="php artisan streams:publish" # Publish configuration and translations for streams.
|
||||||
alias a:st:r="php artisan streams:refresh" # Refresh streams generated components.
|
alias a:st:r="php artisan streams:refresh" # Refresh streams generated components.
|
||||||
|
|
||||||
# tntsearch
|
# tntsearch
|
||||||
alias a:tn:im="php artisan tntsearch:import" # Import the given model into the search index
|
alias a:tn:im="php artisan tntsearch:import" # Import the given model into the search index
|
||||||
|
|
||||||
# vendor
|
# vendor
|
||||||
alias a:ve:p="php artisan vendor:publish" # Publish any publishable assets from vendor packages
|
alias a:ve:p="php artisan vendor:publish" # Publish any publishable assets from vendor packages
|
||||||
|
|
||||||
# view
|
# view
|
||||||
alias a:vi:cl="php artisan view:clear" # Clear all compiled view files
|
alias a:vi:cl="php artisan view:clear" # Clear all compiled view files
|
||||||
|
|
|
||||||
|
|
@ -1,4 +1,4 @@
|
||||||
# shellcheck shell=bash
|
cite 'about-alias'
|
||||||
about-alias 'rails abbreviations'
|
about-alias 'rails abbreviations'
|
||||||
|
|
||||||
# Rails Commands
|
# Rails Commands
|
||||||
|
|
@ -14,9 +14,9 @@ alias rd='rails destroy'
|
||||||
alias dbm='rake db:migrate'
|
alias dbm='rake db:migrate'
|
||||||
|
|
||||||
alias ss='script/server'
|
alias ss='script/server'
|
||||||
alias ts="thin start" # thin server
|
alias ts="thin start" # thin server
|
||||||
alias sc='script/console'
|
alias sc='script/console'
|
||||||
alias restartapp='touch tmp/restart.txt'
|
alias restartapp='touch tmp/restart.txt'
|
||||||
alias restart='touch tmp/restart.txt' # restart passenger
|
alias restart='touch tmp/restart.txt' # restart passenger
|
||||||
alias devlog='tail -f log/development.log'
|
alias devlog='tail -f log/development.log'
|
||||||
alias taild='tail -f log/development.log' # tail dev log
|
alias taild='tail -f log/development.log' # tail dev log
|
||||||
|
|
|
||||||
|
|
@ -1,4 +1,4 @@
|
||||||
# shellcheck shell=bash
|
cite 'about-alias'
|
||||||
about-alias 'common svn abbreviations'
|
about-alias 'common svn abbreviations'
|
||||||
|
|
||||||
# Aliases
|
# Aliases
|
||||||
|
|
|
||||||
|
|
@ -1,22 +1,15 @@
|
||||||
# shellcheck shell=bash
|
cite 'about-alias'
|
||||||
about-alias 'systemd service'
|
about-alias 'systemd service'
|
||||||
|
|
||||||
case $OSTYPE in
|
case $OSTYPE in
|
||||||
linux*)
|
linux*)
|
||||||
# Improve aliases by bringing the common root `sc|scd` + `sre` for action + `u` for user
|
alias sc='systemctl'
|
||||||
alias sc='systemctl'
|
alias scr='systemctl daemon-reload'
|
||||||
alias scu='systemctl --user'
|
alias scu='systemctl --user'
|
||||||
alias scdr='systemctl daemon-reload'
|
alias scur='systemctl --user daemon-reload'
|
||||||
alias scdru='systemctl --user daemon-reload'
|
alias sce='systemctl stop'
|
||||||
alias scr='systemctl restart'
|
alias scue='systemctl --user stop'
|
||||||
alias scru='systemctl --user restart'
|
alias scs='systemctl start'
|
||||||
alias sce='systemctl stop'
|
alias scus='systemctl --user start'
|
||||||
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
|
esac
|
||||||
|
|
|
||||||
|
|
@ -1,9 +1,10 @@
|
||||||
# shellcheck shell=bash
|
# Aliases for Terraform and Terragrunt
|
||||||
about-alias 'Aliases for Terraform and Terragrunt'
|
|
||||||
|
cite 'about-alias'
|
||||||
|
about-alias 'Terraform abbreviations'
|
||||||
|
|
||||||
alias tf='terraform'
|
alias tf='terraform'
|
||||||
alias tfi='tf init'
|
|
||||||
alias tfv='terraform validate'
|
alias tfv='terraform validate'
|
||||||
alias tfp='terraform plan'
|
alias tfp='terraform plan'
|
||||||
alias tfa='terraform apply'
|
alias tfa='terraform apply'
|
||||||
alias tfd='terraform destroy'
|
alias tfd='terraform destory'
|
||||||
|
|
|
||||||
|
|
@ -1,5 +1,7 @@
|
||||||
# shellcheck shell=bash
|
# Aliases for Terraform and Terragrunt
|
||||||
about-alias 'Aliases for Terraform and Terragrunt'
|
|
||||||
|
cite 'about-alias'
|
||||||
|
about-alias 'Terragrunt abbreviations'
|
||||||
|
|
||||||
alias tg='terragrunt'
|
alias tg='terragrunt'
|
||||||
alias tgv='terragrunt validate'
|
alias tgv='terragrunt validate'
|
||||||
|
|
|
||||||
|
|
@ -1,10 +1,10 @@
|
||||||
# shellcheck shell=bash
|
cite 'about-alias'
|
||||||
about-alias 'textmate abbreviations'
|
about-alias 'textmate abbreviations'
|
||||||
|
|
||||||
case $OSTYPE in
|
case $OSTYPE in
|
||||||
darwin*)
|
darwin*)
|
||||||
# Textmate
|
# Textmate
|
||||||
alias e='mate . &'
|
alias e='mate . &'
|
||||||
alias et='mate app config db lib public script test spec config.ru Gemfile Rakefile README &'
|
alias et='mate app config db lib public script test spec config.ru Gemfile Rakefile README &'
|
||||||
;;
|
;;
|
||||||
esac
|
esac
|
||||||
|
|
|
||||||
|
|
@ -1,4 +1,4 @@
|
||||||
# shellcheck shell=bash
|
cite 'about-alias'
|
||||||
about-alias 'Tmux terminal multiplexer'
|
about-alias 'Tmux terminal multiplexer'
|
||||||
|
|
||||||
alias txl='tmux ls'
|
alias txl='tmux ls'
|
||||||
|
|
|
||||||
|
|
@ -1,8 +1,8 @@
|
||||||
# shellcheck shell=bash
|
cite 'about-alias'
|
||||||
about-alias 'todo.txt-cli abbreviations'
|
about-alias 'todo.txt-cli abbreviations'
|
||||||
|
|
||||||
alias tls='"${TODO?}" ls'
|
alias tls="$TODO ls"
|
||||||
alias ta='"${TODO?}" a'
|
alias ta="$TODO a"
|
||||||
alias trm='"${TODO?}" rm'
|
alias trm="$TODO rm"
|
||||||
alias tdo='"${TODO?}" do'
|
alias tdo="$TODO do"
|
||||||
alias tpri='"${TODO?}" pri'
|
alias tpri="$TODO pri"
|
||||||
|
|
|
||||||
|
|
@ -1,11 +1,11 @@
|
||||||
# shellcheck shell=bash
|
cite 'uuid-alias'
|
||||||
about-alias 'uuidgen aliases'
|
about-alias 'uuidgen aliases'
|
||||||
|
|
||||||
if _command_exists uuid; then # Linux
|
if _command_exists uuid; then # Linux
|
||||||
alias uuidu="uuid | tr '[:lower:]' '[:upper:]'"
|
alias uuidu="uuid | tr '[:lower:]' '[:upper:]'"
|
||||||
alias uuidl=uuid
|
alias uuidl=uuid
|
||||||
elif _command_exists uuidgen; then # macOS/BSD
|
elif _command_exists uuidgen; then # macOS/BSD
|
||||||
alias uuidu="uuidgen"
|
alias uuidu="uuidgen"
|
||||||
alias uuid="uuidgen | tr '[:upper:]' '[:lower:]'" # because upper case is like YELLING
|
alias uuid="uuidgen | tr '[:upper:]' '[:lower:]'" # because upper case is like YELLING
|
||||||
alias uuidl=uuid
|
alias uuidl=uuid
|
||||||
fi
|
fi
|
||||||
|
|
|
||||||
|
|
@ -1,4 +1,4 @@
|
||||||
# shellcheck shell=bash
|
cite 'about-alias'
|
||||||
about-alias 'vagrant aliases'
|
about-alias 'vagrant aliases'
|
||||||
|
|
||||||
# Aliases
|
# Aliases
|
||||||
|
|
|
||||||
|
|
@ -1,4 +1,4 @@
|
||||||
# shellcheck shell=bash
|
cite 'about-alias'
|
||||||
about-alias 'vault aliases'
|
about-alias 'vault aliases'
|
||||||
|
|
||||||
# Aliases
|
# Aliases
|
||||||
|
|
|
||||||
|
|
@ -1,14 +1,25 @@
|
||||||
# shellcheck shell=bash
|
# shellcheck shell=bash
|
||||||
|
cite 'about-alias'
|
||||||
about-alias 'vim abbreviations'
|
about-alias 'vim abbreviations'
|
||||||
|
|
||||||
_command_exists vim || return
|
VIM=$(command -v vim)
|
||||||
|
GVIM=$(command -v gvim)
|
||||||
|
MVIM=$(command -v mvim)
|
||||||
|
|
||||||
alias v='vim'
|
if [[ -n $VIM ]]; then
|
||||||
# open the vim help in fullscreen incorporated from
|
alias v='$VIM'
|
||||||
# https://stackoverflow.com/a/4687513
|
# open the vim help in fullscreen incorporated from
|
||||||
alias vimh='vim -c ":h | only"'
|
# https://stackoverflow.com/a/4687513
|
||||||
|
alias vimh='${VIM} -c ":h | only"'
|
||||||
|
fi
|
||||||
|
|
||||||
# open vim in new tab is taken from
|
# open vim in new tab is taken from
|
||||||
# http://stackoverflow.com/questions/936501/let-gvim-always-run-a-single-instancek
|
# http://stackoverflow.com/questions/936501/let-gvim-always-run-a-single-instancek
|
||||||
_command_exists mvim && function mvimt { command mvim --remote-tab-silent "$@" || command mvim "$@"; }
|
case $OSTYPE in
|
||||||
_command_exists gvim && function gvimt { command gvim --remote-tab-silent "$@" || command gvim "$@"; }
|
darwin*)
|
||||||
|
[[ -n $MVIM ]] && function mvimt { command mvim --remote-tab-silent "$@" || command mvim "$@"; }
|
||||||
|
;;
|
||||||
|
*)
|
||||||
|
[[ -n $GVIM ]] && function gvimt { command gvim --remote-tab-silent "$@" || command gvim "$@"; }
|
||||||
|
;;
|
||||||
|
esac
|
||||||
|
|
|
||||||
|
|
@ -1,4 +1,4 @@
|
||||||
# shellcheck shell=bash
|
cite 'about-alias'
|
||||||
about-alias 'yarn package manager aliases'
|
about-alias 'yarn package manager aliases'
|
||||||
|
|
||||||
# Aliases
|
# Aliases
|
||||||
|
|
|
||||||
165
bash_it.sh
165
bash_it.sh
|
|
@ -1,110 +1,159 @@
|
||||||
#!/usr/bin/env bash
|
#!/usr/bin/env bash
|
||||||
# shellcheck source-path=SCRIPTDIR/lib source-path=SCRIPTDIR/scripts
|
|
||||||
# shellcheck disable=SC2034
|
|
||||||
#
|
|
||||||
# Initialize Bash It
|
# Initialize Bash It
|
||||||
BASH_IT_LOG_PREFIX="core: main: "
|
BASH_IT_LOG_PREFIX="core: main: "
|
||||||
: "${BASH_IT:=${BASH_SOURCE%/*}}"
|
|
||||||
: "${BASH_IT_CUSTOM:=${BASH_IT}/custom}"
|
# Only set $BASH_IT if it's not already set
|
||||||
: "${CUSTOM_THEME_DIR:="${BASH_IT_CUSTOM}/themes"}"
|
if [ -z "$BASH_IT" ]; then
|
||||||
: "${BASH_IT_BASHRC:=${BASH_SOURCE[${#BASH_SOURCE[@]} - 1]}}"
|
# Setting $BASH to maintain backwards compatibility
|
||||||
|
export BASH_IT=$BASH
|
||||||
|
BASH="$(bash -c 'echo $BASH')"
|
||||||
|
export BASH
|
||||||
|
BASH_IT_OLD_BASH_SETUP=true
|
||||||
|
fi
|
||||||
|
|
||||||
# Load composure first, so we support function metadata
|
# Load composure first, so we support function metadata
|
||||||
# shellcheck source-path=SCRIPTDIR/vendor/github.com/erichs/composure
|
# shellcheck disable=SC1090
|
||||||
source "${BASH_IT}/vendor/github.com/erichs/composure/composure.sh"
|
source "${BASH_IT}"/vendor/github.com/erichs/composure/composure.sh
|
||||||
|
|
||||||
|
# We need to load logging module first as well in order to be able to log
|
||||||
|
# shellcheck source=./lib/log.bash
|
||||||
|
source "${BASH_IT}/lib/log.bash"
|
||||||
|
|
||||||
|
# We can only log it now
|
||||||
|
[ -z "$BASH_IT_OLD_BASH_SETUP" ] || _log_warning "BASH_IT variable not initialized, please upgrade your bash-it version and reinstall it!"
|
||||||
|
|
||||||
|
# For backwards compatibility, look in old BASH_THEME location
|
||||||
|
if [ -z "$BASH_IT_THEME" ]; then
|
||||||
|
_log_warning "BASH_IT_THEME variable not initialized, please upgrade your bash-it version and reinstall it!"
|
||||||
|
export BASH_IT_THEME="$BASH_THEME"
|
||||||
|
unset BASH_THEME
|
||||||
|
fi
|
||||||
|
|
||||||
# support 'plumbing' metadata
|
# support 'plumbing' metadata
|
||||||
cite _about _param _example _group _author _version
|
cite _about _param _example _group _author _version
|
||||||
cite about-alias about-plugin about-completion
|
cite about-alias about-plugin about-completion
|
||||||
|
|
||||||
# Declare our end-of-main finishing hook, but don't use `declare`/`typeset`
|
|
||||||
_bash_it_library_finalize_hook=()
|
|
||||||
|
|
||||||
# We need to load logging module early in order to be able to log
|
|
||||||
source "${BASH_IT}/lib/log.bash"
|
|
||||||
|
|
||||||
# libraries, but skip appearance (themes) for now
|
# libraries, but skip appearance (themes) for now
|
||||||
_log_debug "Loading libraries(except appearance)..."
|
_log_debug "Loading libraries(except appearance)..."
|
||||||
|
LIB="${BASH_IT}/lib/*.bash"
|
||||||
APPEARANCE_LIB="${BASH_IT}/lib/appearance.bash"
|
APPEARANCE_LIB="${BASH_IT}/lib/appearance.bash"
|
||||||
for _bash_it_main_file_lib in "${BASH_IT}/lib"/*.bash; do
|
for _bash_it_config_file in $LIB; do
|
||||||
[[ "$_bash_it_main_file_lib" == "$APPEARANCE_LIB" ]] && continue
|
if [ "$_bash_it_config_file" != "$APPEARANCE_LIB" ]; then
|
||||||
_bash-it-log-prefix-by-path "${_bash_it_main_file_lib}"
|
filename=${_bash_it_config_file##*/}
|
||||||
_log_debug "Loading library file..."
|
filename=${filename%.bash}
|
||||||
# shellcheck disable=SC1090
|
BASH_IT_LOG_PREFIX="lib: ${filename}: "
|
||||||
source "$_bash_it_main_file_lib"
|
_log_debug "Loading library file..."
|
||||||
BASH_IT_LOG_PREFIX="core: main: "
|
# shellcheck disable=SC1090
|
||||||
|
source "$_bash_it_config_file"
|
||||||
|
fi
|
||||||
done
|
done
|
||||||
|
|
||||||
# Load the global "enabled" directory, then enabled aliases, completion, plugins
|
# Load vendors
|
||||||
# "_bash_it_main_file_type" param is empty so that files get sourced in glob order
|
BASH_IT_LOG_PREFIX="vendor: "
|
||||||
for _bash_it_main_file_type in "" "aliases" "plugins" "completion"; do
|
for _bash_it_vendor_init in "${BASH_IT}"/vendor/init.d/*.bash; do
|
||||||
BASH_IT_LOG_PREFIX="core: reloader: "
|
_log_debug "Loading \"$(basename "${_bash_it_vendor_init}" .bash)\"..."
|
||||||
# shellcheck disable=SC2140
|
# shellcheck disable=SC1090
|
||||||
source "${BASH_IT}/scripts/reloader.bash" ${_bash_it_main_file_type:+"skip" "$_bash_it_main_file_type"}
|
source "${_bash_it_vendor_init}"
|
||||||
BASH_IT_LOG_PREFIX="core: main: "
|
done
|
||||||
|
unset _bash_it_vendor_init
|
||||||
|
|
||||||
|
BASH_IT_LOG_PREFIX="core: main: "
|
||||||
|
# Load the global "enabled" directory
|
||||||
|
# "family" param is empty so that files get sources in glob order
|
||||||
|
# shellcheck source=./scripts/reloader.bash
|
||||||
|
source "${BASH_IT}/scripts/reloader.bash"
|
||||||
|
|
||||||
|
# Load enabled aliases, completion, plugins
|
||||||
|
for file_type in "aliases" "plugins" "completion"; do
|
||||||
|
# shellcheck source=./scripts/reloader.bash
|
||||||
|
source "${BASH_IT}/scripts/reloader.bash" "skip" "$file_type"
|
||||||
done
|
done
|
||||||
|
|
||||||
# Load theme, if a theme was set
|
# Load theme, if a theme was set
|
||||||
# shellcheck source-path=SCRIPTDIR/themes
|
if [[ -n "${BASH_IT_THEME}" ]]; then
|
||||||
if [[ -n "${BASH_IT_THEME:-}" ]]; then
|
_log_debug "Loading \"${BASH_IT_THEME}\" theme..."
|
||||||
_log_debug "Loading theme '${BASH_IT_THEME}'."
|
# Load colors and helpers first so they can be used in base theme
|
||||||
|
BASH_IT_LOG_PREFIX="themes: colors: "
|
||||||
|
# shellcheck source=./themes/colors.theme.bash
|
||||||
|
source "${BASH_IT}/themes/colors.theme.bash"
|
||||||
BASH_IT_LOG_PREFIX="themes: githelpers: "
|
BASH_IT_LOG_PREFIX="themes: githelpers: "
|
||||||
|
# shellcheck source=./themes/githelpers.theme.bash
|
||||||
source "${BASH_IT}/themes/githelpers.theme.bash"
|
source "${BASH_IT}/themes/githelpers.theme.bash"
|
||||||
BASH_IT_LOG_PREFIX="themes: p4helpers: "
|
BASH_IT_LOG_PREFIX="themes: p4helpers: "
|
||||||
|
# shellcheck source=./themes/p4helpers.theme.bash
|
||||||
source "${BASH_IT}/themes/p4helpers.theme.bash"
|
source "${BASH_IT}/themes/p4helpers.theme.bash"
|
||||||
|
BASH_IT_LOG_PREFIX="themes: command_duration: "
|
||||||
|
# shellcheck source=./themes/command_duration.theme.bash
|
||||||
|
source "${BASH_IT}/themes/command_duration.theme.bash"
|
||||||
BASH_IT_LOG_PREFIX="themes: base: "
|
BASH_IT_LOG_PREFIX="themes: base: "
|
||||||
|
# shellcheck source=./themes/base.theme.bash
|
||||||
source "${BASH_IT}/themes/base.theme.bash"
|
source "${BASH_IT}/themes/base.theme.bash"
|
||||||
|
|
||||||
BASH_IT_LOG_PREFIX="lib: appearance: "
|
BASH_IT_LOG_PREFIX="lib: appearance: "
|
||||||
# appearance (themes) now, after all dependencies
|
# appearance (themes) now, after all dependencies
|
||||||
# shellcheck source=SCRIPTDIR/lib/appearance.bash
|
# shellcheck source=./lib/appearance.bash
|
||||||
source "$APPEARANCE_LIB"
|
source "$APPEARANCE_LIB"
|
||||||
BASH_IT_LOG_PREFIX="core: main: "
|
|
||||||
fi
|
fi
|
||||||
|
|
||||||
|
BASH_IT_LOG_PREFIX="core: main: "
|
||||||
_log_debug "Loading custom aliases, completion, plugins..."
|
_log_debug "Loading custom aliases, completion, plugins..."
|
||||||
for _bash_it_main_file_type in "aliases" "completion" "plugins"; do
|
for file_type in "aliases" "completion" "plugins"; do
|
||||||
_bash_it_main_file_custom="${BASH_IT}/${_bash_it_main_file_type}/custom.${_bash_it_main_file_type}.bash"
|
if [ -e "${BASH_IT}/${file_type}/custom.${file_type}.bash" ]; then
|
||||||
if [[ -s "${_bash_it_main_file_custom}" ]]; then
|
BASH_IT_LOG_PREFIX="${file_type}: custom: "
|
||||||
_bash-it-log-prefix-by-path "${_bash_it_main_file_custom}"
|
|
||||||
_log_debug "Loading component..."
|
_log_debug "Loading component..."
|
||||||
# shellcheck disable=SC1090
|
# shellcheck disable=SC1090
|
||||||
source "${_bash_it_main_file_custom}"
|
source "${BASH_IT}/${file_type}/custom.${file_type}.bash"
|
||||||
fi
|
fi
|
||||||
BASH_IT_LOG_PREFIX="core: main: "
|
|
||||||
done
|
done
|
||||||
|
|
||||||
# Custom
|
# Custom
|
||||||
|
BASH_IT_LOG_PREFIX="core: main: "
|
||||||
_log_debug "Loading general custom files..."
|
_log_debug "Loading general custom files..."
|
||||||
for _bash_it_main_file_custom in "${BASH_IT_CUSTOM}"/*.bash "${BASH_IT_CUSTOM}"/*/*.bash; do
|
CUSTOM="${BASH_IT_CUSTOM:=${BASH_IT}/custom}/*.bash ${BASH_IT_CUSTOM:=${BASH_IT}/custom}/**/*.bash"
|
||||||
if [[ -s "${_bash_it_main_file_custom}" ]]; then
|
for _bash_it_config_file in $CUSTOM; do
|
||||||
_bash-it-log-prefix-by-path "${_bash_it_main_file_custom}"
|
if [ -e "${_bash_it_config_file}" ]; then
|
||||||
|
filename=$(basename "${_bash_it_config_file}")
|
||||||
|
filename=${filename%*.bash}
|
||||||
|
BASH_IT_LOG_PREFIX="custom: $filename: "
|
||||||
_log_debug "Loading custom file..."
|
_log_debug "Loading custom file..."
|
||||||
# shellcheck disable=SC1090
|
# shellcheck disable=SC1090
|
||||||
source "$_bash_it_main_file_custom"
|
source "$_bash_it_config_file"
|
||||||
fi
|
fi
|
||||||
BASH_IT_LOG_PREFIX="core: main: "
|
|
||||||
done
|
done
|
||||||
|
|
||||||
if [[ -n "${PROMPT:-}" ]]; then
|
unset _bash_it_config_file
|
||||||
PS1="${PROMPT}"
|
if [[ $PROMPT ]]; then
|
||||||
|
export PS1="\[""$PROMPT""\]"
|
||||||
fi
|
fi
|
||||||
|
|
||||||
# Adding Support for other OSes
|
# Adding Support for other OSes
|
||||||
if _command_exists gloobus-preview; then
|
PREVIEW="less"
|
||||||
|
|
||||||
|
if [ -s /usr/bin/gloobus-preview ]; then
|
||||||
PREVIEW="gloobus-preview"
|
PREVIEW="gloobus-preview"
|
||||||
elif [[ -d /Applications/Preview.app ]]; then
|
elif [ -s /Applications/Preview.app ]; then
|
||||||
|
# shellcheck disable=SC2034
|
||||||
PREVIEW="/Applications/Preview.app"
|
PREVIEW="/Applications/Preview.app"
|
||||||
else
|
fi
|
||||||
PREVIEW="less"
|
|
||||||
|
# Load all the Jekyll stuff
|
||||||
|
|
||||||
|
if [ -e "$HOME/.jekyllconfig" ]; then
|
||||||
|
# shellcheck disable=SC1090
|
||||||
|
. "$HOME/.jekyllconfig"
|
||||||
fi
|
fi
|
||||||
|
|
||||||
# BASH_IT_RELOAD_LEGACY is set.
|
# BASH_IT_RELOAD_LEGACY is set.
|
||||||
if [[ -n "${BASH_IT_RELOAD_LEGACY:-}" ]] && ! _command_exists reload; then
|
if ! command -v reload &> /dev/null && [ -n "$BASH_IT_RELOAD_LEGACY" ]; then
|
||||||
# shellcheck disable=SC2139
|
case $OSTYPE in
|
||||||
alias reload="builtin source '${BASH_IT_BASHRC?}'"
|
darwin*)
|
||||||
|
alias reload='source ~/.bash_profile'
|
||||||
|
;;
|
||||||
|
*)
|
||||||
|
alias reload='source ~/.bashrc'
|
||||||
|
;;
|
||||||
|
esac
|
||||||
fi
|
fi
|
||||||
|
|
||||||
for _bash_it_library_finalize_f in "${_bash_it_library_finalize_hook[@]:-}"; do
|
# Disable trap DEBUG on subshells - https://github.com/Bash-it/bash-it/pull/1040
|
||||||
eval "${_bash_it_library_finalize_f?}" # Use `eval` to achieve the same behavior as `$PROMPT_COMMAND`.
|
set +T
|
||||||
done
|
|
||||||
unset "${!_bash_it_library_finalize_@}" "${!_bash_it_main_file_@}"
|
|
||||||
|
|
|
||||||
159
clean_files.txt
159
clean_files.txt
|
|
@ -1,7 +1,7 @@
|
||||||
#######################################################################
|
#######################################################################
|
||||||
# Allow-list of files to be lint-checked by CI
|
# Allow-list of files to be lint-checked by CI
|
||||||
#
|
#
|
||||||
# Directory Support
|
# Directory Suport
|
||||||
# Directory references are allowed within the file, ie:
|
# Directory references are allowed within the file, ie:
|
||||||
#
|
#
|
||||||
# themes/powerline
|
# themes/powerline
|
||||||
|
|
@ -16,53 +16,71 @@
|
||||||
|
|
||||||
# root directories
|
# root directories
|
||||||
#
|
#
|
||||||
aliases/
|
docs
|
||||||
docs/
|
hooks
|
||||||
hooks/
|
|
||||||
scripts/
|
|
||||||
|
|
||||||
# root files
|
# root files
|
||||||
#
|
#
|
||||||
.gitattributes
|
.gitattributes
|
||||||
bash_it.sh
|
|
||||||
clean_files.txt
|
|
||||||
install.sh
|
|
||||||
lint_clean_files.sh
|
lint_clean_files.sh
|
||||||
|
install.sh
|
||||||
|
bash_it.sh
|
||||||
|
|
||||||
|
# themes
|
||||||
|
#
|
||||||
|
themes/agnoster
|
||||||
|
themes/90210
|
||||||
|
themes/powerline
|
||||||
|
themes/barbuk
|
||||||
|
themes/atomic
|
||||||
|
themes/axin
|
||||||
|
themes/base.theme.bash
|
||||||
|
themes/bakke
|
||||||
|
themes/binaryanomaly
|
||||||
|
themes/bira
|
||||||
|
themes/bobby
|
||||||
|
themes/bobby-python
|
||||||
|
themes/brainy
|
||||||
|
themes/brunton
|
||||||
|
themes/command_duration.theme.bash
|
||||||
|
themes/modern
|
||||||
|
|
||||||
|
# plugins
|
||||||
|
#
|
||||||
|
plugins/available/basher.plugin.bash
|
||||||
|
plugins/available/cmd-returned-notify.plugin.bash
|
||||||
|
plugins/available/docker-machine.plugin.bash
|
||||||
|
plugins/available/git.plugin.bash
|
||||||
|
plugins/available/go.plugin.bash
|
||||||
|
plugins/available/goenv.plugin.bash
|
||||||
|
plugins/available/history.plugin.bash
|
||||||
|
plugins/available/history-search.plugin.bash
|
||||||
|
plugins/available/history-substring-search.plugin.bash
|
||||||
|
plugins/available/xterm.plugin.bash
|
||||||
|
|
||||||
# completions
|
# completions
|
||||||
#
|
#
|
||||||
completion/available/apm.completion.bash
|
completion/available/apm.completion.bash
|
||||||
completion/available/awless.completion.bash
|
completion/available/awless.completion.bash
|
||||||
completion/available/awscli.completion.bash
|
|
||||||
completion/available/bash-it.completion.bash
|
|
||||||
completion/available/brew.completion.bash
|
completion/available/brew.completion.bash
|
||||||
completion/available/cargo.completion.bash
|
completion/available/cargo.completion.bash
|
||||||
completion/available/composer.completion.bash
|
completion/available/composer.completion.bash
|
||||||
completion/available/conda.completion.bash
|
completion/available/conda.completion.bash
|
||||||
completion/available/consul.completion.bash
|
completion/available/consul.completion.bash
|
||||||
completion/available/dart.completion.bash
|
|
||||||
completion/available/django.completion.bash
|
completion/available/django.completion.bash
|
||||||
completion/available/dmidecode.completion.bash
|
|
||||||
completion/available/docker-machine.completion.bash
|
|
||||||
completion/available/docker.completion.bash
|
completion/available/docker.completion.bash
|
||||||
completion/available/dotnet.completion.bash
|
completion/available/docker-machine.completion.bash
|
||||||
completion/available/flutter.completion.bash
|
|
||||||
completion/available/gcloud.completion.bash
|
completion/available/gcloud.completion.bash
|
||||||
completion/available/gem.completion.bash
|
completion/available/gem.completion.bash
|
||||||
completion/available/git.completion.bash
|
|
||||||
completion/available/github-cli.completion.bash
|
|
||||||
completion/available/go.completion.bash
|
completion/available/go.completion.bash
|
||||||
|
completion/available/github-cli.completion.bash
|
||||||
completion/available/helm.completion.bash
|
completion/available/helm.completion.bash
|
||||||
completion/available/jboss5.completion.bash
|
|
||||||
completion/available/jboss7.completion.bash
|
|
||||||
completion/available/jungle.completion.bash
|
completion/available/jungle.completion.bash
|
||||||
completion/available/knife.completion.bash
|
completion/available/knife.completion.bash
|
||||||
completion/available/kontena.completion.bash
|
completion/available/kontena.completion.bash
|
||||||
completion/available/kubectl.completion.bash
|
completion/available/kubectl.completion.bash
|
||||||
completion/available/laravel.completion.bash
|
|
||||||
completion/available/lerna.completion.bash
|
completion/available/lerna.completion.bash
|
||||||
completion/available/minikube.completion.bash
|
completion/available/minikube.completion.bash
|
||||||
completion/available/ngrok.completion.bash
|
|
||||||
completion/available/notify-send.completion.bash
|
completion/available/notify-send.completion.bash
|
||||||
completion/available/npm.completion.bash
|
completion/available/npm.completion.bash
|
||||||
completion/available/packer.completion.bash
|
completion/available/packer.completion.bash
|
||||||
|
|
@ -71,106 +89,19 @@ completion/available/pip3.completion.bash
|
||||||
completion/available/pipenv.completion.bash
|
completion/available/pipenv.completion.bash
|
||||||
completion/available/pipx.completion.bash
|
completion/available/pipx.completion.bash
|
||||||
completion/available/rustup.completion.bash
|
completion/available/rustup.completion.bash
|
||||||
completion/available/sdkman.completion.bash
|
|
||||||
completion/available/system.completion.bash
|
|
||||||
completion/available/vault.completion.bash
|
completion/available/vault.completion.bash
|
||||||
|
completion/available/sdkman.completion.bash
|
||||||
completion/available/vuejs.completion.bash
|
completion/available/vuejs.completion.bash
|
||||||
completion/available/wpscan.completion.bash
|
|
||||||
completion/available/yarn.completion.bash
|
|
||||||
|
|
||||||
# libraries
|
# aliases
|
||||||
lib/appearance.bash
|
|
||||||
lib/colors.bash
|
|
||||||
lib/command_duration.bash
|
|
||||||
lib/helpers.bash
|
|
||||||
lib/history.bash
|
|
||||||
lib/log.bash
|
|
||||||
lib/preexec.bash
|
|
||||||
lib/preview.bash
|
|
||||||
lib/search.bash
|
|
||||||
lib/utilities.bash
|
|
||||||
|
|
||||||
# plugins
|
|
||||||
#
|
#
|
||||||
plugins/available/alias-completion.plugin.bash
|
aliases/available/dnf.aliases.bash
|
||||||
plugins/available/autojump.plugin.bash
|
aliases/available/vim.aliases.bash
|
||||||
plugins/available/base.plugin.bash
|
aliases/available/git.aliases.bash
|
||||||
plugins/available/basher.plugin.bash
|
|
||||||
plugins/available/battery.plugin.bash
|
|
||||||
plugins/available/blesh.plugin.bash
|
|
||||||
plugins/available/cmd-returned-notify.plugin.bash
|
|
||||||
plugins/available/colors.plugin.bash
|
|
||||||
plugins/available/direnv.plugin.bash
|
|
||||||
plugins/available/dirs.plugin.bash
|
|
||||||
plugins/available/docker-machine.plugin.bash
|
|
||||||
plugins/available/gif.plugin.bash
|
|
||||||
plugins/available/git-subrepo.plugin.bash
|
|
||||||
plugins/available/git.plugin.bash
|
|
||||||
plugins/available/go.plugin.bash
|
|
||||||
plugins/available/goenv.plugin.bash
|
|
||||||
plugins/available/history-eternal.plugin.bash
|
|
||||||
plugins/available/history-search.plugin.bash
|
|
||||||
plugins/available/history-substring-search.plugin.bash
|
|
||||||
plugins/available/history.plugin.bash
|
|
||||||
plugins/available/hub.plugin.bash
|
|
||||||
plugins/available/java.plugin.bash
|
|
||||||
plugins/available/jekyll.plugin.bash
|
|
||||||
plugins/available/jump.plugin.bash
|
|
||||||
plugins/available/latex.plugin.bash
|
|
||||||
plugins/available/less-pretty-cat.plugin.bash
|
|
||||||
plugins/available/man.plugin.bash
|
|
||||||
plugins/available/nginx.plugin.bash
|
|
||||||
plugins/available/node.plugin.bash
|
|
||||||
plugins/available/nodenv.plugin.bash
|
|
||||||
plugins/available/osx-timemachine.plugin.bash
|
|
||||||
plugins/available/osx.plugin.bash
|
|
||||||
plugins/available/percol.plugin.bash
|
|
||||||
plugins/available/plenv.plugin.bash
|
|
||||||
plugins/available/projects.plugin.bash
|
|
||||||
plugins/available/proxy.plugin.bash
|
|
||||||
plugins/available/pyenv.plugin.bash
|
|
||||||
plugins/available/python.plugin.bash
|
|
||||||
plugins/available/rbenv.plugin.bash
|
|
||||||
plugins/available/ruby.plugin.bash
|
|
||||||
plugins/available/textmate.plugin.bash
|
|
||||||
plugins/available/todo.plugin.bash
|
|
||||||
plugins/available/xterm.plugin.bash
|
|
||||||
plugins/available/zoxide.plugin.bash
|
|
||||||
|
|
||||||
# tests
|
# tests
|
||||||
#
|
|
||||||
test/completion/aliases.completion.bats
|
|
||||||
test/run
|
|
||||||
test/test_helper.bash
|
test/test_helper.bash
|
||||||
|
|
||||||
# themes
|
|
||||||
#
|
|
||||||
themes/90210
|
|
||||||
themes/agnoster
|
|
||||||
themes/atomic
|
|
||||||
themes/axin
|
|
||||||
themes/bakke
|
|
||||||
themes/barbuk
|
|
||||||
themes/base.theme.bash
|
|
||||||
themes/binaryanomaly
|
|
||||||
themes/bira
|
|
||||||
themes/bobby
|
|
||||||
themes/bobby-python
|
|
||||||
themes/brainy
|
|
||||||
themes/brunton
|
|
||||||
themes/candy
|
|
||||||
themes/easy
|
|
||||||
themes/essential
|
|
||||||
themes/githelpers.theme.bash
|
|
||||||
themes/modern
|
|
||||||
themes/norbu
|
|
||||||
themes/oh-my-posh
|
|
||||||
themes/p4helpers.theme.bash
|
|
||||||
themes/pete
|
|
||||||
themes/powerline
|
|
||||||
themes/pure
|
|
||||||
themes/purity
|
|
||||||
|
|
||||||
# vendor init files
|
# vendor init files
|
||||||
#
|
|
||||||
vendor/.gitattributes
|
vendor/.gitattributes
|
||||||
|
vendor/init.d
|
||||||
|
|
|
||||||
|
|
@ -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,5 +1 @@
|
||||||
# shellcheck shell=bash
|
[[ -x "$(which aws_completer)" ]] && complete -C "$(which aws_completer)" aws
|
||||||
|
|
||||||
if _command_exists aws_completer; then
|
|
||||||
complete -C "$(command -v aws_completer)" aws
|
|
||||||
fi
|
|
||||||
|
|
|
||||||
|
|
@ -1,95 +1,140 @@
|
||||||
# shellcheck shell=bash
|
#!/usr/bin/env bash
|
||||||
|
|
||||||
function _compreply_candidates() {
|
_bash-it-comp-enable-disable()
|
||||||
local IFS=$'\n'
|
{
|
||||||
|
local enable_disable_args="alias completion plugin"
|
||||||
read -d '' -ra COMPREPLY < <(compgen -W "${candidates[*]}" -- "${cur}")
|
COMPREPLY=( $(compgen -W "${enable_disable_args}" -- ${cur}) )
|
||||||
}
|
}
|
||||||
|
|
||||||
function _bash-it() {
|
_bash-it-comp-list-available-not-enabled()
|
||||||
local cur prev verb file_type candidates suffix
|
{
|
||||||
COMPREPLY=()
|
subdirectory="$1"
|
||||||
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
|
local available_things
|
||||||
fi
|
|
||||||
;;
|
available_things=$(for f in `compgen -G "${BASH_IT}/$subdirectory/available/*.bash" | sort -d`;
|
||||||
save | list) ;;
|
do
|
||||||
*)
|
file_entity=$(basename $f)
|
||||||
candidates=('load' 'save' 'list' 'rm')
|
|
||||||
_compreply_candidates
|
typeset enabled_component=$(command ls "${BASH_IT}/$subdirectory/enabled/"{[0-9]*$BASH_IT_LOAD_PRIORITY_SEPARATOR$file_entity,$file_entity} 2>/dev/null | head -1)
|
||||||
;;
|
typeset enabled_component_global=$(command ls "${BASH_IT}/enabled/"[0-9]*$BASH_IT_LOAD_PRIORITY_SEPARATOR$file_entity 2>/dev/null | head -1)
|
||||||
esac
|
|
||||||
;;
|
if [ -z "$enabled_component" ] && [ -z "$enabled_component_global" ]
|
||||||
doctor)
|
then
|
||||||
candidates=('errors' 'warnings' 'all')
|
basename $f | sed -e 's/\(.*\)\..*\.bash/\1/g'
|
||||||
_compreply_candidates
|
fi
|
||||||
;;
|
done)
|
||||||
update)
|
|
||||||
if [[ "${cur}" == -* ]]; then
|
COMPREPLY=( $(compgen -W "all ${available_things}" -- ${cur}) )
|
||||||
candidates=('-s' '--silent')
|
}
|
||||||
else
|
|
||||||
candidates=('stable' 'dev')
|
_bash-it-comp-list-enabled()
|
||||||
fi
|
{
|
||||||
_compreply_candidates
|
local subdirectory="$1"
|
||||||
;;
|
local suffix enabled_things
|
||||||
migrate | reload | restart | search | version) ;;
|
|
||||||
preview)
|
suffix=$(echo "$subdirectory" | sed -e 's/plugins/plugin/g')
|
||||||
_bash-it-preview # completes itself
|
|
||||||
return 0
|
enabled_things=$(for f in `sort -d <(compgen -G "${BASH_IT}/$subdirectory/enabled/*.${suffix}.bash") <(compgen -G "${BASH_IT}/enabled/*.${suffix}.bash")`;
|
||||||
;;
|
do
|
||||||
enable | disable)
|
basename $f | sed -e 's/\(.*\)\..*\.bash/\1/g' | sed -e "s/^[0-9]*---//g"
|
||||||
if [[ "${verb}" == "enable" ]]; then
|
done)
|
||||||
suffix="disabled"
|
|
||||||
else
|
COMPREPLY=( $(compgen -W "all ${enabled_things}" -- ${cur}) )
|
||||||
suffix="enabled"
|
}
|
||||||
fi
|
|
||||||
case "${file_type}" in
|
_bash-it-comp-list-available()
|
||||||
alias | completion | plugin)
|
{
|
||||||
candidates=('all' "$("_bash-it-component-list-${suffix}" "${file_type}")")
|
subdirectory="$1"
|
||||||
_compreply_candidates
|
|
||||||
;;
|
local enabled_things
|
||||||
*)
|
|
||||||
candidates=('alias' 'completion' 'plugin')
|
enabled_things=$(for f in `compgen -G "${BASH_IT}/$subdirectory/available/*.bash" | sort -d`;
|
||||||
_compreply_candidates
|
do
|
||||||
;;
|
basename $f | sed -e 's/\(.*\)\..*\.bash/\1/g'
|
||||||
esac
|
done)
|
||||||
;;
|
|
||||||
*)
|
COMPREPLY=( $(compgen -W "${enabled_things}" -- ${cur}) )
|
||||||
_compreply_candidates
|
}
|
||||||
;;
|
|
||||||
esac
|
_bash-it-comp()
|
||||||
|
{
|
||||||
|
local cur prev opts
|
||||||
|
COMPREPLY=()
|
||||||
|
cur="${COMP_WORDS[COMP_CWORD]}"
|
||||||
|
prev="${COMP_WORDS[COMP_CWORD-1]}"
|
||||||
|
chose_opt="${COMP_WORDS[1]}"
|
||||||
|
file_type="${COMP_WORDS[2]}"
|
||||||
|
opts="disable enable help migrate reload restart doctor search show update version"
|
||||||
|
case "${chose_opt}" in
|
||||||
|
show)
|
||||||
|
local show_args="aliases completions plugins"
|
||||||
|
COMPREPLY=( $(compgen -W "${show_args}" -- ${cur}) )
|
||||||
|
return 0
|
||||||
|
;;
|
||||||
|
help)
|
||||||
|
if [ x"${prev}" == x"aliases" ]; then
|
||||||
|
_bash-it-comp-list-available aliases
|
||||||
|
return 0
|
||||||
|
else
|
||||||
|
local help_args="aliases completions migrate plugins update"
|
||||||
|
COMPREPLY=( $(compgen -W "${help_args}" -- ${cur}) )
|
||||||
|
return 0
|
||||||
|
fi
|
||||||
|
;;
|
||||||
|
doctor)
|
||||||
|
local doctor_args="errors warnings all"
|
||||||
|
COMPREPLY=( $(compgen -W "${doctor_args}" -- ${cur}) )
|
||||||
|
return 0
|
||||||
|
;;
|
||||||
|
update)
|
||||||
|
if [[ ${cur} == -* ]];then
|
||||||
|
local update_args="-s --silent"
|
||||||
|
else
|
||||||
|
local update_args="stable dev"
|
||||||
|
fi
|
||||||
|
COMPREPLY=( $(compgen -W "${update_args}" -- ${cur}) )
|
||||||
|
return 0
|
||||||
|
;;
|
||||||
|
migrate | reload | search | version)
|
||||||
|
return 0
|
||||||
|
;;
|
||||||
|
enable | disable)
|
||||||
|
if [ x"${chose_opt}" == x"enable" ];then
|
||||||
|
suffix="available-not-enabled"
|
||||||
|
else
|
||||||
|
suffix="enabled"
|
||||||
|
fi
|
||||||
|
case "${file_type}" in
|
||||||
|
alias)
|
||||||
|
_bash-it-comp-list-${suffix} aliases
|
||||||
|
return 0
|
||||||
|
;;
|
||||||
|
plugin)
|
||||||
|
_bash-it-comp-list-${suffix} plugins
|
||||||
|
return 0
|
||||||
|
;;
|
||||||
|
completion)
|
||||||
|
_bash-it-comp-list-${suffix} completion
|
||||||
|
return 0
|
||||||
|
;;
|
||||||
|
*)
|
||||||
|
_bash-it-comp-enable-disable
|
||||||
|
return 0
|
||||||
|
;;
|
||||||
|
esac
|
||||||
|
;;
|
||||||
|
esac
|
||||||
|
|
||||||
|
COMPREPLY=( $(compgen -W "${opts}" -- ${cur}) )
|
||||||
|
|
||||||
|
return 0
|
||||||
}
|
}
|
||||||
|
|
||||||
# Activate completion for bash-it and its common misspellings
|
# Activate completion for bash-it and its common misspellings
|
||||||
complete -F _bash-it bash-it
|
complete -F _bash-it-comp bash-it
|
||||||
complete -F _bash-it bash-ti
|
complete -F _bash-it-comp bash-ti
|
||||||
complete -F _bash-it shit
|
complete -F _bash-it-comp shit
|
||||||
complete -F _bash-it bashit
|
complete -F _bash-it-comp bashit
|
||||||
complete -F _bash-it batshit
|
complete -F _bash-it-comp batshit
|
||||||
complete -F _bash-it bash_it
|
complete -F _bash-it-comp bash_it
|
||||||
|
|
|
||||||
|
|
@ -5,26 +5,28 @@ about-completion "brew completion"
|
||||||
# Load late to make sure `system` completion loads first
|
# Load late to make sure `system` completion loads first
|
||||||
# BASH_IT_LOAD_PRIORITY: 375
|
# BASH_IT_LOAD_PRIORITY: 375
|
||||||
|
|
||||||
if [[ "$OSTYPE" != 'darwin'* ]]; then
|
if [[ "$(uname -s)" != 'Darwin' ]]; then
|
||||||
_log_warning "unsupported operating system - only 'Darwin' is supported"
|
_log_warning "unsupported operating system - only 'Darwin' is supported"
|
||||||
return 0
|
return 0
|
||||||
fi
|
fi
|
||||||
|
|
||||||
# Make sure brew is installed
|
# Make sure brew is installed
|
||||||
_bash_it_homebrew_check || return 0
|
_command_exists brew || return 0
|
||||||
|
|
||||||
if [[ -r "$BASH_IT_HOMEBREW_PREFIX/etc/bash_completion.d/brew" ]]; then
|
BREW_PREFIX=${BREW_PREFIX:-$(brew --prefix)}
|
||||||
# shellcheck disable=1090,1091
|
|
||||||
source "$BASH_IT_HOMEBREW_PREFIX/etc/bash_completion.d/brew"
|
|
||||||
|
|
||||||
elif [[ -r "$BASH_IT_HOMEBREW_PREFIX/Library/Contributions/brew_bash_completion.sh" ]]; then
|
if [[ -r "$BREW_PREFIX"/etc/bash_completion.d/brew ]]; then
|
||||||
# shellcheck disable=1090,1091
|
# shellcheck disable=1090
|
||||||
source "$BASH_IT_HOMEBREW_PREFIX/Library/Contributions/brew_bash_completion.sh"
|
source "$BREW_PREFIX"/etc/bash_completion.d/brew
|
||||||
|
|
||||||
elif [[ -f "$BASH_IT_HOMEBREW_PREFIX/completions/bash/brew" ]]; then
|
elif [[ -r "$BREW_PREFIX"/Library/Contributions/brew_bash_completion.sh ]]; then
|
||||||
|
# shellcheck disable=1090
|
||||||
|
source "$BREW_PREFIX"/Library/Contributions/brew_bash_completion.sh
|
||||||
|
|
||||||
|
elif [[ -f "$BREW_PREFIX"/completions/bash/brew ]]; then
|
||||||
# For the git-clone based installation, see here for more info:
|
# For the git-clone based installation, see here for more info:
|
||||||
# https://github.com/Bash-it/bash-it/issues/1458
|
# https://github.com/Bash-it/bash-it/issues/1458
|
||||||
# https://docs.brew.sh/Shell-Completion
|
# https://docs.brew.sh/Shell-Completion
|
||||||
# shellcheck disable=1090,1091
|
# shellcheck disable=1090
|
||||||
source "$BASH_IT_HOMEBREW_PREFIX/completions/bash/brew"
|
source "$BREW_PREFIX"/completions/bash/brew
|
||||||
fi
|
fi
|
||||||
|
|
|
||||||
|
|
@ -3,14 +3,14 @@ cite "about-completion"
|
||||||
about-completion "composer completion"
|
about-completion "composer completion"
|
||||||
|
|
||||||
function __composer_completion() {
|
function __composer_completion() {
|
||||||
local cur coms opts com words
|
local cur coms opts com
|
||||||
COMPREPLY=()
|
COMPREPLY=()
|
||||||
_get_comp_words_by_ref -n : cur words
|
_get_comp_words_by_ref -n : cur words
|
||||||
|
|
||||||
# lookup for command
|
# lookup for command
|
||||||
for word in "${words[@]:1}"; do
|
for word in "${words[@]:1}"; do
|
||||||
if [[ "${word}" != -* ]]; then
|
if [[ $word != -* ]]; then
|
||||||
com="${word}"
|
com=$word
|
||||||
break
|
break
|
||||||
fi
|
fi
|
||||||
done
|
done
|
||||||
|
|
@ -19,7 +19,7 @@ function __composer_completion() {
|
||||||
if [[ ${cur} == --* ]]; then
|
if [[ ${cur} == --* ]]; then
|
||||||
opts="--help --quiet --verbose --version --ansi --no-ansi --no-interaction --profile --no-plugins --working-dir"
|
opts="--help --quiet --verbose --version --ansi --no-ansi --no-interaction --profile --no-plugins --working-dir"
|
||||||
|
|
||||||
case "${com}" in
|
case "$com" in
|
||||||
about)
|
about)
|
||||||
opts="${opts} "
|
opts="${opts} "
|
||||||
;;
|
;;
|
||||||
|
|
@ -109,18 +109,18 @@ function __composer_completion() {
|
||||||
|
|
||||||
# shellcheck disable=SC2207
|
# shellcheck disable=SC2207
|
||||||
COMPREPLY=($(compgen -W "${opts}" -- "${cur}"))
|
COMPREPLY=($(compgen -W "${opts}" -- "${cur}"))
|
||||||
__ltrim_colon_completions "${cur}"
|
__ltrim_colon_completions "$cur"
|
||||||
|
|
||||||
return 0
|
return 0
|
||||||
fi
|
fi
|
||||||
|
|
||||||
# completing for a command
|
# completing for a command
|
||||||
if [[ "${cur}" == "${com}" ]]; then
|
if [[ "$cur" == "$com" ]]; then
|
||||||
coms="about archive browse clear-cache config create-project depends diagnose dump-autoload exec global help init install licenses list outdated prohibits remove require run-script search self-update show status suggests update validate"
|
coms="about archive browse clear-cache config create-project depends diagnose dump-autoload exec global help init install licenses list outdated prohibits remove require run-script search self-update show status suggests update validate"
|
||||||
|
|
||||||
# shellcheck disable=SC2207
|
# shellcheck disable=SC2207
|
||||||
COMPREPLY=($(compgen -W "${coms}" -- "${cur}"))
|
COMPREPLY=($(compgen -W "${coms}" -- "${cur}"))
|
||||||
__ltrim_colon_completions "${cur}"
|
__ltrim_colon_completions "$cur"
|
||||||
|
|
||||||
return 0
|
return 0
|
||||||
fi
|
fi
|
||||||
|
|
|
||||||
|
|
@ -3,5 +3,5 @@ cite "about-completion"
|
||||||
about-completion "Hashicorp consul completion"
|
about-completion "Hashicorp consul completion"
|
||||||
|
|
||||||
if _command_exists consul; then
|
if _command_exists consul; then
|
||||||
complete -C "$(command -v consul)" consul
|
complete -C "$(which consul)" consul
|
||||||
fi
|
fi
|
||||||
|
|
|
||||||
|
|
@ -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 +1,175 @@
|
||||||
# shellcheck shell=bash
|
# defaults
|
||||||
|
# Bash command line completion for defaults
|
||||||
|
#
|
||||||
|
# Created by Jonathon Mah on 2006-11-08.
|
||||||
|
# Copyright 2006 Playhaus. All rights reserved.
|
||||||
|
#
|
||||||
|
# Version 1.0 (2006-11-08)
|
||||||
|
|
||||||
if test -s "${BASH_IT?}/vendor/github.com/gaelicWizard/bash-progcomp/defaults.completion.bash"; then
|
|
||||||
source "$_"
|
_defaults_domains()
|
||||||
fi
|
{
|
||||||
|
local cur
|
||||||
|
COMPREPLY=()
|
||||||
|
cur=${COMP_WORDS[COMP_CWORD]}
|
||||||
|
|
||||||
|
local domains=$( defaults domains | sed -e 's/, /:/g' | tr : '\n' | sed -e 's/ /\\ /g' | grep -i "^$cur" )
|
||||||
|
local IFS=$'\n'
|
||||||
|
COMPREPLY=( $domains )
|
||||||
|
if [[ $( echo '-app' | grep "^$cur" ) ]]; then
|
||||||
|
COMPREPLY[${#COMPREPLY[@]}]="-app"
|
||||||
|
fi
|
||||||
|
|
||||||
|
return 0
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
_defaults()
|
||||||
|
{
|
||||||
|
local cur prev host_opts cmds cmd domain keys key_index
|
||||||
|
cur=${COMP_WORDS[COMP_CWORD]}
|
||||||
|
prev=${COMP_WORDS[COMP_CWORD-1]}
|
||||||
|
|
||||||
|
host_opts='-currentHost -host'
|
||||||
|
cmds='read read-type write rename delete domains find help'
|
||||||
|
|
||||||
|
if [[ $COMP_CWORD -eq 1 ]]; then
|
||||||
|
COMPREPLY=( $( compgen -W "$host_opts $cmds" -- $cur ) )
|
||||||
|
return 0
|
||||||
|
elif [[ $COMP_CWORD -eq 2 ]]; then
|
||||||
|
if [[ "$prev" == "-currentHost" ]]; then
|
||||||
|
COMPREPLY=( $( compgen -W "$cmds" -- $cur ) )
|
||||||
|
return 0
|
||||||
|
elif [[ "$prev" == "-host" ]]; then
|
||||||
|
return 0
|
||||||
|
_known_hosts -a
|
||||||
|
else
|
||||||
|
_defaults_domains
|
||||||
|
return 0
|
||||||
|
fi
|
||||||
|
elif [[ $COMP_CWORD -eq 3 ]]; then
|
||||||
|
if [[ ${COMP_WORDS[1]} == "-host" ]]; then
|
||||||
|
_defaults_domains
|
||||||
|
return 0
|
||||||
|
fi
|
||||||
|
fi
|
||||||
|
|
||||||
|
# Both a domain and command have been specified
|
||||||
|
|
||||||
|
if [[ ${COMP_WORDS[1]} == [${cmds// /|}] ]]; then
|
||||||
|
cmd=${COMP_WORDS[1]}
|
||||||
|
domain=${COMP_WORDS[2]}
|
||||||
|
key_index=3
|
||||||
|
if [[ "$domain" == "-app" ]]; then
|
||||||
|
if [[ $COMP_CWORD -eq 3 ]]; then
|
||||||
|
# Completing application name. Can't help here, sorry
|
||||||
|
return 0
|
||||||
|
fi
|
||||||
|
domain="-app ${COMP_WORDS[3]}"
|
||||||
|
key_index=4
|
||||||
|
fi
|
||||||
|
elif [[ ${COMP_WORDS[2]} == "-currentHost" ]] && [[ ${COMP_WORDS[2]} == [${cmds// /|}] ]]; then
|
||||||
|
cmd=${COMP_WORDS[2]}
|
||||||
|
domain=${COMP_WORDS[3]}
|
||||||
|
key_index=4
|
||||||
|
if [[ "$domain" == "-app" ]]; then
|
||||||
|
if [[ $COMP_CWORD -eq 4 ]]; then
|
||||||
|
# Completing application name. Can't help here, sorry
|
||||||
|
return 0
|
||||||
|
fi
|
||||||
|
domain="-app ${COMP_WORDS[4]}"
|
||||||
|
key_index=5
|
||||||
|
fi
|
||||||
|
elif [[ ${COMP_WORDS[3]} == "-host" ]] && [[ ${COMP_WORDS[3]} == [${cmds// /|}] ]]; then
|
||||||
|
cmd=${COMP_WORDS[3]}
|
||||||
|
domain=${COMP_WORDS[4]}
|
||||||
|
key_index=5
|
||||||
|
if [[ "$domain" == "-app" ]]; then
|
||||||
|
if [[ $COMP_CWORD -eq 5 ]]; then
|
||||||
|
# Completing application name. Can't help here, sorry
|
||||||
|
return 0
|
||||||
|
fi
|
||||||
|
domain="-app ${COMP_WORDS[5]}"
|
||||||
|
key_index=6
|
||||||
|
fi
|
||||||
|
fi
|
||||||
|
|
||||||
|
keys=$( defaults read $domain 2>/dev/null | sed -n -e '/^ [^}) ]/p' | sed -e 's/^ \([^" ]\{1,\}\) = .*$/\1/g' -e 's/^ "\([^"]\{1,\}\)" = .*$/\1/g' | sed -e 's/ /\\ /g' )
|
||||||
|
|
||||||
|
case $cmd in
|
||||||
|
read|read-type)
|
||||||
|
# Complete key
|
||||||
|
local IFS=$'\n'
|
||||||
|
COMPREPLY=( $( echo "$keys" | grep -i "^${cur//\\/\\\\}" ) )
|
||||||
|
;;
|
||||||
|
write)
|
||||||
|
if [[ $key_index -eq $COMP_CWORD ]]; then
|
||||||
|
# Complete key
|
||||||
|
local IFS=$'\n'
|
||||||
|
COMPREPLY=( $( echo "$keys" | grep -i "^${cur//\\/\\\\}" ) )
|
||||||
|
elif [[ $((key_index+1)) -eq $COMP_CWORD ]]; then
|
||||||
|
# Complete value type
|
||||||
|
# Unfortunately ${COMP_WORDS[key_index]} fails on keys with spaces
|
||||||
|
local value_types='-string -data -integer -float -boolean -date -array -array-add -dict -dict-add'
|
||||||
|
local cur_type=$( defaults read-type $domain ${COMP_WORDS[key_index]} 2>/dev/null | sed -e 's/^Type is \(.*\)/-\1/' -e's/dictionary/dict/' | grep "^$cur" )
|
||||||
|
if [[ $cur_type ]]; then
|
||||||
|
COMPREPLY=( $cur_type )
|
||||||
|
else
|
||||||
|
COMPREPLY=( $( compgen -W "$value_types" -- $cur ) )
|
||||||
|
fi
|
||||||
|
elif [[ $((key_index+2)) -eq $COMP_CWORD ]]; then
|
||||||
|
# Complete value
|
||||||
|
# Unfortunately ${COMP_WORDS[key_index]} fails on keys with spaces
|
||||||
|
COMPREPLY=( $( defaults read $domain ${COMP_WORDS[key_index]} 2>/dev/null | grep -i "^${cur//\\/\\\\}" ) )
|
||||||
|
fi
|
||||||
|
;;
|
||||||
|
rename)
|
||||||
|
if [[ $key_index -eq $COMP_CWORD ]] ||
|
||||||
|
[[ $((key_index+1)) -eq $COMP_CWORD ]]; then
|
||||||
|
# Complete source and destination keys
|
||||||
|
local IFS=$'\n'
|
||||||
|
COMPREPLY=( $( echo "$keys" | grep -i "^${cur//\\/\\\\}" ) )
|
||||||
|
fi
|
||||||
|
;;
|
||||||
|
delete)
|
||||||
|
if [[ $key_index -eq $COMP_CWORD ]]; then
|
||||||
|
# Complete key
|
||||||
|
local IFS=$'\n'
|
||||||
|
COMPREPLY=( $( echo "$keys" | grep -i "^${cur//\\/\\\\}" ) )
|
||||||
|
fi
|
||||||
|
;;
|
||||||
|
esac
|
||||||
|
|
||||||
|
return 0
|
||||||
|
}
|
||||||
|
|
||||||
|
complete -F _defaults -o default defaults
|
||||||
|
|
||||||
|
|
||||||
|
# This file is licensed under the BSD license, as follows:
|
||||||
|
#
|
||||||
|
# Copyright (c) 2006, Playhaus
|
||||||
|
# All rights reserved.
|
||||||
|
#
|
||||||
|
# Redistribution and use in source and binary forms, with or without
|
||||||
|
# modification, are permitted provided that the following conditions are met:
|
||||||
|
#
|
||||||
|
# * Redistributions of source code must retain the above copyright notice, this
|
||||||
|
# list of conditions and the following disclaimer.
|
||||||
|
# * Redistributions in binary form must reproduce the above copyright notice,
|
||||||
|
# this list of conditions and the following disclaimer in the documentation
|
||||||
|
# and/or other materials provided with the distribution.
|
||||||
|
# * Neither the name of the Playhaus nor the names of its contributors may be
|
||||||
|
# used to endorse or promote products derived from this software without
|
||||||
|
# specific prior written permission.
|
||||||
|
#
|
||||||
|
# This software is provided by the copyright holders and contributors "as is"
|
||||||
|
# and any express or implied warranties, including, but not limited to, the
|
||||||
|
# implied warranties of merchantability and fitness for a particular purpose are
|
||||||
|
# disclaimed. In no event shall the copyright owner or contributors be liable
|
||||||
|
# for any direct, indirect, incidental, special, exemplary, or consequential
|
||||||
|
# damages (including, but not limited to, procurement of substitute goods or
|
||||||
|
# services; loss of use, data, or profits; or business interruption) however
|
||||||
|
# caused and on any theory of liability, whether in contract, strict liability,
|
||||||
|
# or tort (including negligence or otherwise) arising in any way out of the use
|
||||||
|
# of this software, even if advised of the possibility of such damage.
|
||||||
|
|
|
||||||
|
|
@ -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
|
|
||||||
|
|
@ -676,7 +676,7 @@ _docker_compose() {
|
||||||
done
|
done
|
||||||
|
|
||||||
local completions_func=_docker_compose_${command//-/_}
|
local completions_func=_docker_compose_${command//-/_}
|
||||||
_is_function $completions_func && $completions_func
|
declare -F $completions_func >/dev/null && $completions_func
|
||||||
|
|
||||||
eval "$previous_extglob_setting"
|
eval "$previous_extglob_setting"
|
||||||
return 0
|
return 0
|
||||||
|
|
|
||||||
|
|
@ -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,4 +1,4 @@
|
||||||
# shellcheck shell=bash
|
#!/usr/bin/env bash
|
||||||
#
|
#
|
||||||
# Bash completion support for Fabric (http://fabfile.org/)
|
# Bash completion support for Fabric (http://fabfile.org/)
|
||||||
#
|
#
|
||||||
|
|
@ -41,8 +41,8 @@ export FAB_COMPLETION_CACHED_TASKS_FILENAME=".fab_tasks~"
|
||||||
|
|
||||||
|
|
||||||
# Set command to get time of last file modification as seconds since Epoch
|
# Set command to get time of last file modification as seconds since Epoch
|
||||||
case "$OSTYPE" in
|
case `uname` in
|
||||||
'darwin'*|'freebsd'*)
|
Darwin|FreeBSD)
|
||||||
__FAB_COMPLETION_MTIME_COMMAND="stat -f '%m'"
|
__FAB_COMPLETION_MTIME_COMMAND="stat -f '%m'"
|
||||||
;;
|
;;
|
||||||
*)
|
*)
|
||||||
|
|
@ -91,7 +91,7 @@ function __fab_completion() {
|
||||||
-*)
|
-*)
|
||||||
if [[ -z "${__FAB_COMPLETION_LONG_OPT}" ]]; then
|
if [[ -z "${__FAB_COMPLETION_LONG_OPT}" ]]; then
|
||||||
export __FAB_COMPLETION_LONG_OPT=$(
|
export __FAB_COMPLETION_LONG_OPT=$(
|
||||||
fab --help | grep -E -o "\-\-[A-Za-z_\-]+\=?" | sort -u)
|
fab --help | egrep -o "\-\-[A-Za-z_\-]+\=?" | sort -u)
|
||||||
fi
|
fi
|
||||||
opts="${__FAB_COMPLETION_LONG_OPT}"
|
opts="${__FAB_COMPLETION_LONG_OPT}"
|
||||||
;;
|
;;
|
||||||
|
|
@ -101,7 +101,7 @@ function __fab_completion() {
|
||||||
# -*)
|
# -*)
|
||||||
# if [[ -z "${__FAB_COMPLETION_SHORT_OPT}" ]]; then
|
# if [[ -z "${__FAB_COMPLETION_SHORT_OPT}" ]]; then
|
||||||
# export __FAB_COMPLETION_SHORT_OPT=$(
|
# export __FAB_COMPLETION_SHORT_OPT=$(
|
||||||
# fab --help | grep -E -o "^ +\-[A-Za-z_\]" | sort -u)
|
# fab --help | egrep -o "^ +\-[A-Za-z_\]" | sort -u)
|
||||||
# fi
|
# fi
|
||||||
# opts="${__FAB_COMPLETION_SHORT_OPT}"
|
# opts="${__FAB_COMPLETION_SHORT_OPT}"
|
||||||
# ;;
|
# ;;
|
||||||
|
|
|
||||||
|
|
@ -1,5 +1,5 @@
|
||||||
# shellcheck shell=bash
|
#!/usr/bin/bash
|
||||||
|
|
||||||
if _command_exists flutter; then
|
if _command_exists flutter; then
|
||||||
eval "$(flutter bash-completion)"
|
eval "$(flutter bash-completion)"
|
||||||
fi
|
fi
|
||||||
|
|
|
||||||
|
|
@ -1,42 +1,39 @@
|
||||||
# shellcheck shell=bash
|
#!/usr/bin/env bash
|
||||||
#
|
|
||||||
# Locate and load completions for `git`.
|
# Only operate on MacOS since there are no linux paths
|
||||||
|
if [[ "$(uname -s)" != 'Darwin' ]] ; then
|
||||||
|
_log_warning "unsupported operating system - only 'Darwin' is supported"
|
||||||
|
return 0
|
||||||
|
fi
|
||||||
|
|
||||||
# Make sure git is installed
|
# Make sure git is installed
|
||||||
_command_exists git || return
|
_command_exists git || return 0
|
||||||
|
|
||||||
# Don't handle completion if it's already managed
|
# Don't handle completion if it's already managed
|
||||||
if complete -p git &> /dev/null; then
|
if complete -p git &>/dev/null ; then
|
||||||
_log_warning "completion already loaded - this usually means it is safe to stop using this completion"
|
_log_warning "completion already loaded - this usually means it is safe to stop using this completion"
|
||||||
return 0
|
return 0
|
||||||
fi
|
fi
|
||||||
|
|
||||||
_git_bash_completion_xcrun_git=
|
_git_bash_completion_found=false
|
||||||
if _command_exists xcrun; then
|
|
||||||
_git_bash_completion_xcrun_git="$(xcrun --find git)"
|
|
||||||
fi
|
|
||||||
_git_bash_completion_paths=(
|
_git_bash_completion_paths=(
|
||||||
# Standard locations
|
# MacOS non-system locations
|
||||||
"${GIT_EXE%/*}/../share/git-core/git-completion.bash"
|
'/Library/Developer/CommandLineTools/usr/share/git-core/git-completion.bash'
|
||||||
"${GIT_EXE%/*}/../share/git-core/contrib/completion/git-completion.bash"
|
'/Applications/Xcode.app/Contents/Developer/usr/share/git-core/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
|
# Load the first completion file found
|
||||||
_git_bash_completion_found=false
|
for _comp_path in "${_git_bash_completion_paths[@]}" ; do
|
||||||
for _comp_path in "${_git_bash_completion_paths[@]}"; do
|
if [ -r "$_comp_path" ] ; then
|
||||||
if [[ -r "$_comp_path" ]]; then
|
_git_bash_completion_found=true
|
||||||
_git_bash_completion_found=true
|
source "$_comp_path"
|
||||||
# shellcheck disable=SC1090 # don't follow
|
break
|
||||||
source "$_comp_path"
|
fi
|
||||||
break
|
|
||||||
fi
|
|
||||||
done
|
done
|
||||||
|
|
||||||
# Cleanup
|
# Cleanup
|
||||||
if [[ "${_git_bash_completion_found}" == false ]]; then
|
if [[ "${_git_bash_completion_found}" == false ]]; then
|
||||||
_log_warning "no completion files found - please try enabling the 'system' completion instead."
|
_log_warning "no completion files found - please try enabling the 'system' completion instead."
|
||||||
fi
|
fi
|
||||||
unset "${!_git_bash_completion@}"
|
unset _git_bash_completion_paths
|
||||||
|
unset _git_bash_completion_found
|
||||||
|
|
|
||||||
|
|
@ -172,7 +172,6 @@ __git_flow_list_hotfixes ()
|
||||||
}
|
}
|
||||||
|
|
||||||
# temporarily wrap __git_find_on_cmdline() for backwards compatibility
|
# temporarily wrap __git_find_on_cmdline() for backwards compatibility
|
||||||
if ! _command_exists __git_find_subcommand
|
if [ -z "`type -t __git_find_subcommand`" ]; then
|
||||||
then
|
|
||||||
alias __git_find_subcommand=__git_find_on_cmdline
|
alias __git_find_subcommand=__git_find_on_cmdline
|
||||||
fi
|
fi
|
||||||
|
|
|
||||||
|
|
@ -505,7 +505,6 @@ __git_flow_list_branches ()
|
||||||
}
|
}
|
||||||
|
|
||||||
# alias __git_find_on_cmdline for backwards compatibility
|
# alias __git_find_on_cmdline for backwards compatibility
|
||||||
if ! _command_exists __git_find_on_cmdline
|
if [ -z "`type -t __git_find_on_cmdline`" ]; then
|
||||||
then
|
|
||||||
alias __git_find_on_cmdline=__git_find_subcommand
|
alias __git_find_on_cmdline=__git_find_subcommand
|
||||||
fi
|
fi
|
||||||
|
|
|
||||||
|
|
@ -1,5 +1,3 @@
|
||||||
# shellcheck shell=bash
|
|
||||||
|
|
||||||
# Copyright (c) 2017 Eric Wendelin
|
# Copyright (c) 2017 Eric Wendelin
|
||||||
|
|
||||||
# Permission is hereby granted, free of charge, to any person obtaining a copy of
|
# Permission is hereby granted, free of charge, to any person obtaining a copy of
|
||||||
|
|
@ -24,9 +22,17 @@
|
||||||
# Avoid inaccurate completions for subproject tasks
|
# Avoid inaccurate completions for subproject tasks
|
||||||
COMP_WORDBREAKS=$(echo "$COMP_WORDBREAKS" | sed -e 's/://g')
|
COMP_WORDBREAKS=$(echo "$COMP_WORDBREAKS" | sed -e 's/://g')
|
||||||
|
|
||||||
function __gradle-set-project-root-dir() {
|
__gradle-set-project-root-dir() {
|
||||||
project_root_dir="$(_bash-it-find-in-ancestor "settings.gradle" "gradlew")"
|
local dir=`pwd`
|
||||||
return "$?"
|
project_root_dir=`pwd`
|
||||||
|
while [[ $dir != '/' ]]; do
|
||||||
|
if [[ -f "$dir/settings.gradle" || -f "$dir/gradlew" ]]; then
|
||||||
|
project_root_dir=$dir
|
||||||
|
return 0
|
||||||
|
fi
|
||||||
|
dir="$(dirname "$dir")"
|
||||||
|
done
|
||||||
|
return 1
|
||||||
}
|
}
|
||||||
|
|
||||||
__gradle-init-cache-dir() {
|
__gradle-init-cache-dir() {
|
||||||
|
|
@ -52,9 +58,9 @@ __gradle-set-cache-name() {
|
||||||
|
|
||||||
__gradle-set-files-checksum() {
|
__gradle-set-files-checksum() {
|
||||||
# Cache MD5 sum of all Gradle scripts and modified timestamps
|
# Cache MD5 sum of all Gradle scripts and modified timestamps
|
||||||
if _command_exists md5; then
|
if builtin command -v md5 > /dev/null; then
|
||||||
gradle_files_checksum=$(md5 -q -s "$(cat "$cache_dir/$cache_name" | xargs ls -o 2>/dev/null)")
|
gradle_files_checksum=$(md5 -q -s "$(cat "$cache_dir/$cache_name" | xargs ls -o 2>/dev/null)")
|
||||||
elif _command_exists md5sum; then
|
elif builtin command -v md5sum > /dev/null; then
|
||||||
gradle_files_checksum=$(cat "$cache_dir/$cache_name" | xargs ls -o 2>/dev/null | md5sum | awk '{print $1}')
|
gradle_files_checksum=$(cat "$cache_dir/$cache_name" | xargs ls -o 2>/dev/null | md5sum | awk '{print $1}')
|
||||||
else
|
else
|
||||||
echo "Cannot generate completions as neither md5 nor md5sum exist on \$PATH"
|
echo "Cannot generate completions as neither md5 nor md5sum exist on \$PATH"
|
||||||
|
|
@ -68,7 +74,7 @@ __gradle-generate-script-cache() {
|
||||||
|
|
||||||
if [[ ! $(find $cache_dir/$cache_name -mmin -$cache_ttl_mins 2>/dev/null) ]]; then
|
if [[ ! $(find $cache_dir/$cache_name -mmin -$cache_ttl_mins 2>/dev/null) ]]; then
|
||||||
# Cache all Gradle scripts
|
# Cache all Gradle scripts
|
||||||
local gradle_build_scripts=$(find $project_root_dir -type f -name "*.gradle" -o -name "*.gradle.kts" 2>/dev/null | grep -E -v "$script_exclude_pattern")
|
local gradle_build_scripts=$(find $project_root_dir -type f -name "*.gradle" -o -name "*.gradle.kts" 2>/dev/null | egrep -v "$script_exclude_pattern")
|
||||||
printf "%s\n" "${gradle_build_scripts[@]}" > $cache_dir/$cache_name
|
printf "%s\n" "${gradle_build_scripts[@]}" > $cache_dir/$cache_name
|
||||||
fi
|
fi
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -23,12 +23,12 @@
|
||||||
# WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
|
# WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
|
||||||
|
|
||||||
# If there is no git tab completion, but we have the _completion loader try to load it
|
# If there is no git tab completion, but we have the _completion loader try to load it
|
||||||
if ! _is_function _git && _is_function _completion_loader; then
|
if ! declare -F _git > /dev/null && declare -F _completion_loader > /dev/null; then
|
||||||
_completion_loader git
|
_completion_loader git
|
||||||
fi
|
fi
|
||||||
|
|
||||||
# Check that git tab completion is available and we haven't already set up completion
|
# Check that git tab completion is available and we haven't already set up completion
|
||||||
if _is_function _git && ! _is_function __git_list_all_commands_without_hub; then
|
if declare -F _git > /dev/null && ! declare -F __git_list_all_commands_without_hub > /dev/null; then
|
||||||
# Duplicate and rename the 'list_all_commands' function
|
# Duplicate and rename the 'list_all_commands' function
|
||||||
eval "$(declare -f __git_list_all_commands | \
|
eval "$(declare -f __git_list_all_commands | \
|
||||||
sed 's/__git_list_all_commands/__git_list_all_commands_without_hub/')"
|
sed 's/__git_list_all_commands/__git_list_all_commands_without_hub/')"
|
||||||
|
|
@ -227,7 +227,7 @@ EOF
|
||||||
((c++))
|
((c++))
|
||||||
done
|
done
|
||||||
if [ -z "$name" ]; then
|
if [ -z "$name" ]; then
|
||||||
repo="$(basename "${PWD}")"
|
repo=$(basename "$(pwd)")
|
||||||
fi
|
fi
|
||||||
case "$prev" in
|
case "$prev" in
|
||||||
-d|-h)
|
-d|-h)
|
||||||
|
|
|
||||||
|
|
@ -1,4 +0,0 @@
|
||||||
# shellcheck shell=bash
|
|
||||||
about-completion "jboss5 completion"
|
|
||||||
# shellcheck disable=SC1090
|
|
||||||
source "${BASH_IT}"/vendor/github.com/rparree/jboss-bash-completion/jboss5
|
|
||||||
|
|
@ -1,4 +1,160 @@
|
||||||
# shellcheck shell=bash
|
# Completions for JBoss Application Server 7 (EAP 6)
|
||||||
about-completion "jboss7 completion"
|
# VERSION: 0.6
|
||||||
# shellcheck disable=SC1090
|
# DATE: 2012-10-30
|
||||||
source "${BASH_IT}"/vendor/github.com/rparree/jboss-bash-completion/jboss7
|
# rparree-at-edc4it-dot-com
|
||||||
|
|
||||||
|
# MIT License
|
||||||
|
|
||||||
|
# Copyright (c) 2020 Raphael Parree
|
||||||
|
|
||||||
|
# Permission is hereby granted, free of charge, to any person obtaining a copy
|
||||||
|
# of this software and associated documentation files (the "Software"), to deal
|
||||||
|
# in the Software without restriction, including without limitation the rights
|
||||||
|
# to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
||||||
|
# copies of the Software, and to permit persons to whom the Software is
|
||||||
|
# furnished to do so, subject to the following conditions:
|
||||||
|
|
||||||
|
# The above copyright notice and this permission notice shall be included in all
|
||||||
|
# copies or substantial portions of the Software.
|
||||||
|
|
||||||
|
# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
||||||
|
# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
||||||
|
# FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
||||||
|
# AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
||||||
|
# LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
||||||
|
# OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
||||||
|
# SOFTWARE.
|
||||||
|
|
||||||
|
_serverProfiles(){
|
||||||
|
if [[ $COMP_WORDS == *standalone.sh* ]]
|
||||||
|
then
|
||||||
|
serverdir="../standalone/configuration/"
|
||||||
|
else
|
||||||
|
# assume is domain.sh
|
||||||
|
serverdir="../domain/configuration/"
|
||||||
|
fi
|
||||||
|
|
||||||
|
for i in ${!COMP_WORDS[*]}
|
||||||
|
do
|
||||||
|
if [[ "${COMP_WORDS[i]}" == "-Djboss.server.base.dir" || "${COMP_WORDS[i]}" == "-Djboss.domain.base.dir" ]]; then
|
||||||
|
serverdir="${COMP_WORDS[i+2]}/configuration"
|
||||||
|
fi
|
||||||
|
|
||||||
|
done
|
||||||
|
if [ -d "${serverdir}" ]
|
||||||
|
then
|
||||||
|
|
||||||
|
IFS=$'\n' tmp="$(ls "${serverdir}" | grep xml)"
|
||||||
|
local fls="${tmp[@]// /\ }"
|
||||||
|
unset IFS
|
||||||
|
COMPREPLY=( $(compgen -W "${fls} initial boot last v" -- "$cur" ))
|
||||||
|
fi
|
||||||
|
}
|
||||||
|
|
||||||
|
_bindingAddress(){
|
||||||
|
# from /etc/bash_completion.d/ssh
|
||||||
|
COMPREPLY=( "${COMPREPLY[@]}" $( compgen -W \
|
||||||
|
"0.0.0.0 $( PATH="$PATH:/sbin" ifconfig -a | \
|
||||||
|
sed -ne 's/.*addr:\([^[:space:]]*\).*/\1/p' \
|
||||||
|
-ne 's/.*inet[[:space:]]\{1,\}\([^[:space:]]*\).*/\1/p' )" \
|
||||||
|
-- "$cur" ) )
|
||||||
|
}
|
||||||
|
|
||||||
|
_jboss(){
|
||||||
|
|
||||||
|
local cur prev words cword
|
||||||
|
COMPREPLY=()
|
||||||
|
_get_comp_words_by_ref -n = cur prev words cword
|
||||||
|
|
||||||
|
case $cur in
|
||||||
|
|
||||||
|
-Djboss.socket.binding.port-offset=*)
|
||||||
|
cur=${cur#*=}
|
||||||
|
#static list of common bindings sets
|
||||||
|
local bindings="100 200 300 400 10000 20000 30000 40000"
|
||||||
|
COMPREPLY=( $(compgen -W "${bindings}" -- ${cur}) )
|
||||||
|
return 0
|
||||||
|
;;
|
||||||
|
-Djboss.default.jgroups.stack=*)
|
||||||
|
cur=${cur#*=}
|
||||||
|
#static list of standard JGroups stacks
|
||||||
|
local stacks="udp udp-async udp-sync tcp tcp-sync"
|
||||||
|
COMPREPLY=( $(compgen -W "${stacks}" -- ${cur}) )
|
||||||
|
return 0
|
||||||
|
;;
|
||||||
|
|
||||||
|
-Dorg.jboss.ejb3.remoting.IsLocalInterceptor.passByRef=*|-Dcom.sun.management.jmxremote.authenticate=*|-Dcom.sun.management.jmxremote.ssl=*)
|
||||||
|
cur=${cur#*=}
|
||||||
|
local booleans="true false"
|
||||||
|
COMPREPLY=( $(compgen -W "${booleans}" -- ${cur}) )
|
||||||
|
return 0
|
||||||
|
;;
|
||||||
|
|
||||||
|
-Djboss.server.base.dir=*|-Djboss.home.dir=*|-Djboss.domain.base.dir=*)
|
||||||
|
cur=${cur#*=}
|
||||||
|
_filedir -d
|
||||||
|
return 0
|
||||||
|
;;
|
||||||
|
|
||||||
|
-Djboss.domain.master.address=*|-Djboss.bind.address*=*)
|
||||||
|
cur=${cur#*=}
|
||||||
|
_bindingAddress
|
||||||
|
return 0
|
||||||
|
;;
|
||||||
|
--server-config=*|-c=|--host-config=*)
|
||||||
|
cur=${cur#*=}
|
||||||
|
_serverProfiles
|
||||||
|
return 0
|
||||||
|
|
||||||
|
|
||||||
|
esac
|
||||||
|
|
||||||
|
|
||||||
|
case $prev in
|
||||||
|
-u)
|
||||||
|
# a few from RFC 2365 IPv4 Local Scope ()
|
||||||
|
local addresses="239.255.0.1 239.255.0.2 239.255.0.3"
|
||||||
|
COMPREPLY=( $(compgen -W "${addresses}" -- ${cur}) )
|
||||||
|
return 0
|
||||||
|
;;
|
||||||
|
-b*)
|
||||||
|
_bindingAddress
|
||||||
|
return 0
|
||||||
|
;;
|
||||||
|
-c)
|
||||||
|
_serverProfiles
|
||||||
|
return 0
|
||||||
|
;;
|
||||||
|
*)
|
||||||
|
;;
|
||||||
|
esac
|
||||||
|
# *** from jboss5 ********************
|
||||||
|
# *** -modulepath -c -m -g -l -d -p -n -B -L -C -Djboss.platform.mbeanserver -Djboss.server.base.directory
|
||||||
|
# *** -Djboss.Domain -Djboss.modcluster.proxyList -Djboss.jvmRoute -Djboss.default.jgroups.stack -Dorg.jboss.ejb3.remoting.IsLocalInterceptor.passByRef -Djboss.platform.mbeanserver -Dcom.sun.management.jmxremote.port -Dcom.sun.management.jmxremote.ssl
|
||||||
|
# *************************************
|
||||||
|
|
||||||
|
# standard commands for standalone and domain mode
|
||||||
|
local commandsWithoutEqualSign='-b -bmanagement -bunsecure -bpublic --admin-only -h -help -u -version -V -v'
|
||||||
|
local commandsWithEqualSign='-P -Djboss.node.name -Djboss.home.dir -Djboss.socket.binding.port-offset -Djboss.bind.address.management -Djboss.bind.address -Djboss.bind.address.unsecure'
|
||||||
|
|
||||||
|
if [[ $COMP_WORDS == *standalone.sh* ]]
|
||||||
|
then
|
||||||
|
commandsWithoutEqualSign="${commandsWithoutEqualSign} -c"
|
||||||
|
commandsWithEqualSign="${commandsWithEqualSign} --server-config -Djboss.server.base.dir -c"
|
||||||
|
else
|
||||||
|
# assume is domain.sh
|
||||||
|
commandsWithoutEqualSign="${commandsWithoutEqualSign} --backup --cached-dc"
|
||||||
|
commandsWithEqualSign="${commandsWithEqualSign} -Djboss.domain.master.address --host-config -Djboss.domain.master.port -Djboss.domain.base.dir "
|
||||||
|
fi
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
COMPREPLY=( $( compgen -W "$commandsWithoutEqualSign" -- "$cur" )
|
||||||
|
$( compgen -W "$commandsWithEqualSign" -S '=' -- "$cur" ) )
|
||||||
|
return 0
|
||||||
|
|
||||||
|
|
||||||
|
}
|
||||||
|
complete -o nospace -F _jboss standalone.sh
|
||||||
|
complete -o nospace -F _jboss domain.sh
|
||||||
|
|
|
||||||
|
|
@ -42,7 +42,6 @@ _KAC_is_file_newer_than() {
|
||||||
_KAC_regen_cache() {
|
_KAC_regen_cache() {
|
||||||
local CACHE_NAME=$1
|
local CACHE_NAME=$1
|
||||||
local CACHE_PATH="$_KNIFE_AUTOCOMPLETE_CACHE_DIR/$CACHE_NAME"
|
local CACHE_PATH="$_KNIFE_AUTOCOMPLETE_CACHE_DIR/$CACHE_NAME"
|
||||||
# shellcheck disable=SC2155
|
|
||||||
local TMP_FILE=$(mktemp "$_KAC_CACHE_TMP_DIR/$CACHE_NAME.XXXX")
|
local TMP_FILE=$(mktemp "$_KAC_CACHE_TMP_DIR/$CACHE_NAME.XXXX")
|
||||||
shift 1
|
shift 1
|
||||||
# discard the temp file if it's empty AND the previous command didn't exit successfully, but still mark the cache as updated
|
# discard the temp file if it's empty AND the previous command didn't exit successfully, but still mark the cache as updated
|
||||||
|
|
@ -55,19 +54,18 @@ _KAC_regen_cache() {
|
||||||
|
|
||||||
# cached files can't have spaces in their names
|
# cached files can't have spaces in their names
|
||||||
_KAC_get_cache_name_from_command() {
|
_KAC_get_cache_name_from_command() {
|
||||||
echo "${@// /_SPACE_}"
|
echo "${@/ /_SPACE_}"
|
||||||
}
|
}
|
||||||
|
|
||||||
# the reverse operation from the function above
|
# the reverse operation from the function above
|
||||||
_KAC_get_command_from_cache_name() {
|
_KAC_get_command_from_cache_name() {
|
||||||
echo "${@//_SPACE_/ }"
|
echo "${@/_SPACE_/ }"
|
||||||
}
|
}
|
||||||
|
|
||||||
# given a command as argument, it fetches the cache for that command if it can find it
|
# given a command as argument, it fetches the cache for that command if it can find it
|
||||||
# otherwise it waits for the cache to be generated
|
# otherwise it waits for the cache to be generated
|
||||||
# in either case, it regenerates the cache, and sets the _KAC_CACHE_PATH env variable
|
# in either case, it regenerates the cache, and sets the _KAC_CACHE_PATH env variable
|
||||||
# for obvious reason, do NOT call that in a sub-shell (in particular, no piping)
|
# for obvious reason, do NOT call that in a sub-shell (in particular, no piping)
|
||||||
# shellcheck disable=SC2155
|
|
||||||
_KAC_get_and_regen_cache() {
|
_KAC_get_and_regen_cache() {
|
||||||
# the cache name can't have space in it
|
# the cache name can't have space in it
|
||||||
local CACHE_NAME=$(_KAC_get_cache_name_from_command "$@")
|
local CACHE_NAME=$(_KAC_get_cache_name_from_command "$@")
|
||||||
|
|
@ -102,7 +100,7 @@ _KAC_clean_cache() {
|
||||||
|
|
||||||
# perform a cache cleaning when loading this file
|
# perform a cache cleaning when loading this file
|
||||||
# On big systems this could baloon up to a 30 second run or more, so not enabling by default.
|
# On big systems this could baloon up to a 30 second run or more, so not enabling by default.
|
||||||
[[ -n "${KNIFE_CACHE_CLEAN}" ]] && _KAC_clean_cache
|
[[ "${KNIFE_CACHE_CLEAN}" ]] && _KAC_clean_cache
|
||||||
|
|
||||||
#####################################
|
#####################################
|
||||||
### End of cache helper functions ###
|
### End of cache helper functions ###
|
||||||
|
|
@ -120,7 +118,7 @@ _KAC_get_current_base_command() {
|
||||||
local PREVIOUS="knife"
|
local PREVIOUS="knife"
|
||||||
local I=1
|
local I=1
|
||||||
local CURRENT
|
local CURRENT
|
||||||
while [[ "${I}" -le "${COMP_CWORD}" ]]; do
|
while [ $I -le "$COMP_CWORD" ]; do
|
||||||
# command words are all lower-case
|
# command words are all lower-case
|
||||||
echo "${COMP_WORDS[$I]}" | grep -E "^[a-z]+$" > /dev/null || break
|
echo "${COMP_WORDS[$I]}" | grep -E "^[a-z]+$" > /dev/null || break
|
||||||
CURRENT="$PREVIOUS ${COMP_WORDS[$I]}"
|
CURRENT="$PREVIOUS ${COMP_WORDS[$I]}"
|
||||||
|
|
@ -129,13 +127,12 @@ _KAC_get_current_base_command() {
|
||||||
I=$((I + 1))
|
I=$((I + 1))
|
||||||
done
|
done
|
||||||
_KAC_CURRENT_COMMAND=$PREVIOUS
|
_KAC_CURRENT_COMMAND=$PREVIOUS
|
||||||
[[ "${I}" -le "${COMP_CWORD}" ]] && _KAC_CURRENT_COMMAND_NB_WORDS="${I}"
|
[ $I -le "$COMP_CWORD" ] && _KAC_CURRENT_COMMAND_NB_WORDS=$I
|
||||||
}
|
}
|
||||||
|
|
||||||
# searches the position of the currently completed argument in the current base command
|
# searches the position of the currently completed argument in the current base command
|
||||||
# (i.e. handles "plural" arguments such as knife cookbook upload cookbook1 cookbook2 and so on...)
|
# (i.e. handles "plural" arguments such as knife cookbook upload cookbook1 cookbook2 and so on...)
|
||||||
# assumes the current base command is complete
|
# assumes the current base command is complete
|
||||||
# shellcheck disable=SC2155
|
|
||||||
_KAC_get_current_arg_position() {
|
_KAC_get_current_arg_position() {
|
||||||
local CURRENT_ARG_POS=$((_KAC_CURRENT_COMMAND_NB_WORDS + 1))
|
local CURRENT_ARG_POS=$((_KAC_CURRENT_COMMAND_NB_WORDS + 1))
|
||||||
local COMPLETE_COMMAND=$(grep -E "^$_KAC_CURRENT_COMMAND" "$_KAC_CACHE_PATH")
|
local COMPLETE_COMMAND=$(grep -E "^$_KAC_CURRENT_COMMAND" "$_KAC_CACHE_PATH")
|
||||||
|
|
@ -153,11 +150,10 @@ _KAC_get_current_arg_position() {
|
||||||
_knife() {
|
_knife() {
|
||||||
_KAC_get_and_regen_cache _KAC_knife_commands
|
_KAC_get_and_regen_cache _KAC_knife_commands
|
||||||
local RAW_LIST ITEM REGEN_CMD ARG_POSITION
|
local RAW_LIST ITEM REGEN_CMD ARG_POSITION
|
||||||
# shellcheck disable=SC2034
|
|
||||||
COMREPLY=()
|
COMREPLY=()
|
||||||
# get correct command & arg pos
|
# get correct command & arg pos
|
||||||
_KAC_get_current_base_command && ARG_POSITION=$(_KAC_get_current_arg_position) || ARG_POSITION=$((COMP_CWORD + 1))
|
_KAC_get_current_base_command && ARG_POSITION=$(_KAC_get_current_arg_position) || ARG_POSITION=$((COMP_CWORD + 1))
|
||||||
RAW_LIST=$(grep -E "^${_KAC_CURRENT_COMMAND}" "${_KAC_CACHE_PATH}" | cut -d ' ' -f "${ARG_POSITION}" | uniq)
|
RAW_LIST=$(grep -E "^$_KAC_CURRENT_COMMAND" "$_KAC_CACHE_PATH" | cut -d ' ' -f $ARG_POSITION | uniq)
|
||||||
|
|
||||||
# we need to process that raw list a bit, most notably for placeholders
|
# we need to process that raw list a bit, most notably for placeholders
|
||||||
# NOTE: I chose to explicitely fetch & cache _certain_ informations for the server (cookbooks & node names, etc)
|
# NOTE: I chose to explicitely fetch & cache _certain_ informations for the server (cookbooks & node names, etc)
|
||||||
|
|
|
||||||
|
|
@ -1,16 +1,15 @@
|
||||||
# shellcheck shell=bash
|
#!/usr/bin/bash
|
||||||
|
|
||||||
_command_exists laravel || return
|
if command -v laravel > /dev/null; then
|
||||||
|
__laravel_completion() {
|
||||||
|
local OPTS=("-h --help -q --quiet --ansi --no-ansi -n --no-interaction -v -vv -vvv --verbose help list new")
|
||||||
|
COMPREPLY=()
|
||||||
|
for _opt_ in ${OPTS[@]}; do
|
||||||
|
if [[ "$_opt_" == "$2"* ]]; then
|
||||||
|
COMPREPLY+=("$_opt_")
|
||||||
|
fi
|
||||||
|
done
|
||||||
|
}
|
||||||
|
|
||||||
function __laravel_completion() {
|
complete -F __laravel_completion laravel
|
||||||
local OPTS=('-h' '--help' '-q' '--quiet' '--ansi' '--no-ansi' '-n' '--no-interaction' '-v' '-vv' '-vvv' '--verbose' 'help' 'list' 'new')
|
fi
|
||||||
local _opt_
|
|
||||||
COMPREPLY=()
|
|
||||||
for _opt_ in "${OPTS[@]}"; do
|
|
||||||
if [[ "$_opt_" == "$2"* ]]; then
|
|
||||||
COMPREPLY+=("$_opt_")
|
|
||||||
fi
|
|
||||||
done
|
|
||||||
}
|
|
||||||
|
|
||||||
complete -F __laravel_completion laravel
|
|
||||||
|
|
|
||||||
|
|
@ -1,5 +1,3 @@
|
||||||
# shellcheck shell=bash
|
|
||||||
|
|
||||||
# Bash completion for Makefile
|
# Bash completion for Makefile
|
||||||
# Loosely adapted from http://stackoverflow.com/a/38415982/1472048
|
# Loosely adapted from http://stackoverflow.com/a/38415982/1472048
|
||||||
|
|
||||||
|
|
@ -19,7 +17,7 @@ _makecomplete() {
|
||||||
for f in "${files[@]}" ; do
|
for f in "${files[@]}" ; do
|
||||||
while IFS='' read -r line ; do
|
while IFS='' read -r line ; do
|
||||||
targets+=("$line")
|
targets+=("$line")
|
||||||
done < <(grep -E -o '^[a-zA-Z0-9_-]+:([^=]|$)' "$f" | cut -d':' -f1)
|
done < <(grep -oE '^[a-zA-Z0-9_-]+:([^=]|$)' "$f" | cut -d':' -f1)
|
||||||
done
|
done
|
||||||
|
|
||||||
[ "${#targets[@]}" -eq 0 ] && return 0
|
[ "${#targets[@]}" -eq 0 ] && return 0
|
||||||
|
|
|
||||||
|
|
@ -1,47 +0,0 @@
|
||||||
# shellcheck shell=bash
|
|
||||||
|
|
||||||
__ngrok_completion() {
|
|
||||||
# shellcheck disable=SC2155
|
|
||||||
local prev=$(_get_pword)
|
|
||||||
# shellcheck disable=SC2155
|
|
||||||
local curr=$(_get_cword)
|
|
||||||
|
|
||||||
local BASE_NO_CONF="--log --log-format --log-level --help"
|
|
||||||
local BASE="--config $BASE_NO_CONF"
|
|
||||||
local DEFAULT="$BASE --authtoken --region"
|
|
||||||
|
|
||||||
case $prev in
|
|
||||||
authtoken)
|
|
||||||
# shellcheck disable=SC2207
|
|
||||||
COMPREPLY=($(compgen -W "$BASE" -- "$curr"))
|
|
||||||
;;
|
|
||||||
http)
|
|
||||||
# shellcheck disable=SC2207
|
|
||||||
COMPREPLY=($(compgen -W "$DEFAULT --auth --bind-tls --host-header --hostname --inspect --subdomain" -- "$curr"))
|
|
||||||
;;
|
|
||||||
start)
|
|
||||||
# shellcheck disable=SC2207
|
|
||||||
COMPREPLY=($(compgen -W "$DEFAULT --all --none" -- "$curr"))
|
|
||||||
;;
|
|
||||||
tcp)
|
|
||||||
# shellcheck disable=SC2207
|
|
||||||
COMPREPLY=($(compgen -W "$DEFAULT --remote-addr" -- "$curr"))
|
|
||||||
;;
|
|
||||||
tls)
|
|
||||||
# shellcheck disable=SC2207
|
|
||||||
COMPREPLY=($(compgen -W "$DEFAULT --client-cas --crt --hostname --key --subdomain" -- "$curr"))
|
|
||||||
;;
|
|
||||||
update)
|
|
||||||
# shellcheck disable=SC2207
|
|
||||||
COMPREPLY=($(compgen -W "$BASE_NO_CONF --channel" -- "$curr"))
|
|
||||||
;;
|
|
||||||
ngrok)
|
|
||||||
# shellcheck disable=SC2207
|
|
||||||
COMPREPLY=($(compgen -W "authtoken credits http start tcp tls update version help" -- "$curr"))
|
|
||||||
;;
|
|
||||||
*) ;;
|
|
||||||
|
|
||||||
esac
|
|
||||||
}
|
|
||||||
|
|
||||||
complete -F __ngrok_completion ngrok
|
|
||||||
|
|
@ -1,9 +1,7 @@
|
||||||
# shellcheck shell=bash
|
# shellcheck shell=bash
|
||||||
|
|
||||||
function __notify-send_completions() {
|
function __notify-send_completions() {
|
||||||
# shellcheck disable=SC2155
|
|
||||||
local curr=$(_get_cword)
|
local curr=$(_get_cword)
|
||||||
# shellcheck disable=SC2155
|
|
||||||
local prev=$(_get_pword)
|
local prev=$(_get_pword)
|
||||||
|
|
||||||
case $prev in
|
case $prev in
|
||||||
|
|
|
||||||
|
|
@ -1,6 +1 @@
|
||||||
# shellcheck shell=bash
|
[[ -x "$(which pew)" ]] && source "$(pew shell_config)"
|
||||||
|
|
||||||
if _command_exists pew
|
|
||||||
then
|
|
||||||
source "$(pew shell_config)"
|
|
||||||
fi
|
|
||||||
|
|
|
||||||
|
|
@ -6,15 +6,6 @@
|
||||||
# If the pip package is installed within virtual environments, say, python managed by pyenv,
|
# If the pip package is installed within virtual environments, say, python managed by pyenv,
|
||||||
# you should first initialize the corresponding environment.
|
# you should first initialize the corresponding environment.
|
||||||
# So that pip is in the system's path.
|
# So that pip is in the system's path.
|
||||||
_command_exists pip || return
|
if _command_exists pip; then
|
||||||
|
eval "$(pip completion --bash)"
|
||||||
function __bash_it_complete_pip() {
|
fi
|
||||||
if _command_exists _pip_completion; then
|
|
||||||
complete -o default -F _pip_completion pip
|
|
||||||
_pip_completion "$@"
|
|
||||||
else
|
|
||||||
eval "$(pip completion --bash)"
|
|
||||||
_pip_completion "$@"
|
|
||||||
fi
|
|
||||||
}
|
|
||||||
complete -o default -F __bash_it_complete_pip pip
|
|
||||||
|
|
|
||||||
|
|
@ -6,15 +6,6 @@
|
||||||
# If the pip package is installed within virtual environments, say, python managed by pyenv,
|
# If the pip package is installed within virtual environments, say, python managed by pyenv,
|
||||||
# you should first initialize the corresponding environment.
|
# you should first initialize the corresponding environment.
|
||||||
# So that pip3 is in the system's path.
|
# So that pip3 is in the system's path.
|
||||||
_command_exists pip3 || return
|
if _command_exists pip3; then
|
||||||
|
eval "$(pip3 completion --bash)"
|
||||||
function __bash_it_complete_pip3() {
|
fi
|
||||||
if _command_exists _pip_completion; then
|
|
||||||
complete -o default -F _pip_completion pip3
|
|
||||||
_pip_completion "$@"
|
|
||||||
else
|
|
||||||
eval "$(pip3 completion --bash)"
|
|
||||||
_pip_completion "$@"
|
|
||||||
fi
|
|
||||||
}
|
|
||||||
complete -o default -F __bash_it_complete_pip3 pip3
|
|
||||||
|
|
|
||||||
|
|
@ -1,4 +1,4 @@
|
||||||
# shellcheck shell=bash
|
# shellcheck shell=bash
|
||||||
if _command_exists pipenv; then
|
if _command_exists pipenv; then
|
||||||
eval "$(_PIPENV_COMPLETE=bash_source pipenv)"
|
eval "$(pipenv --completion)"
|
||||||
fi
|
fi
|
||||||
|
|
|
||||||
|
|
@ -7,7 +7,7 @@ _is_function _rl_enabled ||
|
||||||
_pj() {
|
_pj() {
|
||||||
_is_function _init_completion || return
|
_is_function _init_completion || return
|
||||||
_is_function _rl_enabled || return
|
_is_function _rl_enabled || return
|
||||||
[ -n "$BASH_IT_PROJECT_PATHS" ] || return
|
[ -n "$PROJECT_PATHS" ] || return
|
||||||
shift
|
shift
|
||||||
[ "$1" == "open" ] && shift
|
[ "$1" == "open" ] && shift
|
||||||
|
|
||||||
|
|
@ -21,7 +21,7 @@ _pj() {
|
||||||
local -r mark_dirs=$(_rl_enabled mark-directories && echo y)
|
local -r mark_dirs=$(_rl_enabled mark-directories && echo y)
|
||||||
local -r mark_symdirs=$(_rl_enabled mark-symlinked-directories && echo y)
|
local -r mark_symdirs=$(_rl_enabled mark-symlinked-directories && echo y)
|
||||||
|
|
||||||
for i in ${BASH_IT_PROJECT_PATHS//:/$'\n'}; do
|
for i in ${PROJECT_PATHS//:/$'\n'}; do
|
||||||
# create an array of matched subdirs
|
# create an array of matched subdirs
|
||||||
k="${#COMPREPLY[@]}"
|
k="${#COMPREPLY[@]}"
|
||||||
for j in $( compgen -d $i/$cur ); do
|
for j in $( compgen -d $i/$cur ); do
|
||||||
|
|
|
||||||
|
|
@ -1,9 +1,7 @@
|
||||||
# shellcheck shell=bash
|
# shellcheck shell=bash
|
||||||
|
_sdkman_complete() {
|
||||||
function _sdkman_complete() {
|
|
||||||
local CANDIDATES
|
local CANDIDATES
|
||||||
local CANDIDATE_VERSIONS
|
local CANDIDATE_VERSIONS
|
||||||
local SDKMAN_CANDIDATES_CSV="${SDKMAN_CANDIDATES_CSV:-}"
|
|
||||||
|
|
||||||
COMPREPLY=()
|
COMPREPLY=()
|
||||||
|
|
||||||
|
|
@ -12,7 +10,7 @@ function _sdkman_complete() {
|
||||||
elif [ "$COMP_CWORD" -eq 2 ]; then
|
elif [ "$COMP_CWORD" -eq 2 ]; then
|
||||||
case "${COMP_WORDS[COMP_CWORD - 1]}" in
|
case "${COMP_WORDS[COMP_CWORD - 1]}" in
|
||||||
"install" | "i" | "uninstall" | "rm" | "list" | "ls" | "use" | "u" | "default" | "d" | "home" | "h" | "current" | "c" | "upgrade" | "ug")
|
"install" | "i" | "uninstall" | "rm" | "list" | "ls" | "use" | "u" | "default" | "d" | "home" | "h" | "current" | "c" | "upgrade" | "ug")
|
||||||
CANDIDATES="${SDKMAN_CANDIDATES_CSV//,/${IFS:0:1}}"
|
CANDIDATES=$(echo "${SDKMAN_CANDIDATES_CSV}" | tr ',' ' ')
|
||||||
mapfile -t COMPREPLY < <(compgen -W "$CANDIDATES" -- "${COMP_WORDS[COMP_CWORD]}")
|
mapfile -t COMPREPLY < <(compgen -W "$CANDIDATES" -- "${COMP_WORDS[COMP_CWORD]}")
|
||||||
;;
|
;;
|
||||||
"env")
|
"env")
|
||||||
|
|
@ -48,17 +46,17 @@ function _sdkman_complete() {
|
||||||
return 0
|
return 0
|
||||||
}
|
}
|
||||||
|
|
||||||
function _sdkman_candidate_local_versions() {
|
_sdkman_candidate_local_versions() {
|
||||||
|
|
||||||
CANDIDATE_VERSIONS=$(__sdkman_cleanup_local_versions "$1")
|
CANDIDATE_VERSIONS=$(__sdkman_cleanup_local_versions "$1")
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
function _sdkman_candidate_all_versions() {
|
_sdkman_candidate_all_versions() {
|
||||||
|
|
||||||
candidate="$1"
|
candidate="$1"
|
||||||
CANDIDATE_LOCAL_VERSIONS=$(__sdkman_cleanup_local_versions "$candidate")
|
CANDIDATE_LOCAL_VERSIONS=$(__sdkman_cleanup_local_versions "$candidate")
|
||||||
if [[ "${SDKMAN_OFFLINE_MODE:-false}" == "true" ]]; then
|
if [ "$SDKMAN_OFFLINE_MODE" = "true" ]; then
|
||||||
CANDIDATE_VERSIONS=$CANDIDATE_LOCAL_VERSIONS
|
CANDIDATE_VERSIONS=$CANDIDATE_LOCAL_VERSIONS
|
||||||
else
|
else
|
||||||
# sdkman has a specific output format for Java candidate since
|
# sdkman has a specific output format for Java candidate since
|
||||||
|
|
@ -72,12 +70,12 @@ function _sdkman_candidate_all_versions() {
|
||||||
# "+" - local version
|
# "+" - local version
|
||||||
# "*" - installed
|
# "*" - installed
|
||||||
# ">" - currently in use
|
# ">" - currently in use
|
||||||
CANDIDATE_VERSIONS="$(echo "$CANDIDATE_ONLINE_VERSIONS $CANDIDATE_LOCAL_VERSIONS" | tr ' ' '\n' | grep -v -e '^[[:space:]|\*|\>|\+]*$' | sort -u) "
|
CANDIDATE_VERSIONS="$(echo "$CANDIDATE_ONLINE_VERSIONS $CANDIDATE_LOCAL_VERSIONS" | tr ' ' '\n' | grep -v -e '^[[:space:]|\*|\>|\+]*$' | sort | uniq -u) "
|
||||||
fi
|
fi
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
function __sdkman_cleanup_local_versions() {
|
__sdkman_cleanup_local_versions() {
|
||||||
|
|
||||||
__sdkman_build_version_csv "$1" | tr ',' ' '
|
__sdkman_build_version_csv "$1" | tr ',' ' '
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -1,22 +1,21 @@
|
||||||
# shellcheck shell=bash
|
#!/bin/bash
|
||||||
|
|
||||||
# ---------------------------------------------------------------------------+
|
# ---------------------------------------------------------------------------+
|
||||||
# |
|
# |
|
||||||
# Thanks to Alexander Korznikov |
|
# Thanks to Alexander Korznikov |
|
||||||
# http://www.korznikov.com/2014/12/bash-tab-completion-for-awesome-tool.html |
|
# http://www.korznikov.com/2014/12/bash-tab-completion-for-awesome-tool.html |
|
||||||
# |
|
# |
|
||||||
# ---------------------------------------------------------------------------+
|
# ---------------------------------------------------------------------------+
|
||||||
|
|
||||||
if _command_exists sqlmap
|
if command -v sqlmap > /dev/null; then
|
||||||
then
|
|
||||||
|
|
||||||
function _sqlmap()
|
_sqlmap()
|
||||||
{
|
{
|
||||||
local cur prev
|
local cur prev
|
||||||
|
|
||||||
COMPREPLY=()
|
COMPREPLY=()
|
||||||
cur="$(_get_cword)"
|
cur=$(_get_cword)
|
||||||
prev="$(_get_pword)"
|
prev=$(_get_pword)
|
||||||
|
|
||||||
case $prev in
|
case $prev in
|
||||||
|
|
||||||
|
|
@ -144,7 +143,7 @@ then
|
||||||
--mobile --page-rank --purge-output --smart \
|
--mobile --page-rank --purge-output --smart \
|
||||||
--sqlmap-shell --wizard '
|
--sqlmap-shell --wizard '
|
||||||
COMPREPLY=( $( \
|
COMPREPLY=( $( \
|
||||||
(while read -d ' ' i; do
|
(while read -d ' ' i; do
|
||||||
[[ -z "$i" || "${onlyonce/ ${i%% *} / }" == "$onlyonce" ]] &&
|
[[ -z "$i" || "${onlyonce/ ${i%% *} / }" == "$onlyonce" ]] &&
|
||||||
continue
|
continue
|
||||||
# flatten array with spaces on either side,
|
# flatten array with spaces on either side,
|
||||||
|
|
@ -153,7 +152,7 @@ then
|
||||||
COMPREPLY=" ${COMPREPLY[@]} "
|
COMPREPLY=" ${COMPREPLY[@]} "
|
||||||
# remove word from list of completions
|
# remove word from list of completions
|
||||||
COMPREPLY=( ${COMPREPLY/ ${i%% *} / } )
|
COMPREPLY=( ${COMPREPLY/ ${i%% *} / } )
|
||||||
done
|
done
|
||||||
printf '%s ' "${COMPREPLY[@]}") <<<"${COMP_WORDS[@]}"
|
printf '%s ' "${COMPREPLY[@]}") <<<"${COMP_WORDS[@]}"
|
||||||
) )
|
) )
|
||||||
|
|
||||||
|
|
|
||||||
File diff suppressed because it is too large
Load Diff
|
|
@ -1,52 +1,25 @@
|
||||||
# shellcheck shell=bash
|
#!/usr/bin/env bash
|
||||||
#
|
|
||||||
# Loads the system's Bash completion modules.
|
# Loads the system's Bash completion modules.
|
||||||
# If Homebrew is installed (OS X), it's Bash completion modules are loaded.
|
# If Homebrew is installed (OS X), it's Bash completion modules are loaded.
|
||||||
|
|
||||||
# Load before other completions
|
if [[ -r /etc/bash_completion ]] ; then
|
||||||
# BASH_IT_LOAD_PRIORITY: 325
|
# shellcheck disable=SC1091
|
||||||
|
source /etc/bash_completion
|
||||||
|
|
||||||
# Bash-completion is too large and complex to expect to handle unbound variables throughout the whole codebase.
|
|
||||||
if shopt -qo nounset; then
|
|
||||||
__bash_it_restore_nounset=true
|
|
||||||
shopt -uo nounset
|
|
||||||
else
|
|
||||||
__bash_it_restore_nounset=false
|
|
||||||
fi
|
|
||||||
|
|
||||||
# shellcheck disable=SC1090 disable=SC1091
|
|
||||||
if [[ -r "${BASH_COMPLETION:-}" ]]; then
|
|
||||||
source "${BASH_COMPLETION}"
|
|
||||||
elif [[ -r /etc/bash_completion ]]; then
|
|
||||||
source /etc/bash_completion
|
|
||||||
# Some distribution makes use of a profile.d script to import completion.
|
# Some distribution makes use of a profile.d script to import completion.
|
||||||
elif [[ -r /etc/profile.d/bash_completion.sh ]]; then
|
elif [[ -r /etc/profile.d/bash_completion.sh ]] ; then
|
||||||
source /etc/profile.d/bash_completion.sh
|
# shellcheck disable=SC1091
|
||||||
elif _bash_it_homebrew_check; then
|
source /etc/profile.d/bash_completion.sh
|
||||||
: "${BASH_COMPLETION_COMPAT_DIR:=${BASH_IT_HOMEBREW_PREFIX}/etc/bash_completion.d}"
|
|
||||||
case "${BASH_VERSION}" in
|
|
||||||
1* | 2* | 3.0* | 3.1*)
|
|
||||||
_log_warning "Cannot load completion due to version of shell. Are you using Bash 3.2+?"
|
|
||||||
;;
|
|
||||||
3.2* | 4.0* | 4.1*)
|
|
||||||
# Import version 1.x of bash-completion, if installed.
|
|
||||||
BASH_COMPLETION="${BASH_IT_HOMEBREW_PREFIX}/opt/bash-completion@1/etc/bash_completion"
|
|
||||||
if [[ -r "$BASH_COMPLETION" ]]; then
|
|
||||||
source "$BASH_COMPLETION"
|
|
||||||
else
|
|
||||||
unset BASH_COMPLETION
|
|
||||||
fi
|
|
||||||
;;
|
|
||||||
4.2* | 5* | *)
|
|
||||||
# homebrew/versions/bash-completion2 (required for projects.completion.bash) is installed to this path
|
|
||||||
if [[ -r "${BASH_IT_HOMEBREW_PREFIX}/opt/bash-completion@2/etc/profile.d/bash_completion.sh" ]]; then
|
|
||||||
source "${BASH_IT_HOMEBREW_PREFIX}/opt/bash-completion@2/etc/profile.d/bash_completion.sh"
|
|
||||||
fi
|
|
||||||
;;
|
|
||||||
esac
|
|
||||||
fi
|
fi
|
||||||
|
|
||||||
if [[ ${__bash_it_restore_nounset:-false} == "true" ]]; then
|
if [[ "$(uname -s)" == 'Darwin' ]] && _command_exists brew ; then
|
||||||
shopt -so nounset
|
BREW_PREFIX=${BREW_PREFIX:-$(brew --prefix)}
|
||||||
|
|
||||||
|
# homebrew/versions/bash-completion2 (required for projects.completion.bash) is installed to this path
|
||||||
|
if [[ -r "$BREW_PREFIX"/etc/profile.d/bash_completion.sh ]] ; then
|
||||||
|
# shellcheck disable=SC1090
|
||||||
|
source "$BREW_PREFIX"/etc/profile.d/bash_completion.sh
|
||||||
|
fi
|
||||||
fi
|
fi
|
||||||
unset __bash_it_restore_nounset
|
|
||||||
|
|
|
||||||
|
|
@ -1,10 +1,5 @@
|
||||||
# shellcheck shell=bash
|
if [[ -x "$(which travis)" ]]; then
|
||||||
|
__TRAVIS_COMPLETION_SCRIPT="${TRAVIS_CONFIG_PATH:-${HOME}/.travis}/travis.sh"
|
||||||
if _command_exists travis
|
[[ -f "${__TRAVIS_COMPLETION_SCRIPT}" ]] && source "${__TRAVIS_COMPLETION_SCRIPT}"
|
||||||
then
|
|
||||||
if [[ -s "${__TRAVIS_COMPLETION_SCRIPT:=${TRAVIS_CONFIG_PATH:-${HOME}/.travis}/travis.sh}" ]]
|
|
||||||
then
|
|
||||||
source "${__TRAVIS_COMPLETION_SCRIPT}"
|
|
||||||
fi
|
|
||||||
unset __TRAVIS_COMPLETION_SCRIPT
|
unset __TRAVIS_COMPLETION_SCRIPT
|
||||||
fi
|
fi
|
||||||
|
|
|
||||||
|
|
@ -1,9 +1,7 @@
|
||||||
# shellcheck shell=bash
|
# shellcheck shell=bash
|
||||||
|
|
||||||
__vuejs_completion() {
|
__vuejs_completion() {
|
||||||
# shellcheck disable=SC2155
|
|
||||||
local prev=$(_get_pword)
|
local prev=$(_get_pword)
|
||||||
# shellcheck disable=SC2155
|
|
||||||
local curr=$(_get_cword)
|
local curr=$(_get_cword)
|
||||||
|
|
||||||
case $prev in
|
case $prev in
|
||||||
|
|
|
||||||
|
|
@ -1,16 +1,15 @@
|
||||||
# shellcheck shell=bash
|
#!/usr/bin/bash
|
||||||
|
|
||||||
_command_exists wpscan || return
|
if command -v wpscan > /dev/null; then
|
||||||
|
__wpscan_completion() {
|
||||||
|
local OPTS=("--help --hh --version --url --ignore-main-redirect --verbose --output --format --detection-mode --scope --headers --user-agent --vhost --random-user-agent --user-agents-list --http-auth --max-threads --throttle --request-timeout --connect-timeout --disable-tlc-checks --proxy --proxy-auth --cookie-string --cookie-jar --cache-ttl --clear-cache --server --cache-dir --update --no-update --wp-content-dir --wp-plugins-dir --wp-version-detection --main-theme-detection --enumerate --exclude-content-based --plugins-list --plugins-detection --plugins-version-all --plugins-version-detection --themes-list --themes-detection --themes-version-all --themes-version-detection --timthumbs-list --timthumbs-detection --config-backups-list --config-backups-detection --db-exports-list --db-exports-detection --medias-detection --users-list --users-detection --passwords --usernames --multicall-max-passwords --password-attack --stealthy")
|
||||||
|
COMPREPLY=()
|
||||||
|
for _opt_ in ${OPTS[@]}; do
|
||||||
|
if [[ "$_opt_" == "$2"* ]]; then
|
||||||
|
COMPREPLY+=("$_opt_")
|
||||||
|
fi
|
||||||
|
done
|
||||||
|
}
|
||||||
|
|
||||||
function __wpscan_completion() {
|
complete -F __wpscan_completion wpscan
|
||||||
local _opt_
|
fi
|
||||||
local OPTS=('--help' '--hh' '--version' '--url' '--ignore-main-redirect' '--verbose' '--output' '--format' '--detection-mode' '--scope' '--headers' '--user-agent' '--vhost' '--random-user-agent' '--user-agents-list' '--http-auth' '--max-threads' '--throttle' '--request-timeout' '--connect-timeout' '--disable-tlc-checks' '--proxy' '--proxy-auth' '--cookie-string' '--cookie-jar' '--cache-ttl' '--clear-cache' '--server' '--cache-dir' '--update' '--no-update' '--wp-content-dir' '--wp-plugins-dir' '--wp-version-detection' '--main-theme-detection' '--enumerate' '--exclude-content-based' '--plugins-list' '--plugins-detection' '--plugins-version-all' '--plugins-version-detection' '--themes-list' '--themes-detection' '--themes-version-all' '--themes-version-detection' '--timthumbs-list' '--timthumbs-detection' '--config-backups-list' '--config-backups-detection' '--db-exports-list' '--db-exports-detection' '--medias-detection' '--users-list' '--users-detection' '--passwords' '--usernames' '--multicall-max-passwords' '--password-attack' '--stealthy')
|
|
||||||
COMPREPLY=()
|
|
||||||
for _opt_ in "${OPTS[@]}"; do
|
|
||||||
if [[ "$_opt_" == "$2"* ]]; then
|
|
||||||
COMPREPLY+=("$_opt_")
|
|
||||||
fi
|
|
||||||
done
|
|
||||||
}
|
|
||||||
|
|
||||||
complete -F __wpscan_completion wpscan
|
|
||||||
|
|
|
||||||
|
|
@ -1,5 +0,0 @@
|
||||||
# shellcheck shell=bash
|
|
||||||
about-completion "yarn cli completions"
|
|
||||||
|
|
||||||
# shellcheck disable=SC1090 source=../../vendor/github.com/dsifford/yarn-completion/yarn
|
|
||||||
source "${BASH_IT}/vendor/github.com/dsifford/yarn-completion/yarn"
|
|
||||||
|
|
@ -1,9 +1,7 @@
|
||||||

|
# Bash-it
|
||||||
|

|
||||||

|
|
||||||

|

|
||||||

|
[](https://webchat.freenode.net/?channel=#bash-it)
|
||||||

|
|
||||||
|
|
||||||
**Bash-it** is a collection of community Bash commands and scripts for Bash 3.2+.
|
**Bash-it** is a collection of community Bash commands and scripts for Bash 3.2+.
|
||||||
(And a shameless ripoff of [oh-my-zsh](https://github.com/robbyrussell/oh-my-zsh) :smiley:)
|
(And a shameless ripoff of [oh-my-zsh](https://github.com/robbyrussell/oh-my-zsh) :smiley:)
|
||||||
|
|
@ -11,7 +9,7 @@
|
||||||
Includes autocompletion, themes, aliases, custom functions, a few stolen pieces from Steve Losh, and more.
|
Includes autocompletion, themes, aliases, custom functions, a few stolen pieces from Steve Losh, and more.
|
||||||
|
|
||||||
Bash-it provides a solid framework for using, developing and maintaining shell scripts and custom commands for your daily work.
|
Bash-it provides a solid framework for using, developing and maintaining shell scripts and custom commands for your daily work.
|
||||||
If you're using the _Bourne Again Shell_ (Bash) regularly and have been looking for an easy way on how to keep all of these nice little scripts and aliases under control, then Bash-it is for you!
|
If you're using the _Bourne Again Shell_ (Bash) regularly and have been looking for an easy way on how to keep all of these nice little scripts and aliases under control, then Bash-it is for you!
|
||||||
Stop polluting your `~/bin` directory and your `.bashrc` file, fork/clone Bash-it and start hacking away.
|
Stop polluting your `~/bin` directory and your `.bashrc` file, fork/clone Bash-it and start hacking away.
|
||||||
|
|
||||||
- [Main Page](https://bash-it.readthedocs.io/en/latest)
|
- [Main Page](https://bash-it.readthedocs.io/en/latest)
|
||||||
|
|
@ -41,8 +39,7 @@ Stop polluting your `~/bin` directory and your `.bashrc` file, fork/clone Bash-i
|
||||||
``git clone --depth=1 https://github.com/Bash-it/bash-it.git ~/.bash_it``
|
``git clone --depth=1 https://github.com/Bash-it/bash-it.git ~/.bash_it``
|
||||||
2) Run ``~/.bash_it/install.sh``
|
2) Run ``~/.bash_it/install.sh``
|
||||||
|
|
||||||
That's it! :smiley:
|
Thats it! :smiley:
|
||||||
|
|
||||||
You can check out more components of Bash-it, and customize it to your desire.
|
You can check out more components of Bash-it, and customize it to your desire.
|
||||||
For more information, see detailed instructions [here](https://bash-it.readthedocs.io/en/latest/installation/).
|
For more information, see detailed instructions [here](https://bash-it.readthedocs.io/en/latest/installation/).
|
||||||
|
|
||||||
|
|
@ -56,8 +53,6 @@ please feel free to read through this page if you're interested in how Bash-it l
|
||||||
|
|
||||||
## Contributors
|
## Contributors
|
||||||
|
|
||||||
[List of contributors](https://github.com/Bash-it/bash-it/contributors)
|
* [List of contributors][contribute]
|
||||||
|
|
||||||
## License
|
[contribute]: https://github.com/Bash-it/bash-it/contributors
|
||||||
|
|
||||||
Bash-it is licensed under the [MIT License](https://github.com/Bash-it/bash-it/blob/master/LICENSE).
|
|
||||||
|
|
|
||||||
|
|
@ -13,4 +13,3 @@ You should be familiar with them in order to fully utilize Bash-it.
|
||||||
search
|
search
|
||||||
reload
|
reload
|
||||||
doctor
|
doctor
|
||||||
profile
|
|
||||||
|
|
|
||||||
Some files were not shown because too many files have changed in this diff Show More
Loading…
Reference in New Issue