Compare commits
49 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
e89403d59b | ||
|
|
e13f7d1b07 | ||
|
|
aad58bc910 | ||
|
|
d4ebba174c | ||
|
|
0f3e4dc8be | ||
|
|
e51fe1fe2b | ||
|
|
d979c32c8a | ||
|
|
f6e3fc358c | ||
|
|
e70211549f | ||
|
|
a3f5b5f29a | ||
|
|
682fd32a13 | ||
|
|
01b916c544 | ||
|
|
2444a57cc5 | ||
|
|
9b62a5c4df | ||
|
|
1e6113f7b7 | ||
|
|
dff892e0a3 | ||
|
|
2ae0350f5d | ||
|
|
b65a7cc67c | ||
|
|
7f193a2e05 | ||
|
|
8c47706139 | ||
|
|
2120be9372 | ||
|
|
476c568566 | ||
|
|
26118d1835 | ||
|
|
d3bb347786 | ||
|
|
b8da4cb68c | ||
|
|
940739a8a0 | ||
|
|
716b49fa0e | ||
|
|
e15b53ea61 | ||
|
|
1b7448bc9d | ||
|
|
d0aa9cb542 | ||
|
|
c731e45770 | ||
|
|
7b8dbd39bc | ||
|
|
31bea24da6 | ||
|
|
7cd94e1f7f | ||
|
|
370c5b349e | ||
|
|
c0fa514f7d | ||
|
|
409e18f7cb | ||
|
|
5e723842b8 | ||
|
|
7e620fed63 | ||
|
|
58f2240789 | ||
|
|
2201f6658b | ||
|
|
c7f125a85d | ||
|
|
80f143c90b | ||
|
|
5d809dd73d | ||
|
|
e481eb41e5 | ||
|
|
a3ae37b385 | ||
|
|
64d827c3da | ||
|
|
a30a76906c | ||
|
|
e89948a7f0 |
@@ -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.4
|
rev: 2.1.5
|
||||||
hooks:
|
hooks:
|
||||||
- id: git-check # Configure in .gitattributes
|
- id: git-check # Configure in .gitattributes
|
||||||
- id: shellcheck
|
- id: shellcheck
|
||||||
@@ -43,3 +43,8 @@ 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
|
||||||
|
|||||||
2
LICENSE
2
LICENSE
@@ -1,6 +1,6 @@
|
|||||||
MIT License
|
MIT License
|
||||||
|
|
||||||
Copyright (c) 2020 Bash-it
|
Copyright (c) 2020-2021 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
|
||||||
|
|||||||
@@ -37,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 master'
|
alias gcom='git checkout $(get_default_branch)'
|
||||||
alias gcpd='git checkout master; git pull; git branch -D'
|
alias gcpd='git checkout $(get_default_branch); git pull; git branch -D'
|
||||||
alias gct='git checkout --track'
|
alias gct='git checkout --track'
|
||||||
|
|
||||||
# clone
|
# clone
|
||||||
@@ -64,13 +64,14 @@ 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/master'
|
alias gmu='git fetch origin -v; git fetch upstream -v; git merge upstream/$(get_default_branch)'
|
||||||
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'
|
||||||
@@ -104,7 +105,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 master'
|
alias gpom='git push origin $(get_default_branch)'
|
||||||
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'
|
||||||
@@ -112,7 +113,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 master'
|
alias glum='git pull upstream $(get_default_branch)'
|
||||||
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'
|
||||||
@@ -128,9 +129,9 @@ alias grm='git rm'
|
|||||||
# rebase
|
# rebase
|
||||||
alias grb='git rebase'
|
alias grb='git rebase'
|
||||||
alias grbc='git rebase --continue'
|
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 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'
|
||||||
@@ -174,7 +175,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 master'
|
alias gswm='git switch $(get_default_branch)'
|
||||||
alias gswt='git switch --track'
|
alias gswt='git switch --track'
|
||||||
|
|
||||||
# tag
|
# tag
|
||||||
@@ -196,3 +197,11 @@ 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; then
|
||||||
|
echo main
|
||||||
|
else
|
||||||
|
echo master
|
||||||
|
fi
|
||||||
|
}
|
||||||
|
|||||||
101
clean_files.txt
101
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 Suport
|
# Directory Support
|
||||||
# Directory references are allowed within the file, ie:
|
# Directory references are allowed within the file, ie:
|
||||||
#
|
#
|
||||||
# themes/powerline
|
# themes/powerline
|
||||||
@@ -16,49 +16,22 @@
|
|||||||
|
|
||||||
# root directories
|
# root directories
|
||||||
#
|
#
|
||||||
docs
|
docs/
|
||||||
hooks
|
hooks/
|
||||||
|
|
||||||
# root files
|
# root files
|
||||||
#
|
#
|
||||||
.gitattributes
|
.gitattributes
|
||||||
lint_clean_files.sh
|
|
||||||
install.sh
|
|
||||||
bash_it.sh
|
bash_it.sh
|
||||||
|
clean_files.txt
|
||||||
|
install.sh
|
||||||
|
lint_clean_files.sh
|
||||||
|
|
||||||
# themes
|
# aliases
|
||||||
#
|
#
|
||||||
themes/agnoster
|
aliases/available/dnf.aliases.bash
|
||||||
themes/90210
|
aliases/available/git.aliases.bash
|
||||||
themes/powerline
|
aliases/available/vim.aliases.bash
|
||||||
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/easy
|
|
||||||
themes/modern
|
|
||||||
themes/purity
|
|
||||||
|
|
||||||
# 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
|
||||||
#
|
#
|
||||||
@@ -70,21 +43,24 @@ 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/django.completion.bash
|
completion/available/django.completion.bash
|
||||||
completion/available/docker.completion.bash
|
completion/available/dmidecode.completion.bash
|
||||||
completion/available/docker-machine.completion.bash
|
completion/available/docker-machine.completion.bash
|
||||||
|
completion/available/docker.completion.bash
|
||||||
completion/available/gcloud.completion.bash
|
completion/available/gcloud.completion.bash
|
||||||
completion/available/gem.completion.bash
|
completion/available/gem.completion.bash
|
||||||
completion/available/go.completion.bash
|
|
||||||
completion/available/github-cli.completion.bash
|
completion/available/github-cli.completion.bash
|
||||||
|
completion/available/go.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/lerna.completion.bash
|
completion/available/lerna.completion.bash
|
||||||
completion/available/minikube.completion.bash
|
completion/available/minikube.completion.bash
|
||||||
completion/available/notify-send.completion.bash
|
|
||||||
completion/available/ngrok.completion.bash
|
completion/available/ngrok.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
|
||||||
completion/available/pip.completion.bash
|
completion/available/pip.completion.bash
|
||||||
@@ -92,19 +68,54 @@ 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/vault.completion.bash
|
|
||||||
completion/available/sdkman.completion.bash
|
completion/available/sdkman.completion.bash
|
||||||
|
completion/available/vault.completion.bash
|
||||||
completion/available/vuejs.completion.bash
|
completion/available/vuejs.completion.bash
|
||||||
|
completion/available/wpscan.completion.bash
|
||||||
|
|
||||||
# aliases
|
# plugins
|
||||||
#
|
#
|
||||||
aliases/available/dnf.aliases.bash
|
plugins/available/alias-completion.plugin.bash
|
||||||
aliases/available/vim.aliases.bash
|
plugins/available/basher.plugin.bash
|
||||||
aliases/available/git.aliases.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-search.plugin.bash
|
||||||
|
plugins/available/history-substring-search.plugin.bash
|
||||||
|
plugins/available/history.plugin.bash
|
||||||
|
plugins/available/xterm.plugin.bash
|
||||||
|
|
||||||
# tests
|
# tests
|
||||||
|
#
|
||||||
|
test/plugins/alias-completion.plugin.bats
|
||||||
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/command_duration.theme.bash
|
||||||
|
themes/easy
|
||||||
|
themes/modern
|
||||||
|
themes/powerline
|
||||||
|
themes/pure
|
||||||
|
themes/purity
|
||||||
|
|
||||||
# vendor init files
|
# vendor init files
|
||||||
|
#
|
||||||
vendor/.gitattributes
|
vendor/.gitattributes
|
||||||
vendor/init.d
|
vendor/init.d
|
||||||
|
|||||||
20
completion/available/dmidecode.completion.bash
Normal file
20
completion/available/dmidecode.completion.bash
Normal file
@@ -0,0 +1,20 @@
|
|||||||
|
# shellcheck shell=bash
|
||||||
|
|
||||||
|
function __dmidecode_completion() {
|
||||||
|
local prev=$(_get_pword)
|
||||||
|
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
|
||||||
4
completion/available/jboss5.completion.bash
Normal file
4
completion/available/jboss5.completion.bash
Normal file
@@ -0,0 +1,4 @@
|
|||||||
|
# shellcheck shell=bash
|
||||||
|
about-completion "jboss5 completion"
|
||||||
|
# shellcheck disable=SC1090
|
||||||
|
source "${BASH_IT}"/vendor/github.com/rparree/jboss-bash-completion/jboss5
|
||||||
@@ -1,160 +1,4 @@
|
|||||||
# Completions for JBoss Application Server 7 (EAP 6)
|
# shellcheck shell=bash
|
||||||
# VERSION: 0.6
|
about-completion "jboss7 completion"
|
||||||
# DATE: 2012-10-30
|
# shellcheck disable=SC1090
|
||||||
# rparree-at-edc4it-dot-com
|
source "${BASH_IT}"/vendor/github.com/rparree/jboss-bash-completion/jboss7
|
||||||
|
|
||||||
# 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
|
|
||||||
|
|||||||
@@ -1,10 +1,10 @@
|
|||||||
#!/usr/bin/bash
|
# shellcheck shell=bash
|
||||||
|
|
||||||
if command -v wpscan > /dev/null; then
|
if command -v wpscan > /dev/null; then
|
||||||
__wpscan_completion() {
|
__wpscan_completion() {
|
||||||
local OPTS=("--help --hh --version --url --ignore-main-redirect --verbose --output --format --detection-mode --scope --headers --user-agent --vhost --random-user-agent --user-agents-list --http-auth --max-threads --throttle --request-timeout --connect-timeout --disable-tlc-checks --proxy --proxy-auth --cookie-string --cookie-jar --cache-ttl --clear-cache --server --cache-dir --update --no-update --wp-content-dir --wp-plugins-dir --wp-version-detection --main-theme-detection --enumerate --exclude-content-based --plugins-list --plugins-detection --plugins-version-all --plugins-version-detection --themes-list --themes-detection --themes-version-all --themes-version-detection --timthumbs-list --timthumbs-detection --config-backups-list --config-backups-detection --db-exports-list --db-exports-detection --medias-detection --users-list --users-detection --passwords --usernames --multicall-max-passwords --password-attack --stealthy")
|
local OPTS=("--help --hh --version --url --ignore-main-redirect --verbose --output --format --detection-mode --scope --headers --user-agent --vhost --random-user-agent --user-agents-list --http-auth --max-threads --throttle --request-timeout --connect-timeout --disable-tlc-checks --proxy --proxy-auth --cookie-string --cookie-jar --cache-ttl --clear-cache --server --cache-dir --update --no-update --wp-content-dir --wp-plugins-dir --wp-version-detection --main-theme-detection --enumerate --exclude-content-based --plugins-list --plugins-detection --plugins-version-all --plugins-version-detection --themes-list --themes-detection --themes-version-all --themes-version-detection --timthumbs-list --timthumbs-detection --config-backups-list --config-backups-detection --db-exports-list --db-exports-detection --medias-detection --users-list --users-detection --passwords --usernames --multicall-max-passwords --password-attack --stealthy")
|
||||||
COMPREPLY=()
|
COMPREPLY=()
|
||||||
for _opt_ in ${OPTS[@]}; do
|
for _opt_ in "${OPTS[@]}"; do
|
||||||
if [[ "$_opt_" == "$2"* ]]; then
|
if [[ "$_opt_" == "$2"* ]]; then
|
||||||
COMPREPLY+=("$_opt_")
|
COMPREPLY+=("$_opt_")
|
||||||
fi
|
fi
|
||||||
|
|||||||
@@ -1,7 +1,10 @@
|
|||||||
# Bash-it
|

|
||||||
|
|
||||||

|

|
||||||

|

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

|
||||||
|

|
||||||
|
[](https://web.libera.chat/?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:)
|
||||||
@@ -39,7 +42,8 @@ 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``
|
||||||
|
|
||||||
Thats it! :smiley:
|
That's 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/).
|
||||||
|
|
||||||
@@ -53,10 +57,8 @@ please feel free to read through this page if you're interested in how Bash-it l
|
|||||||
|
|
||||||
## Contributors
|
## Contributors
|
||||||
|
|
||||||
* [List of contributors][contribute]
|
[List of contributors](https://github.com/Bash-it/bash-it/contributors)
|
||||||
|
|
||||||
## License
|
## License
|
||||||
|
|
||||||
Bash-it is licensed under the [MIT License](https://github.com/Bash-it/bash-it/blob/master/LICENSE).
|
Bash-it is licensed under the [MIT License](https://github.com/Bash-it/bash-it/blob/master/LICENSE).
|
||||||
|
|
||||||
[contribute]: https://github.com/Bash-it/bash-it/contributors
|
|
||||||
|
|||||||
@@ -8,3 +8,16 @@ your Bash profile when you make changes.
|
|||||||
|
|
||||||
Additionally, if you export ``BASH_IT_AUTOMATIC_RELOAD_AFTER_CONFIG_CHANGE`` as a non-null value,
|
Additionally, if you export ``BASH_IT_AUTOMATIC_RELOAD_AFTER_CONFIG_CHANGE`` as a non-null value,
|
||||||
Bash-it will automatically reload itself after activating or deactivating plugins, aliases, or completions.
|
Bash-it will automatically reload itself after activating or deactivating plugins, aliases, or completions.
|
||||||
|
|
||||||
|
.. warning::
|
||||||
|
When changing theme, do not use ``bash-it reload``. Instead, use :ref:`restart`.
|
||||||
|
|
||||||
|
.. _restart:
|
||||||
|
|
||||||
|
Bash-it restart
|
||||||
|
^^^^^^^^^^^^^^^
|
||||||
|
|
||||||
|
Similar to :ref:`reload`, ``bash-it restart`` can be used to restart your shell.
|
||||||
|
Instead of reloading your Bash profile, this command re-runs Bash (using exec).
|
||||||
|
|
||||||
|
This is stronger than simple reload, and is similar to the effect of closing and reopening your terminal.
|
||||||
|
|||||||
@@ -70,11 +70,13 @@ The contents of the prompt can be "reordered", all the "segments" (every piece o
|
|||||||
* ``battery`` - Battery information (you'll need to enable the ``battery`` plugin)
|
* ``battery`` - Battery information (you'll need to enable the ``battery`` plugin)
|
||||||
* ``clock`` - Current time in ``HH:MM:SS`` format
|
* ``clock`` - Current time in ``HH:MM:SS`` format
|
||||||
* ``cwd`` - Current working directory including full folder hierarchy (c.f. ``wd``\ )
|
* ``cwd`` - Current working directory including full folder hierarchy (c.f. ``wd``\ )
|
||||||
|
* ``duration`` - Duration of the last command. See :ref:`Command duration <command_duration>` for details.
|
||||||
* ``gcloud`` - Current gcloud active account
|
* ``gcloud`` - Current gcloud active account
|
||||||
* ``hostname`` - Host name of machine
|
* ``hostname`` - Host name of machine
|
||||||
* ``in_toolbox`` - Show identifier if running inside a `toolbox <https://github.com/containers/toolbox>`_
|
* ``in_toolbox`` - Show identifier if running inside a `toolbox <https://github.com/containers/toolbox>`_
|
||||||
* ``in_vim`` - Show identifier if running in ``:terminal`` from vim
|
* ``in_vim`` - Show identifier if running in ``:terminal`` from vim
|
||||||
* ``k8s_context`` - Show current kubernetes context
|
* ``k8s_context`` - Show current kubernetes context
|
||||||
|
* ``k8s_namespace`` - Show current kubernetes namespace
|
||||||
* ``last_status`` - Exit status of last run command
|
* ``last_status`` - Exit status of last run command
|
||||||
* ``python_venv`` - Python virtual environment information (\ ``virtualenv``\ , ``venv``
|
* ``python_venv`` - Python virtual environment information (\ ``virtualenv``\ , ``venv``
|
||||||
and ``conda`` supported)
|
and ``conda`` supported)
|
||||||
|
|||||||
39
hooks/check-clean-files-txt.sh
Executable file
39
hooks/check-clean-files-txt.sh
Executable file
@@ -0,0 +1,39 @@
|
|||||||
|
#!/usr/bin/env bash
|
||||||
|
|
||||||
|
file=$1
|
||||||
|
# Should only be run on clean_files.txt
|
||||||
|
if [ "$file" != "clean_files.txt" ]; then
|
||||||
|
echo "Please run this script on clean_files.txt only!"
|
||||||
|
exit 1
|
||||||
|
fi
|
||||||
|
|
||||||
|
function compare_lines() {
|
||||||
|
prev=""
|
||||||
|
while read -r line; do
|
||||||
|
# Skip unimportant lines
|
||||||
|
[[ $line =~ "#" ]] && continue
|
||||||
|
[[ $line == "" ]] && continue
|
||||||
|
# Actual check
|
||||||
|
if [[ $prev > $line ]]; then
|
||||||
|
echo "$line should be before $prev"
|
||||||
|
exit 1
|
||||||
|
fi
|
||||||
|
prev=$line
|
||||||
|
done <<< "$1"
|
||||||
|
}
|
||||||
|
|
||||||
|
# We compare using the legacy way
|
||||||
|
shopt -s compat31
|
||||||
|
|
||||||
|
# Test root files
|
||||||
|
compare_lines "$(grep -v "/" "$file")"
|
||||||
|
|
||||||
|
# Test root directory
|
||||||
|
compare_lines "$(grep "/$" "$file")"
|
||||||
|
|
||||||
|
# Test non root directories
|
||||||
|
compare_lines "$(grep "/." "$file")"
|
||||||
|
|
||||||
|
shopt -u compat31
|
||||||
|
# Yay, all good!
|
||||||
|
exit 0
|
||||||
@@ -203,7 +203,7 @@ _bash-it_pull_and_update_inner() {
|
|||||||
_bash-it-migrate
|
_bash-it-migrate
|
||||||
echo ""
|
echo ""
|
||||||
echo "All done, enjoy!"
|
echo "All done, enjoy!"
|
||||||
bash-it reload
|
bash-it restart
|
||||||
else
|
else
|
||||||
echo "Error updating Bash-it, please, check if your Bash-it installation folder (${BASH_IT}) is clean."
|
echo "Error updating Bash-it, please, check if your Bash-it installation folder (${BASH_IT}) is clean."
|
||||||
fi
|
fi
|
||||||
@@ -224,6 +224,9 @@ _bash-it-update-() {
|
|||||||
|
|
||||||
cd "${BASH_IT}" || return
|
cd "${BASH_IT}" || return
|
||||||
|
|
||||||
|
DIFF=$(git diff --name-status)
|
||||||
|
[ -n "$DIFF" ] && echo -e "Local changes detected in bash-it directory. Clean '$BASH_IT' directory to proceed.\n$DIFF" && return 1
|
||||||
|
|
||||||
if [ -z "$BASH_IT_REMOTE" ]; then
|
if [ -z "$BASH_IT_REMOTE" ]; then
|
||||||
BASH_IT_REMOTE="origin"
|
BASH_IT_REMOTE="origin"
|
||||||
fi
|
fi
|
||||||
|
|||||||
@@ -1,3 +1,4 @@
|
|||||||
|
# shellcheck shell=bash
|
||||||
# Load after the other completions to understand what needs to be completed
|
# Load after the other completions to understand what needs to be completed
|
||||||
# BASH_IT_LOAD_PRIORITY: 365
|
# BASH_IT_LOAD_PRIORITY: 365
|
||||||
|
|
||||||
@@ -26,43 +27,50 @@ function alias_completion {
|
|||||||
|
|
||||||
# create array of function completion triggers, keeping multi-word triggers together
|
# create array of function completion triggers, keeping multi-word triggers together
|
||||||
eval "local completions=($(complete -p | sed -Ene "/$compl_regex/s//'\3'/p"))"
|
eval "local completions=($(complete -p | sed -Ene "/$compl_regex/s//'\3'/p"))"
|
||||||
(( ${#completions[@]} == 0 )) && return 0
|
((${#completions[@]} == 0)) && return 0
|
||||||
|
|
||||||
# create temporary file for wrapper functions and completions
|
# create temporary file for wrapper functions and completions
|
||||||
local tmp_file; tmp_file="$(mktemp -t "${namespace}-${RANDOM}XXXXXX")" || return 1
|
local tmp_file
|
||||||
|
tmp_file="$(mktemp -t "${namespace}-${RANDOM}XXXXXX")" || return 1
|
||||||
|
|
||||||
local completion_loader; completion_loader="$(complete -p -D 2>/dev/null | sed -Ene 's/.* -F ([^ ]*).*/\1/p')"
|
local completion_loader
|
||||||
|
completion_loader="$(complete -p -D 2> /dev/null | sed -Ene 's/.* -F ([^ ]*).*/\1/p')"
|
||||||
|
|
||||||
# read in "<alias> '<aliased command>' '<command args>'" lines from defined aliases
|
# read in "<alias> '<aliased command>' '<command args>'" lines from defined aliases
|
||||||
local line; while read line; do
|
local line
|
||||||
eval "local alias_tokens; alias_tokens=($line)" 2>/dev/null || continue # some alias arg patterns cause an eval parse error
|
|
||||||
|
# shellcheck disable=SC2162
|
||||||
|
# some aliases do have backslashes that needs to be interpreted
|
||||||
|
while read line; do
|
||||||
|
eval "local alias_tokens; alias_tokens=($line)" 2> /dev/null || continue # some alias arg patterns cause an eval parse error
|
||||||
local alias_name="${alias_tokens[0]}" alias_cmd="${alias_tokens[1]}" alias_args="${alias_tokens[2]# }"
|
local alias_name="${alias_tokens[0]}" alias_cmd="${alias_tokens[1]}" alias_args="${alias_tokens[2]# }"
|
||||||
|
|
||||||
# skip aliases to pipes, boolean control structures and other command lists
|
# skip aliases to pipes, boolean control structures and other command lists
|
||||||
# (leveraging that eval errs out if $alias_args contains unquoted shell metacharacters)
|
# (leveraging that eval errs out if $alias_args contains unquoted shell metacharacters)
|
||||||
eval "local alias_arg_words; alias_arg_words=($alias_args)" 2>/dev/null || continue
|
eval "local alias_arg_words; alias_arg_words=($alias_args)" 2> /dev/null || continue
|
||||||
# avoid expanding wildcards
|
# avoid expanding wildcards
|
||||||
read -a alias_arg_words <<< "$alias_args"
|
read -a alias_arg_words <<< "$alias_args"
|
||||||
|
|
||||||
# skip alias if there is no completion function triggered by the aliased command
|
# skip alias if there is no completion function triggered by the aliased command
|
||||||
if [[ ! " ${completions[*]} " =~ " $alias_cmd " ]]; then
|
if ! _bash-it-array-contains-element "$alias_cmd" "${completions[@]}"; then
|
||||||
if [[ -n "$completion_loader" ]]; then
|
if [[ -n "$completion_loader" ]]; then
|
||||||
# force loading of completions for the aliased command
|
# force loading of completions for the aliased command
|
||||||
eval "$completion_loader $alias_cmd"
|
eval "$completion_loader $alias_cmd"
|
||||||
# 124 means completion loader was successful
|
# 124 means completion loader was successful
|
||||||
[[ $? -eq 124 ]] || continue
|
[[ $? -eq 124 ]] || continue
|
||||||
completions+=($alias_cmd)
|
completions+=("$alias_cmd")
|
||||||
else
|
else
|
||||||
continue
|
continue
|
||||||
fi
|
fi
|
||||||
fi
|
fi
|
||||||
local new_completion="$(complete -p "$alias_cmd" 2>/dev/null)"
|
local new_completion="$(complete -p "$alias_cmd" 2> /dev/null)"
|
||||||
|
|
||||||
# create a wrapper inserting the alias arguments if any
|
# create a wrapper inserting the alias arguments if any
|
||||||
if [[ -n $alias_args ]]; then
|
if [[ -n $alias_args ]]; then
|
||||||
local compl_func="${new_completion/#* -F /}"; compl_func="${compl_func%% *}"
|
local compl_func="${new_completion/#* -F /}"
|
||||||
|
compl_func="${compl_func%% *}"
|
||||||
# avoid recursive call loops by ignoring our own functions
|
# avoid recursive call loops by ignoring our own functions
|
||||||
if [[ "${compl_func#_$namespace::}" == $compl_func ]]; then
|
if [[ "${compl_func#_$namespace::}" == "$compl_func" ]]; then
|
||||||
local compl_wrapper="_${namespace}::${alias_name}"
|
local compl_wrapper="_${namespace}::${alias_name}"
|
||||||
echo "function $compl_wrapper {
|
echo "function $compl_wrapper {
|
||||||
local compl_word=\$2
|
local compl_word=\$2
|
||||||
@@ -91,5 +99,8 @@ function alias_completion {
|
|||||||
echo "$new_completion" >> "$tmp_file"
|
echo "$new_completion" >> "$tmp_file"
|
||||||
fi
|
fi
|
||||||
done < <(alias -p | sed -Ene "s/$alias_regex/\2 '\3' '\4'/p")
|
done < <(alias -p | sed -Ene "s/$alias_regex/\2 '\3' '\4'/p")
|
||||||
|
# shellcheck source=/dev/null
|
||||||
source "$tmp_file" && command rm -f "$tmp_file"
|
source "$tmp_file" && command rm -f "$tmp_file"
|
||||||
}; alias_completion
|
}
|
||||||
|
|
||||||
|
alias_completion
|
||||||
|
|||||||
@@ -121,6 +121,18 @@ function scm {
|
|||||||
fi
|
fi
|
||||||
}
|
}
|
||||||
|
|
||||||
|
scm_prompt() {
|
||||||
|
local CHAR=$(scm_char)
|
||||||
|
local format=${SCM_PROMPT_FORMAT:-'[%s%s]'}
|
||||||
|
|
||||||
|
if [[ $CHAR = "$SCM_NONE_CHAR" ]]; then
|
||||||
|
return
|
||||||
|
else
|
||||||
|
# shellcheck disable=2059
|
||||||
|
printf "$format\n" "$CHAR" "$(scm_prompt_info)"
|
||||||
|
fi
|
||||||
|
}
|
||||||
|
|
||||||
function scm_prompt_char {
|
function scm_prompt_char {
|
||||||
if [[ -z $SCM ]]; then scm; fi
|
if [[ -z $SCM ]]; then scm; fi
|
||||||
if [[ $SCM == "$SCM_GIT" ]]; then
|
if [[ $SCM == "$SCM_GIT" ]]; then
|
||||||
@@ -359,7 +371,9 @@ function hg_prompt_vars {
|
|||||||
|
|
||||||
if [ -f "$HG_ROOT/branch" ]; then
|
if [ -f "$HG_ROOT/branch" ]; then
|
||||||
# Mercurial holds it's current branch in .hg/branch file
|
# Mercurial holds it's current branch in .hg/branch file
|
||||||
SCM_BRANCH=$(cat "$HG_ROOT/branch")
|
SCM_BRANCH=$(< "${HG_ROOT}/branch")
|
||||||
|
local bookmark=${HG_ROOT}/bookmarks.current
|
||||||
|
[[ -f ${bookmark} ]] && SCM_BRANCH+=:$(< "${bookmark}")
|
||||||
else
|
else
|
||||||
SCM_BRANCH=$(hg summary 2> /dev/null | grep branch: | awk '{print $2}')
|
SCM_BRANCH=$(hg summary 2> /dev/null | grep branch: | awk '{print $2}')
|
||||||
fi
|
fi
|
||||||
@@ -435,6 +449,10 @@ function k8s_context_prompt {
|
|||||||
echo -e "$(kubectl config current-context 2> /dev/null)"
|
echo -e "$(kubectl config current-context 2> /dev/null)"
|
||||||
}
|
}
|
||||||
|
|
||||||
|
function k8s_namespace_prompt {
|
||||||
|
echo -e "$(kubectl config view --minify --output 'jsonpath={..namespace}' 2> /dev/null)"
|
||||||
|
}
|
||||||
|
|
||||||
function virtualenv_prompt {
|
function virtualenv_prompt {
|
||||||
if [[ -n "$VIRTUAL_ENV" ]]; then
|
if [[ -n "$VIRTUAL_ENV" ]]; then
|
||||||
virtualenv=$(basename "$VIRTUAL_ENV")
|
virtualenv=$(basename "$VIRTUAL_ENV")
|
||||||
|
|||||||
@@ -31,15 +31,6 @@ function set_user_color() {
|
|||||||
esac
|
esac
|
||||||
}
|
}
|
||||||
|
|
||||||
scm_prompt() {
|
|
||||||
CHAR=$(scm_char)
|
|
||||||
if [ "$CHAR" = "$SCM_NONE_CHAR" ]; then
|
|
||||||
return
|
|
||||||
else
|
|
||||||
echo "[$(scm_char)$(scm_prompt_info)]"
|
|
||||||
fi
|
|
||||||
}
|
|
||||||
|
|
||||||
# Define custom colors we need
|
# Define custom colors we need
|
||||||
# non-printable bytes in PS1 need to be contained within \[ \].
|
# non-printable bytes in PS1 need to be contained within \[ \].
|
||||||
# Otherwise, bash will count them in the length of the prompt
|
# Otherwise, bash will count them in the length of the prompt
|
||||||
|
|||||||
@@ -15,16 +15,8 @@ is_vim_shell() {
|
|||||||
fi
|
fi
|
||||||
}
|
}
|
||||||
|
|
||||||
scm_prompt() {
|
|
||||||
CHAR=$(scm_char)
|
|
||||||
if [ "$CHAR" = "$SCM_NONE_CHAR" ]; then
|
|
||||||
return
|
|
||||||
else
|
|
||||||
echo " $(scm_char) (${white}$(scm_prompt_info)${normal})"
|
|
||||||
fi
|
|
||||||
}
|
|
||||||
|
|
||||||
prompt() {
|
prompt() {
|
||||||
|
SCM_PROMPT_FORMAT=' %s (%s)'
|
||||||
PS1="${white}${background_blue} \u${normal}${background_blue}@${red}${background_blue}\h $(clock_prompt) ${reset_color}${normal} $(battery_charge)\n${bold_black}${background_white} \w ${normal}$(scm_prompt)$(is_vim_shell)\n${white}>${normal} "
|
PS1="${white}${background_blue} \u${normal}${background_blue}@${red}${background_blue}\h $(clock_prompt) ${reset_color}${normal} $(battery_charge)\n${bold_black}${background_white} \w ${normal}$(scm_prompt)$(is_vim_shell)\n${white}>${normal} "
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -1,7 +1,7 @@
|
|||||||
#!/usr/bin/env bash
|
# shellcheck shell=bash
|
||||||
|
|
||||||
function prompt_command() {
|
function prompt_command() {
|
||||||
PS1="${green}\u@\h $(clock_prompt) ${reset_color}${white}\w${reset_color}$(scm_prompt_info)${blue} →${bold_blue} ${reset_color} ${normal}";
|
PS1="${green}\u@\h $(clock_prompt) ${reset_color}${white}\w${reset_color}$(scm_prompt_info)${blue} →${bold_blue} ${reset_color} ${normal}"
|
||||||
}
|
}
|
||||||
|
|
||||||
THEME_CLOCK_COLOR=${THEME_CLOCK_COLOR:-"$blue"}
|
THEME_CLOCK_COLOR=${THEME_CLOCK_COLOR:-"$blue"}
|
||||||
|
|||||||
@@ -3,16 +3,6 @@ SCM_THEME_PROMPT_DIRTY="${bold_red} ✗${normal}"
|
|||||||
SCM_THEME_PROMPT_CLEAN="${bold_green} ✓${normal}"
|
SCM_THEME_PROMPT_CLEAN="${bold_green} ✓${normal}"
|
||||||
SCM_GIT_CHAR="${green}±${normal}"
|
SCM_GIT_CHAR="${green}±${normal}"
|
||||||
|
|
||||||
scm_prompt() {
|
|
||||||
CHAR=$(scm_char)
|
|
||||||
if [ $CHAR = $SCM_NONE_CHAR ]
|
|
||||||
then
|
|
||||||
return
|
|
||||||
else
|
|
||||||
echo " [$(scm_char)$(scm_prompt_info)]"
|
|
||||||
fi
|
|
||||||
}
|
|
||||||
|
|
||||||
mark_prompt() {
|
mark_prompt() {
|
||||||
echo "${green}\$${normal}"
|
echo "${green}\$${normal}"
|
||||||
}
|
}
|
||||||
@@ -25,6 +15,7 @@ user_host_path_prompt() {
|
|||||||
}
|
}
|
||||||
|
|
||||||
prompt() {
|
prompt() {
|
||||||
|
SCM_PROMPT_FORMAT=' [%s%s]'
|
||||||
PS1="$(user_host_path_prompt)$(virtualenv_prompt)$(scm_prompt) $(mark_prompt) "
|
PS1="$(user_host_path_prompt)$(virtualenv_prompt)$(scm_prompt) $(mark_prompt) "
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -28,17 +28,6 @@ else
|
|||||||
THEME_PROMPT_HOST_COLOR="$blue"
|
THEME_PROMPT_HOST_COLOR="$blue"
|
||||||
fi
|
fi
|
||||||
|
|
||||||
doubletime_scm_prompt() {
|
|
||||||
CHAR=$(scm_char)
|
|
||||||
if [ $CHAR = $SCM_NONE_CHAR ]; then
|
|
||||||
return
|
|
||||||
elif [ $CHAR = $SCM_GIT_CHAR ]; then
|
|
||||||
echo "$(git_prompt_status)"
|
|
||||||
else
|
|
||||||
echo "[$(scm_prompt_info)]"
|
|
||||||
fi
|
|
||||||
}
|
|
||||||
|
|
||||||
function prompt_setter() {
|
function prompt_setter() {
|
||||||
# Save history
|
# Save history
|
||||||
history -a
|
history -a
|
||||||
@@ -46,27 +35,9 @@ function prompt_setter() {
|
|||||||
history -r
|
history -r
|
||||||
PS1="
|
PS1="
|
||||||
$(clock_prompt) $(scm_char) [${THEME_PROMPT_HOST_COLOR}\u@${THEME_PROMPT_HOST}$reset_color] $(virtualenv_prompt)$(ruby_version_prompt)\w
|
$(clock_prompt) $(scm_char) [${THEME_PROMPT_HOST_COLOR}\u@${THEME_PROMPT_HOST}$reset_color] $(virtualenv_prompt)$(ruby_version_prompt)\w
|
||||||
$(doubletime_scm_prompt)$reset_color $ "
|
$(scm_prompt)$reset_color $ "
|
||||||
PS2='> '
|
PS2='> '
|
||||||
PS4='+ '
|
PS4='+ '
|
||||||
}
|
}
|
||||||
|
|
||||||
safe_append_prompt_command prompt_setter
|
safe_append_prompt_command prompt_setter
|
||||||
|
|
||||||
git_prompt_status() {
|
|
||||||
local git_status_output
|
|
||||||
git_status_output=$(git status 2> /dev/null )
|
|
||||||
if [ -n "$(echo $git_status_output | grep 'Changes not staged')" ]; then
|
|
||||||
git_status="${bold_red}$(scm_prompt_info) ✗"
|
|
||||||
elif [ -n "$(echo $git_status_output | grep 'Changes to be committed')" ]; then
|
|
||||||
git_status="${bold_yellow}$(scm_prompt_info) ^"
|
|
||||||
elif [ -n "$(echo $git_status_output | grep 'Untracked files')" ]; then
|
|
||||||
git_status="${bold_cyan}$(scm_prompt_info) +"
|
|
||||||
elif [ -n "$(echo $git_status_output | grep 'nothing to commit')" ]; then
|
|
||||||
git_status="${bold_green}$(scm_prompt_info) ${green}✓"
|
|
||||||
else
|
|
||||||
git_status="$(scm_prompt_info)"
|
|
||||||
fi
|
|
||||||
echo "[$git_status${normal}]"
|
|
||||||
|
|
||||||
}
|
|
||||||
|
|||||||
@@ -4,26 +4,18 @@ SCM_THEME_PROMPT_SUFFIX=")${normal}"
|
|||||||
|
|
||||||
SCM_THEME_PROMPT_DIRTY="*"
|
SCM_THEME_PROMPT_DIRTY="*"
|
||||||
SCM_THEME_PROMPT_CLEAN=""
|
SCM_THEME_PROMPT_CLEAN=""
|
||||||
SCM_GIT_CHAR="g"
|
SCM_GIT_CHAR="${green}±${normal}"
|
||||||
SCM_SVN_CHAR="s"
|
SCM_SVN_CHAR="${bold_cyan}⑆${normal}"
|
||||||
SCM_HG_CHAR="h"
|
SCM_HG_CHAR="${bold_red}☿${normal}"
|
||||||
|
|
||||||
### TODO: openSUSE has already colors enabled, check if those differs from stock
|
### TODO: openSUSE has already colors enabled, check if those differs from stock
|
||||||
# LS colors, made with http://geoff.greer.fm/lscolors/
|
# LS colors, made with http://geoff.greer.fm/lscolors/
|
||||||
# export LSCOLORS="Gxfxcxdxbxegedabagacad"
|
# export LSCOLORS="Gxfxcxdxbxegedabagacad"
|
||||||
# export LS_COLORS='no=00:fi=00:di=01;34:ln=00;36:pi=40;33:so=01;35:do=01;35:bd=40;33;01:cd=40;33;01:or=41;33;01:ex=00;32:*.cmd=00;32:*.exe=01;32:*.com=01;32:*.bat=01;32:*.btm=01;32:*.dll=01;32:*.tar=00;31:*.tbz=00;31:*.tgz=00;31:*.rpm=00;31:*.deb=00;31:*.arj=00;31:*.taz=00;31:*.lzh=00;31:*.lzma=00;31:*.zip=00;31:*.zoo=00;31:*.z=00;31:*.Z=00;31:*.gz=00;31:*.bz2=00;31:*.tb2=00;31:*.tz2=00;31:*.tbz2=00;31:*.avi=01;35:*.bmp=01;35:*.fli=01;35:*.gif=01;35:*.jpg=01;35:*.jpeg=01;35:*.mng=01;35:*.mov=01;35:*.mpg=01;35:*.pcx=01;35:*.pbm=01;35:*.pgm=01;35:*.png=01;35:*.ppm=01;35:*.tga=01;35:*.tif=01;35:*.xbm=01;35:*.xpm=01;35:*.dl=01;35:*.gl=01;35:*.wmv=01;35:*.aiff=00;32:*.au=00;32:*.mid=00;32:*.mp3=00;32:*.ogg=00;32:*.voc=00;32:*.wav=00;32:'
|
# export LS_COLORS='no=00:fi=00:di=01;34:ln=00;36:pi=40;33:so=01;35:do=01;35:bd=40;33;01:cd=40;33;01:or=41;33;01:ex=00;32:*.cmd=00;32:*.exe=01;32:*.com=01;32:*.bat=01;32:*.btm=01;32:*.dll=01;32:*.tar=00;31:*.tbz=00;31:*.tgz=00;31:*.rpm=00;31:*.deb=00;31:*.arj=00;31:*.taz=00;31:*.lzh=00;31:*.lzma=00;31:*.zip=00;31:*.zoo=00;31:*.z=00;31:*.Z=00;31:*.gz=00;31:*.bz2=00;31:*.tb2=00;31:*.tz2=00;31:*.tbz2=00;31:*.avi=01;35:*.bmp=01;35:*.fli=01;35:*.gif=01;35:*.jpg=01;35:*.jpeg=01;35:*.mng=01;35:*.mov=01;35:*.mpg=01;35:*.pcx=01;35:*.pbm=01;35:*.pgm=01;35:*.png=01;35:*.ppm=01;35:*.tga=01;35:*.tif=01;35:*.xbm=01;35:*.xpm=01;35:*.dl=01;35:*.gl=01;35:*.wmv=01;35:*.aiff=00;32:*.au=00;32:*.mid=00;32:*.mp3=00;32:*.ogg=00;32:*.voc=00;32:*.wav=00;32:'
|
||||||
|
|
||||||
scm_prompt() {
|
gallifrey_prompt() {
|
||||||
CHAR=$(scm_char)
|
SCM_PROMPT_FORMAT='%s%s'
|
||||||
if [ $CHAR = $SCM_NONE_CHAR ]
|
|
||||||
then
|
|
||||||
return
|
|
||||||
else
|
|
||||||
echo "$(scm_prompt_info) "
|
|
||||||
fi
|
|
||||||
}
|
|
||||||
|
|
||||||
pure_prompt() {
|
|
||||||
ps_host="${green}\h${normal}";
|
ps_host="${green}\h${normal}";
|
||||||
ps_user_mark="${bold}\$${normal}";
|
ps_user_mark="${bold}\$${normal}";
|
||||||
ps_root_mark="${normal}§"
|
ps_root_mark="${normal}§"
|
||||||
@@ -38,4 +30,4 @@ pure_prompt() {
|
|||||||
esac
|
esac
|
||||||
}
|
}
|
||||||
|
|
||||||
safe_append_prompt_command pure_prompt
|
safe_append_prompt_command gallifrey_prompt
|
||||||
|
|||||||
@@ -69,16 +69,6 @@ is_vim_shell() {
|
|||||||
fi
|
fi
|
||||||
}
|
}
|
||||||
|
|
||||||
modern_scm_prompt() {
|
|
||||||
CHAR=$(scm_char)
|
|
||||||
if [ $CHAR = $SCM_NONE_CHAR ]
|
|
||||||
then
|
|
||||||
return
|
|
||||||
else
|
|
||||||
echo "[$(scm_char)][$GREEN$(scm_prompt_info)]"
|
|
||||||
fi
|
|
||||||
}
|
|
||||||
|
|
||||||
# show chroot if exist
|
# show chroot if exist
|
||||||
chroot(){
|
chroot(){
|
||||||
if [ -n "$debian_chroot" ]
|
if [ -n "$debian_chroot" ]
|
||||||
@@ -99,7 +89,7 @@ my_ve(){
|
|||||||
}
|
}
|
||||||
|
|
||||||
prompt() {
|
prompt() {
|
||||||
|
SCM_PROMPT_FORMAT="[%s$GREEN%s]"
|
||||||
my_ps_host="$BOLD$ORANGE\h${normal}";
|
my_ps_host="$BOLD$ORANGE\h${normal}";
|
||||||
# yes, these are the the same for now ...
|
# yes, these are the the same for now ...
|
||||||
my_ps_host_root="$ORANGE\h${normal}";
|
my_ps_host_root="$ORANGE\h${normal}";
|
||||||
@@ -114,10 +104,10 @@ prompt() {
|
|||||||
|
|
||||||
# nice prompt
|
# nice prompt
|
||||||
case "`id -u`" in
|
case "`id -u`" in
|
||||||
0) PS1="\n${TITLEBAR}${BRACKET_COLOR}┌─${normal}$(my_ve)$(chroot)[$my_ps_root][$my_ps_host_root]$(modern_scm_prompt)$(__my_rvm_ruby_version)[${green}\w${normal}]$(is_vim_shell)${BRACKET_COLOR}
|
0) PS1="\n${TITLEBAR}${BRACKET_COLOR}┌─${normal}$(my_ve)$(chroot)[$my_ps_root][$my_ps_host_root]$(scm_prompt)$(__my_rvm_ruby_version)[${green}\w${normal}]$(is_vim_shell)${BRACKET_COLOR}
|
||||||
└─▪ ${prompt_symbol} ${normal}"
|
└─▪ ${prompt_symbol} ${normal}"
|
||||||
;;
|
;;
|
||||||
*) PS1="\n${TITLEBAR}${BRACKET_COLOR}┌─${normal}$(my_ve)$(chroot)[$my_ps_user][$my_ps_host]$(modern_scm_prompt)${normal}$(__my_rvm_ruby_version)[${green}\w${normal}]$(is_vim_shell)${BRACKET_COLOR}
|
*) PS1="\n${TITLEBAR}${BRACKET_COLOR}┌─${normal}$(my_ve)$(chroot)[$my_ps_user][$my_ps_host]$(scm_prompt)${normal}$(__my_rvm_ruby_version)[${green}\w${normal}]$(is_vim_shell)${BRACKET_COLOR}
|
||||||
└─▪ ${prompt_symbol} ${normal}"
|
└─▪ ${prompt_symbol} ${normal}"
|
||||||
;;
|
;;
|
||||||
esac
|
esac
|
||||||
|
|||||||
@@ -32,26 +32,17 @@ is_vim_shell() {
|
|||||||
fi
|
fi
|
||||||
}
|
}
|
||||||
|
|
||||||
modern_scm_prompt() {
|
|
||||||
CHAR=$(scm_char)
|
|
||||||
if [ $CHAR = $SCM_NONE_CHAR ]
|
|
||||||
then
|
|
||||||
return
|
|
||||||
else
|
|
||||||
echo "[$(scm_char)][$(scm_prompt_info)]"
|
|
||||||
fi
|
|
||||||
}
|
|
||||||
|
|
||||||
prompt() {
|
prompt() {
|
||||||
|
SCM_PROMPT_FORMAT='[%s][%s]'
|
||||||
if [ $? -ne 0 ]
|
if [ $? -ne 0 ]
|
||||||
then
|
then
|
||||||
# Yes, the indenting on these is weird, but it has to be like
|
# Yes, the indenting on these is weird, but it has to be like
|
||||||
# this otherwise it won't display properly.
|
# this otherwise it won't display properly.
|
||||||
|
|
||||||
PS1="${TITLEBAR}${bold_red}┌─[${cyan}$(t | wc -l | sed -e's/ *//')${reset_color}]${reset_color}$(modern_scm_prompt)[${cyan}\W${normal}]$(is_vim_shell)
|
PS1="${TITLEBAR}${bold_red}┌─[${cyan}$(t | wc -l | sed -e's/ *//')${reset_color}]${reset_color}$(scm_prompt)[${cyan}\W${normal}]$(is_vim_shell)
|
||||||
${bold_red}└─▪${normal} "
|
${bold_red}└─▪${normal} "
|
||||||
else
|
else
|
||||||
PS1="${TITLEBAR}┌─[${cyan}$(t | wc -l | sed -e's/ *//')${reset_color}]$(modern_scm_prompt)[${cyan}\W${normal}]$(is_vim_shell)
|
PS1="${TITLEBAR}┌─[${cyan}$(t | wc -l | sed -e's/ *//')${reset_color}]$(scm_prompt)[${cyan}\W${normal}]$(is_vim_shell)
|
||||||
└─▪ "
|
└─▪ "
|
||||||
fi
|
fi
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -28,30 +28,21 @@ is_vim_shell() {
|
|||||||
fi
|
fi
|
||||||
}
|
}
|
||||||
|
|
||||||
modern_scm_prompt() {
|
|
||||||
CHAR=$(scm_char)
|
|
||||||
if [ $CHAR = $SCM_NONE_CHAR ]
|
|
||||||
then
|
|
||||||
return
|
|
||||||
else
|
|
||||||
echo "[$(scm_char)][$(scm_prompt_info)]"
|
|
||||||
fi
|
|
||||||
}
|
|
||||||
|
|
||||||
modern_current_time_prompt() {
|
modern_current_time_prompt() {
|
||||||
echo "[$(date '+%l:%M%p')]"
|
echo "[$(date '+%l:%M%p')]"
|
||||||
}
|
}
|
||||||
|
|
||||||
prompt() {
|
prompt() {
|
||||||
|
SCM_PROMPT_FORMAT='[%s][%s]'
|
||||||
if [ $? -ne 0 ]
|
if [ $? -ne 0 ]
|
||||||
then
|
then
|
||||||
# Yes, the indenting on these is weird, but it has to be like
|
# Yes, the indenting on these is weird, but it has to be like
|
||||||
# this otherwise it won't display properly.
|
# this otherwise it won't display properly.
|
||||||
|
|
||||||
PS1="${TITLEBAR}${bold_red}┌─${reset_color}$(modern_scm_prompt)$(modern_current_time_prompt)[${cyan}\W${normal}]$(is_vim_shell)
|
PS1="${TITLEBAR}${bold_red}┌─${reset_color}$(scm_prompt)$(modern_current_time_prompt)[${cyan}\W${normal}]$(is_vim_shell)
|
||||||
${bold_red}└─▪${normal} "
|
${bold_red}└─▪${normal} "
|
||||||
else
|
else
|
||||||
PS1="${TITLEBAR}┌─$(modern_scm_prompt)$(modern_current_time_prompt)[${cyan}\W${normal}]$(is_vim_shell)
|
PS1="${TITLEBAR}┌─$(scm_prompt)$(modern_current_time_prompt)[${cyan}\W${normal}]$(is_vim_shell)
|
||||||
└─▪ "
|
└─▪ "
|
||||||
fi
|
fi
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -26,15 +26,6 @@ is_vim_shell() {
|
|||||||
fi
|
fi
|
||||||
}
|
}
|
||||||
|
|
||||||
modern_scm_prompt() {
|
|
||||||
CHAR=$(scm_char)
|
|
||||||
if [ "$CHAR" = "$SCM_NONE_CHAR" ]; then
|
|
||||||
return
|
|
||||||
else
|
|
||||||
echo "[$(scm_char)][$(scm_prompt_info)]"
|
|
||||||
fi
|
|
||||||
}
|
|
||||||
|
|
||||||
detect_venv() {
|
detect_venv() {
|
||||||
python_venv=""
|
python_venv=""
|
||||||
# Detect python venv
|
# Detect python venv
|
||||||
@@ -46,11 +37,12 @@ detect_venv() {
|
|||||||
}
|
}
|
||||||
|
|
||||||
prompt() {
|
prompt() {
|
||||||
|
SCM_PROMPT_FORMAT='[%s][%s]'
|
||||||
retval=$?
|
retval=$?
|
||||||
if [[ retval -ne 0 ]]; then
|
if [[ retval -ne 0 ]]; then
|
||||||
PS1="${TITLEBAR}${bold_red}┌─${reset_color}$(modern_scm_prompt)[${cyan}\u${normal}][${cyan}\w${normal}]$(is_vim_shell)\n${bold_red}└─▪${normal} "
|
PS1="${TITLEBAR}${bold_red}┌─${reset_color}$(scm_prompt)[${cyan}\u${normal}][${cyan}\w${normal}]$(is_vim_shell)\n${bold_red}└─▪${normal} "
|
||||||
else
|
else
|
||||||
PS1="${TITLEBAR}┌─$(modern_scm_prompt)[${cyan}\u${normal}][${cyan}\w${normal}]$(is_vim_shell)\n└─▪ "
|
PS1="${TITLEBAR}┌─$(scm_prompt)[${cyan}\u${normal}][${cyan}\w${normal}]$(is_vim_shell)\n└─▪ "
|
||||||
fi
|
fi
|
||||||
detect_venv
|
detect_venv
|
||||||
PS1+="${python_venv}${dir_color}"
|
PS1+="${python_venv}${dir_color}"
|
||||||
|
|||||||
@@ -55,6 +55,9 @@ TERRAFORM_CHAR=${POWERLINE_TERRAFORM_CHAR:="❲t❳ "}
|
|||||||
KUBERNETES_CONTEXT_THEME_CHAR=${POWERLINE_KUBERNETES_CONTEXT_CHAR:="⎈ "}
|
KUBERNETES_CONTEXT_THEME_CHAR=${POWERLINE_KUBERNETES_CONTEXT_CHAR:="⎈ "}
|
||||||
KUBERNETES_CONTEXT_THEME_PROMPT_COLOR=${POWERLINE_KUBERNETES_CONTEXT_COLOR:=26}
|
KUBERNETES_CONTEXT_THEME_PROMPT_COLOR=${POWERLINE_KUBERNETES_CONTEXT_COLOR:=26}
|
||||||
|
|
||||||
|
KUBERNETES_NAMESPACE_THEME_CHAR=${POWERLINE_KUBERNETES_NAMESPACE_CHAR:="⎈ "}
|
||||||
|
KUBERNETES_NAMESPACE_THEME_PROMPT_COLOR=${POWERLINE_KUBERNETES_NAMESPACE_COLOR:=64}
|
||||||
|
|
||||||
AWS_PROFILE_CHAR=${POWERLINE_AWS_PROFILE_CHAR:="❲aws❳ "}
|
AWS_PROFILE_CHAR=${POWERLINE_AWS_PROFILE_CHAR:="❲aws❳ "}
|
||||||
AWS_PROFILE_PROMPT_COLOR=${POWERLINE_AWS_PROFILE_COLOR:=208}
|
AWS_PROFILE_PROMPT_COLOR=${POWERLINE_AWS_PROFILE_COLOR:=208}
|
||||||
|
|
||||||
@@ -94,6 +97,8 @@ COMMAND_NUMBER_THEME_PROMPT_CHAR=${POWERLINE_COMMAND_NUMBER_CHAR:="#"}
|
|||||||
GCLOUD_THEME_PROMPT_COLOR=${POWERLINE_GCLOUD_COLOR:=161}
|
GCLOUD_THEME_PROMPT_COLOR=${POWERLINE_GCLOUD_COLOR:=161}
|
||||||
GCLOUD_CHAR=${POWERLINE_GCLOUD_CHAR:="❲G❳ "}
|
GCLOUD_CHAR=${POWERLINE_GCLOUD_CHAR:="❲G❳ "}
|
||||||
|
|
||||||
|
COMMAND_DURATION_PROMPT_COLOR=${POWERLINE_COMMAND_DURATION_COLOR:=129}
|
||||||
|
|
||||||
POWERLINE_LEFT_PROMPT=${POWERLINE_LEFT_PROMPT:="scm python_venv ruby node cwd"}
|
POWERLINE_LEFT_PROMPT=${POWERLINE_LEFT_PROMPT:="scm python_venv ruby node cwd"}
|
||||||
POWERLINE_RIGHT_PROMPT=${POWERLINE_RIGHT_PROMPT:="in_vim clock battery user_info"}
|
POWERLINE_RIGHT_PROMPT=${POWERLINE_RIGHT_PROMPT:="in_vim clock battery user_info"}
|
||||||
|
|
||||||
|
|||||||
@@ -50,6 +50,9 @@ TERRAFORM_CHAR=${POWERLINE_TERRAFORM_CHAR:="❲t❳ "}
|
|||||||
KUBERNETES_CONTEXT_THEME_CHAR=${POWERLINE_KUBERNETES_CONTEXT_CHAR:="⎈ "}
|
KUBERNETES_CONTEXT_THEME_CHAR=${POWERLINE_KUBERNETES_CONTEXT_CHAR:="⎈ "}
|
||||||
KUBERNETES_CONTEXT_THEME_PROMPT_COLOR=${POWERLINE_KUBERNETES_CONTEXT_COLOR:=26}
|
KUBERNETES_CONTEXT_THEME_PROMPT_COLOR=${POWERLINE_KUBERNETES_CONTEXT_COLOR:=26}
|
||||||
|
|
||||||
|
KUBERNETES_NAMESPACE_THEME_CHAR=${POWERLINE_KUBERNETES_NAMESPACE_CHAR:="⎈ "}
|
||||||
|
KUBERNETES_NAMESPACE_THEME_PROMPT_COLOR=${POWERLINE_KUBERNETES_NAMESPACE_COLOR:=64}
|
||||||
|
|
||||||
AWS_PROFILE_CHAR=${POWERLINE_AWS_PROFILE_CHAR:="❲aws❳ "}
|
AWS_PROFILE_CHAR=${POWERLINE_AWS_PROFILE_CHAR:="❲aws❳ "}
|
||||||
AWS_PROFILE_PROMPT_COLOR=${POWERLINE_AWS_PROFILE_COLOR:=208}
|
AWS_PROFILE_PROMPT_COLOR=${POWERLINE_AWS_PROFILE_COLOR:=208}
|
||||||
|
|
||||||
|
|||||||
@@ -47,6 +47,9 @@ TERRAFORM_CHAR=${POWERLINE_TERRAFORM_CHAR:="❲t❳ "}
|
|||||||
KUBERNETES_CONTEXT_THEME_CHAR=${POWERLINE_KUBERNETES_CONTEXT_CHAR:="⎈ "}
|
KUBERNETES_CONTEXT_THEME_CHAR=${POWERLINE_KUBERNETES_CONTEXT_CHAR:="⎈ "}
|
||||||
KUBERNETES_CONTEXT_THEME_PROMPT_COLOR=${POWERLINE_KUBERNETES_CONTEXT_COLOR:=26}
|
KUBERNETES_CONTEXT_THEME_PROMPT_COLOR=${POWERLINE_KUBERNETES_CONTEXT_COLOR:=26}
|
||||||
|
|
||||||
|
KUBERNETES_NAMESPACE_THEME_CHAR=${POWERLINE_KUBERNETES_NAMESPACE_CHAR:="⎈ "}
|
||||||
|
KUBERNETES_NAMESPACE_THEME_PROMPT_COLOR=${POWERLINE_KUBERNETES_NAMESPACE_COLOR:=60}
|
||||||
|
|
||||||
AWS_PROFILE_CHAR=${POWERLINE_AWS_PROFILE_CHAR:="❲aws❳ "}
|
AWS_PROFILE_CHAR=${POWERLINE_AWS_PROFILE_CHAR:="❲aws❳ "}
|
||||||
AWS_PROFILE_PROMPT_COLOR=${POWERLINE_AWS_PROFILE_COLOR:=208}
|
AWS_PROFILE_PROMPT_COLOR=${POWERLINE_AWS_PROFILE_COLOR:=208}
|
||||||
|
|
||||||
|
|||||||
@@ -85,6 +85,16 @@ function __powerline_k8s_context_prompt() {
|
|||||||
[[ -n "${kubernetes_context}" ]] && echo "${KUBERNETES_CONTEXT_THEME_CHAR}${kubernetes_context}|${KUBERNETES_CONTEXT_THEME_PROMPT_COLOR}"
|
[[ -n "${kubernetes_context}" ]] && echo "${KUBERNETES_CONTEXT_THEME_CHAR}${kubernetes_context}|${KUBERNETES_CONTEXT_THEME_PROMPT_COLOR}"
|
||||||
}
|
}
|
||||||
|
|
||||||
|
function __powerline_k8s_namespace_prompt() {
|
||||||
|
local kubernetes_namespace=""
|
||||||
|
|
||||||
|
if _command_exists kubectl; then
|
||||||
|
kubernetes_namespace="$(k8s_namespace_prompt)"
|
||||||
|
fi
|
||||||
|
|
||||||
|
[[ -n "${kubernetes_namespace}" ]] && echo "${KUBERNETES_NAMESPACE_THEME_CHAR}${kubernetes_namespace}|${KUBERNETES_NAMESPACE_THEME_PROMPT_COLOR}"
|
||||||
|
}
|
||||||
|
|
||||||
function __powerline_python_venv_prompt() {
|
function __powerline_python_venv_prompt() {
|
||||||
set +u
|
set +u
|
||||||
local python_venv=""
|
local python_venv=""
|
||||||
@@ -210,6 +220,11 @@ function __powerline_command_number_prompt() {
|
|||||||
echo "${COMMAND_NUMBER_THEME_PROMPT_CHAR}\#|${COMMAND_NUMBER_THEME_PROMPT_COLOR}"
|
echo "${COMMAND_NUMBER_THEME_PROMPT_CHAR}\#|${COMMAND_NUMBER_THEME_PROMPT_COLOR}"
|
||||||
}
|
}
|
||||||
|
|
||||||
|
function __powerline_duration_prompt() {
|
||||||
|
local duration=$(_command_duration)
|
||||||
|
[[ -n "$duration" ]] && echo "${duration}|${COMMAND_DURATION_PROMPT_COLOR}"
|
||||||
|
}
|
||||||
|
|
||||||
function __powerline_left_segment() {
|
function __powerline_left_segment() {
|
||||||
local params
|
local params
|
||||||
IFS="|" read -ra params <<< "${1}"
|
IFS="|" read -ra params <<< "${1}"
|
||||||
|
|||||||
@@ -52,6 +52,9 @@ TERRAFORM_CHAR=${POWERLINE_TERRAFORM_CHAR:="❲t❳ "}
|
|||||||
KUBERNETES_CONTEXT_THEME_CHAR=${POWERLINE_KUBERNETES_CONTEXT_CHAR:="⎈ "}
|
KUBERNETES_CONTEXT_THEME_CHAR=${POWERLINE_KUBERNETES_CONTEXT_CHAR:="⎈ "}
|
||||||
KUBERNETES_CONTEXT_THEME_PROMPT_COLOR=${POWERLINE_KUBERNETES_CONTEXT_COLOR:=26}
|
KUBERNETES_CONTEXT_THEME_PROMPT_COLOR=${POWERLINE_KUBERNETES_CONTEXT_COLOR:=26}
|
||||||
|
|
||||||
|
KUBERNETES_NAMESPACE_THEME_CHAR=${POWERLINE_KUBERNETES_NAMESPACE_CHAR:="⎈ "}
|
||||||
|
KUBERNETES_NAMESPACE_THEME_PROMPT_COLOR=${POWERLINE_KUBERNETES_NAMESPACE_COLOR:=64}
|
||||||
|
|
||||||
AWS_PROFILE_CHAR=${POWERLINE_AWS_PROFILE_CHAR:="❲aws❳ "}
|
AWS_PROFILE_CHAR=${POWERLINE_AWS_PROFILE_CHAR:="❲aws❳ "}
|
||||||
AWS_PROFILE_PROMPT_COLOR=${POWERLINE_AWS_PROFILE_COLOR:=208}
|
AWS_PROFILE_PROMPT_COLOR=${POWERLINE_AWS_PROFILE_COLOR:=208}
|
||||||
|
|
||||||
@@ -91,6 +94,8 @@ COMMAND_NUMBER_THEME_PROMPT_CHAR=${POWERLINE_COMMAND_NUMBER_CHAR:="#"}
|
|||||||
GCLOUD_THEME_PROMPT_COLOR=${POWERLINE_GCLOUD_COLOR:=161}
|
GCLOUD_THEME_PROMPT_COLOR=${POWERLINE_GCLOUD_COLOR:=161}
|
||||||
GCLOUD_CHAR=${POWERLINE_GCLOUD_CHAR:="❲G❳ "}
|
GCLOUD_CHAR=${POWERLINE_GCLOUD_CHAR:="❲G❳ "}
|
||||||
|
|
||||||
|
COMMAND_DURATION_PROMPT_COLOR=${POWERLINE_COMMAND_DURATION_COLOR:=129}
|
||||||
|
|
||||||
POWERLINE_PROMPT=${POWERLINE_PROMPT:="user_info scm python_venv ruby node cwd"}
|
POWERLINE_PROMPT=${POWERLINE_PROMPT:="user_info scm python_venv ruby node cwd"}
|
||||||
|
|
||||||
safe_append_prompt_command __powerline_prompt_command
|
safe_append_prompt_command __powerline_prompt_command
|
||||||
|
|||||||
@@ -1,3 +1,5 @@
|
|||||||
|
# shellcheck shell=bash
|
||||||
|
|
||||||
# scm theming
|
# scm theming
|
||||||
SCM_THEME_PROMPT_PREFIX="|"
|
SCM_THEME_PROMPT_PREFIX="|"
|
||||||
SCM_THEME_PROMPT_SUFFIX=""
|
SCM_THEME_PROMPT_SUFFIX=""
|
||||||
@@ -16,29 +18,20 @@ VIRTUALENV_THEME_PROMPT_SUFFIX=")"
|
|||||||
# export LSCOLORS="Gxfxcxdxbxegedabagacad"
|
# export LSCOLORS="Gxfxcxdxbxegedabagacad"
|
||||||
# export LS_COLORS='no=00:fi=00:di=01;34:ln=00;36:pi=40;33:so=01;35:do=01;35:bd=40;33;01:cd=40;33;01:or=41;33;01:ex=00;32:*.cmd=00;32:*.exe=01;32:*.com=01;32:*.bat=01;32:*.btm=01;32:*.dll=01;32:*.tar=00;31:*.tbz=00;31:*.tgz=00;31:*.rpm=00;31:*.deb=00;31:*.arj=00;31:*.taz=00;31:*.lzh=00;31:*.lzma=00;31:*.zip=00;31:*.zoo=00;31:*.z=00;31:*.Z=00;31:*.gz=00;31:*.bz2=00;31:*.tb2=00;31:*.tz2=00;31:*.tbz2=00;31:*.avi=01;35:*.bmp=01;35:*.fli=01;35:*.gif=01;35:*.jpg=01;35:*.jpeg=01;35:*.mng=01;35:*.mov=01;35:*.mpg=01;35:*.pcx=01;35:*.pbm=01;35:*.pgm=01;35:*.png=01;35:*.ppm=01;35:*.tga=01;35:*.tif=01;35:*.xbm=01;35:*.xpm=01;35:*.dl=01;35:*.gl=01;35:*.wmv=01;35:*.aiff=00;32:*.au=00;32:*.mid=00;32:*.mp3=00;32:*.ogg=00;32:*.voc=00;32:*.wav=00;32:'
|
# export LS_COLORS='no=00:fi=00:di=01;34:ln=00;36:pi=40;33:so=01;35:do=01;35:bd=40;33;01:cd=40;33;01:or=41;33;01:ex=00;32:*.cmd=00;32:*.exe=01;32:*.com=01;32:*.bat=01;32:*.btm=01;32:*.dll=01;32:*.tar=00;31:*.tbz=00;31:*.tgz=00;31:*.rpm=00;31:*.deb=00;31:*.arj=00;31:*.taz=00;31:*.lzh=00;31:*.lzma=00;31:*.zip=00;31:*.zoo=00;31:*.z=00;31:*.Z=00;31:*.gz=00;31:*.bz2=00;31:*.tb2=00;31:*.tz2=00;31:*.tbz2=00;31:*.avi=01;35:*.bmp=01;35:*.fli=01;35:*.gif=01;35:*.jpg=01;35:*.jpeg=01;35:*.mng=01;35:*.mov=01;35:*.mpg=01;35:*.pcx=01;35:*.pbm=01;35:*.pgm=01;35:*.png=01;35:*.ppm=01;35:*.tga=01;35:*.tif=01;35:*.xbm=01;35:*.xpm=01;35:*.dl=01;35:*.gl=01;35:*.wmv=01;35:*.aiff=00;32:*.au=00;32:*.mid=00;32:*.mp3=00;32:*.ogg=00;32:*.voc=00;32:*.wav=00;32:'
|
||||||
|
|
||||||
scm_prompt() {
|
|
||||||
CHAR=$(scm_char)
|
|
||||||
if [ $CHAR = $SCM_NONE_CHAR ]
|
|
||||||
then
|
|
||||||
return
|
|
||||||
else
|
|
||||||
echo "[$(scm_char)$(scm_prompt_info)]"
|
|
||||||
fi
|
|
||||||
}
|
|
||||||
|
|
||||||
pure_prompt() {
|
pure_prompt() {
|
||||||
ps_host="${bold_blue}\h${normal}";
|
ps_host="${bold_blue}\h${normal}"
|
||||||
ps_user="${green}\u${normal}";
|
ps_user="${green}\u${normal}"
|
||||||
ps_user_mark="${green} $ ${normal}";
|
ps_user_mark="${green} $ ${normal}"
|
||||||
ps_root="${red}\u${red}";
|
ps_root="${red}\u${red}"
|
||||||
ps_root_mark="${red} # ${normal}"
|
ps_root_mark="${red} # ${normal}"
|
||||||
ps_path="${yellow}\w${normal}";
|
ps_path="${yellow}\w${normal}"
|
||||||
|
|
||||||
# make it work
|
# make it work
|
||||||
case $(id -u) in
|
case $(id -u) in
|
||||||
0) PS1="$(virtualenv_prompt)$ps_root@$ps_host$(scm_prompt):$ps_path$ps_root_mark"
|
0)
|
||||||
|
PS1="$(virtualenv_prompt)$ps_root@$ps_host$(scm_prompt):$ps_path$ps_root_mark"
|
||||||
;;
|
;;
|
||||||
*) PS1="$(virtualenv_prompt)$ps_user@$ps_host$(scm_prompt):$ps_path$ps_user_mark"
|
*)
|
||||||
|
PS1="$(virtualenv_prompt)$ps_user@$ps_host$(scm_prompt):$ps_path$ps_user_mark"
|
||||||
;;
|
;;
|
||||||
esac
|
esac
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -36,16 +36,6 @@ is_vim_shell() {
|
|||||||
fi
|
fi
|
||||||
}
|
}
|
||||||
|
|
||||||
modern_scm_prompt() {
|
|
||||||
CHAR=$(scm_char)
|
|
||||||
if [ $CHAR = $SCM_NONE_CHAR ]
|
|
||||||
then
|
|
||||||
return
|
|
||||||
else
|
|
||||||
echo "[$(scm_char)][$(scm_prompt_info)]"
|
|
||||||
fi
|
|
||||||
}
|
|
||||||
|
|
||||||
# show chroot if exist
|
# show chroot if exist
|
||||||
chroot(){
|
chroot(){
|
||||||
if [ -n "$debian_chroot" ]
|
if [ -n "$debian_chroot" ]
|
||||||
@@ -71,7 +61,7 @@ my_ve(){
|
|||||||
}
|
}
|
||||||
|
|
||||||
prompt() {
|
prompt() {
|
||||||
|
SCM_PROMPT_FORMAT='[%s][%s]'
|
||||||
my_ps_host="${green}\h${normal}";
|
my_ps_host="${green}\h${normal}";
|
||||||
# yes, these are the the same for now ...
|
# yes, these are the the same for now ...
|
||||||
my_ps_host_root="${green}\h${normal}";
|
my_ps_host_root="${green}\h${normal}";
|
||||||
@@ -86,10 +76,10 @@ prompt() {
|
|||||||
|
|
||||||
# nice prompt
|
# nice prompt
|
||||||
case "`id -u`" in
|
case "`id -u`" in
|
||||||
0) PS1="${TITLEBAR}┌─$(my_ve)$(chroot)[$my_ps_root][$my_ps_host_root]$(modern_scm_prompt)$(__my_rvm_ruby_version)[${cyan}\w${normal}]
|
0) PS1="${TITLEBAR}┌─$(my_ve)$(chroot)[$my_ps_root][$my_ps_host_root]$(scm_prompt)$(__my_rvm_ruby_version)[${cyan}\w${normal}]
|
||||||
▪ "
|
▪ "
|
||||||
;;
|
;;
|
||||||
*) PS1="${TITLEBAR}┌─$(my_ve)$(chroot)[$my_ps_user][$my_ps_host]$(modern_scm_prompt)$(__my_rvm_ruby_version)
|
*) PS1="${TITLEBAR}┌─$(my_ve)$(chroot)[$my_ps_user][$my_ps_host]$(scm_prompt)$(__my_rvm_ruby_version)
|
||||||
|─[${bold_purple}\w${normal}]
|
|─[${bold_purple}\w${normal}]
|
||||||
▪ "
|
▪ "
|
||||||
;;
|
;;
|
||||||
|
|||||||
@@ -57,16 +57,6 @@ todo_txt_count() {
|
|||||||
fi
|
fi
|
||||||
}
|
}
|
||||||
|
|
||||||
modern_scm_prompt() {
|
|
||||||
CHAR=$(scm_char)
|
|
||||||
if [ $CHAR = $SCM_NONE_CHAR ]
|
|
||||||
then
|
|
||||||
return
|
|
||||||
else
|
|
||||||
echo "${BRACKET_COLOR}[${CHAR}${BRACKET_COLOR}][${STRING_COLOR}$(scm_prompt_info)${BRACKET_COLOR}]$normal"
|
|
||||||
fi
|
|
||||||
}
|
|
||||||
|
|
||||||
my_prompt_char() {
|
my_prompt_char() {
|
||||||
if [[ $OSTYPE =~ "darwin" ]]; then
|
if [[ $OSTYPE =~ "darwin" ]]; then
|
||||||
echo "${BRACKET_COLOR}➞ ${normal}"
|
echo "${BRACKET_COLOR}➞ ${normal}"
|
||||||
@@ -76,6 +66,7 @@ my_prompt_char() {
|
|||||||
}
|
}
|
||||||
|
|
||||||
prompt() {
|
prompt() {
|
||||||
|
SCM_PROMPT_FORMAT="${BRACKET_COLOR}[%s${BRACKET_COLOR}][${STRING_COLOR}%s${BRACKET_COLOR}]"
|
||||||
|
|
||||||
my_ps_host="${STRING_COLOR}\h${normal}";
|
my_ps_host="${STRING_COLOR}\h${normal}";
|
||||||
my_ps_user="${STRING_COLOR}\u${normal}";
|
my_ps_user="${STRING_COLOR}\u${normal}";
|
||||||
@@ -84,10 +75,10 @@ prompt() {
|
|||||||
|
|
||||||
# nice prompt
|
# nice prompt
|
||||||
case "`id -u`" in
|
case "`id -u`" in
|
||||||
0) PS1="${TITLEBAR}${BRACKET_COLOR}┌─[$my_ps_root${BRACKET_COLOR}][$my_ps_host${BRACKET_COLOR}]$(modern_scm_prompt)$(__my_rvm_ruby_version)${BRACKET_COLOR}[${STRING_COLOR}\w${BRACKET_COLOR}]$(is_vim_shell)
|
0) PS1="${TITLEBAR}${BRACKET_COLOR}┌─[$my_ps_root${BRACKET_COLOR}][$my_ps_host${BRACKET_COLOR}]$(scm_prompt)$(__my_rvm_ruby_version)${BRACKET_COLOR}[${STRING_COLOR}\w${BRACKET_COLOR}]$(is_vim_shell)
|
||||||
${BRACKET_COLOR}└─$(my_prompt_char)${normal}"
|
${BRACKET_COLOR}└─$(my_prompt_char)${normal}"
|
||||||
;;
|
;;
|
||||||
*) PS1="${TITLEBAR}${BRACKET_COLOR}┌─[$my_ps_user${BRACKET_COLOR}][$my_ps_host${BRACKET_COLOR}]$(modern_scm_prompt)$(__my_rvm_ruby_version)${BRACKET_COLOR}[${STRING_COLOR}\w${BRACKET_COLOR}]$(is_vim_shell)
|
*) PS1="${TITLEBAR}${BRACKET_COLOR}┌─[$my_ps_user${BRACKET_COLOR}][$my_ps_host${BRACKET_COLOR}]$(scm_prompt)$(__my_rvm_ruby_version)${BRACKET_COLOR}[${STRING_COLOR}\w${BRACKET_COLOR}]$(is_vim_shell)
|
||||||
${BRACKET_COLOR}└─$(todo_txt_count)$(my_prompt_char)"
|
${BRACKET_COLOR}└─$(todo_txt_count)$(my_prompt_char)"
|
||||||
;;
|
;;
|
||||||
esac
|
esac
|
||||||
|
|||||||
@@ -43,18 +43,8 @@ is_vim_shell() {
|
|||||||
fi
|
fi
|
||||||
}
|
}
|
||||||
|
|
||||||
modern_scm_prompt() {
|
|
||||||
CHAR=$(scm_char)
|
|
||||||
if [ $CHAR = $SCM_NONE_CHAR ]
|
|
||||||
then
|
|
||||||
return
|
|
||||||
else
|
|
||||||
echo "[$(scm_char)][$(scm_prompt_info)]"
|
|
||||||
fi
|
|
||||||
}
|
|
||||||
|
|
||||||
prompt() {
|
prompt() {
|
||||||
|
SCM_PROMPT_FORMAT='[%s][%s]'
|
||||||
case $HOSTNAME in
|
case $HOSTNAME in
|
||||||
"clappy"* ) my_ps_host="${green}\h${normal}";
|
"clappy"* ) my_ps_host="${green}\h${normal}";
|
||||||
;;
|
;;
|
||||||
@@ -70,10 +60,10 @@ prompt() {
|
|||||||
|
|
||||||
# nice prompt
|
# nice prompt
|
||||||
case "`id -u`" in
|
case "`id -u`" in
|
||||||
0) PS1="${TITLEBAR}[$my_ps_root][$my_ps_host]$(modern_scm_prompt)$(__my_rvm_ruby_version)[${cyan}\w${normal}]$(is_vim_shell)
|
0) PS1="${TITLEBAR}[$my_ps_root][$my_ps_host]$(scm_prompt)$(__my_rvm_ruby_version)[${cyan}\w${normal}]$(is_vim_shell)
|
||||||
$ "
|
$ "
|
||||||
;;
|
;;
|
||||||
*) PS1="${TITLEBAR}[$my_ps_user][$my_ps_host]$(modern_scm_prompt)$(__my_rvm_ruby_version)$(__my_venv_prompt)[${cyan}\w${normal}]$(is_vim_shell)
|
*) PS1="${TITLEBAR}[$my_ps_user][$my_ps_host]$(scm_prompt)$(__my_rvm_ruby_version)$(__my_venv_prompt)[${cyan}\w${normal}]$(is_vim_shell)
|
||||||
$ "
|
$ "
|
||||||
;;
|
;;
|
||||||
esac
|
esac
|
||||||
|
|||||||
@@ -36,16 +36,6 @@ is_vim_shell() {
|
|||||||
fi
|
fi
|
||||||
}
|
}
|
||||||
|
|
||||||
modern_scm_prompt() {
|
|
||||||
CHAR=$(scm_char)
|
|
||||||
if [ $CHAR = $SCM_NONE_CHAR ]
|
|
||||||
then
|
|
||||||
return
|
|
||||||
else
|
|
||||||
echo "[$(scm_char)][$(scm_prompt_info)]"
|
|
||||||
fi
|
|
||||||
}
|
|
||||||
|
|
||||||
# show chroot if exist
|
# show chroot if exist
|
||||||
chroot(){
|
chroot(){
|
||||||
if [ -n "$debian_chroot" ]
|
if [ -n "$debian_chroot" ]
|
||||||
@@ -71,7 +61,7 @@ my_ve(){
|
|||||||
}
|
}
|
||||||
|
|
||||||
prompt() {
|
prompt() {
|
||||||
|
SCM_PROMPT_FORMAT='[%s][%s]'
|
||||||
my_ps_host="${green}\h${normal}";
|
my_ps_host="${green}\h${normal}";
|
||||||
# yes, these are the the same for now ...
|
# yes, these are the the same for now ...
|
||||||
my_ps_host_root="${green}\h${normal}";
|
my_ps_host_root="${green}\h${normal}";
|
||||||
@@ -86,10 +76,10 @@ prompt() {
|
|||||||
|
|
||||||
# nice prompt
|
# nice prompt
|
||||||
case "`id -u`" in
|
case "`id -u`" in
|
||||||
0) PS1="${TITLEBAR}┌─$(my_ve)$(chroot)[$my_ps_root][$my_ps_host_root]$(modern_scm_prompt)$(__my_rvm_ruby_version)[${cyan}\w${normal}]$(is_vim_shell)
|
0) PS1="${TITLEBAR}┌─$(my_ve)$(chroot)[$my_ps_root][$my_ps_host_root]$(scm_prompt)$(__my_rvm_ruby_version)[${cyan}\w${normal}]$(is_vim_shell)
|
||||||
└─▪ "
|
└─▪ "
|
||||||
;;
|
;;
|
||||||
*) PS1="${TITLEBAR}┌─$(my_ve)$(chroot)[$my_ps_user][$my_ps_host]$(modern_scm_prompt)$(__my_rvm_ruby_version)[${cyan}\w${normal}]$(is_vim_shell)
|
*) PS1="${TITLEBAR}┌─$(my_ve)$(chroot)[$my_ps_user][$my_ps_host]$(scm_prompt)$(__my_rvm_ruby_version)[${cyan}\w${normal}]$(is_vim_shell)
|
||||||
└─▪ "
|
└─▪ "
|
||||||
;;
|
;;
|
||||||
esac
|
esac
|
||||||
|
|||||||
21
vendor/github.com/rparree/jboss-bash-completion/LICENSE
generated
vendored
Normal file
21
vendor/github.com/rparree/jboss-bash-completion/LICENSE
generated
vendored
Normal file
@@ -0,0 +1,21 @@
|
|||||||
|
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.
|
||||||
37
vendor/github.com/rparree/jboss-bash-completion/README.md
generated
vendored
Normal file
37
vendor/github.com/rparree/jboss-bash-completion/README.md
generated
vendored
Normal file
@@ -0,0 +1,37 @@
|
|||||||
|
jboss-bash-completion
|
||||||
|
=====================
|
||||||
|
|
||||||
|
JBoss Bash Completion for JBoss 5 and 7 (EAP 6)
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
Overview
|
||||||
|
--------
|
||||||
|
|
||||||
|
Completion for the `run.sh` (JBoss5) and `standalone.sh`/`domain.sh`
|
||||||
|
|
||||||
|
Some of the options available in jboss7:
|
||||||
|
|
||||||
|
|
||||||
|
* `--admin-only` `-h` `-help` `-version` `-V` `-v`
|
||||||
|
* `-Djboss.home.dir`
|
||||||
|
* `--server-config` (options the xml files in the configuration directory relative to -Djboss.server.base.dir)
|
||||||
|
* `-b` `-bmanagement` `-bunsecure` `-bpublic` `-Djboss.domain.master.address` `-Djboss.bind.address.*` (options: your local IP addresses and 0.0.0.0)
|
||||||
|
* `-Djboss.socket.binding.port-offset` (options: 100 200 300 400 10000 20000 30000 40000)
|
||||||
|
* `-u` (options 239.255.0.1 239.255.0.2 239.255.0.3)
|
||||||
|
* `-P` -Djboss.node.name
|
||||||
|
|
||||||
|
|
||||||
|
Install
|
||||||
|
-------
|
||||||
|
|
||||||
|
Make sure you have installed bash_completion 1.3 (or higher):
|
||||||
|
|
||||||
|
Debian/Ubuntu: `apt-get install bash-completion`
|
||||||
|
RHEL/CentOS: `yum install bash-completion`
|
||||||
|
|
||||||
|
Copy the file(s) to your `/etc/bash_completion.d` folder:
|
||||||
|
|
||||||
|
`sudo cp jboss* /etc/bash_completion.d`
|
||||||
|
|
||||||
|
|
||||||
95
vendor/github.com/rparree/jboss-bash-completion/jboss5
generated
vendored
Normal file
95
vendor/github.com/rparree/jboss-bash-completion/jboss5
generated
vendored
Normal file
@@ -0,0 +1,95 @@
|
|||||||
|
# Completions for JBoss Application Server 5
|
||||||
|
# VERSION: 1.3
|
||||||
|
# DATE: 2012-06-21
|
||||||
|
# rparree-at-edc4it-dot-com
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
_serverProfiles5(){
|
||||||
|
# from http://unix.stackexchange.com/questions/34238/complete-files-from-a-different-directory-in-bash
|
||||||
|
if [ -d "../server" ]
|
||||||
|
then
|
||||||
|
IFS=$'\n' tmp=( $(compgen -W "$(ls "../server")" -- "$cur" ))
|
||||||
|
COMPREPLY=( "${tmp[@]// /\ }" )
|
||||||
|
unset IFS
|
||||||
|
else
|
||||||
|
COMPREPLY=( $(compgen -W "default standard all web minimal production" -- ${cur}) )
|
||||||
|
fi
|
||||||
|
}
|
||||||
|
|
||||||
|
_bindingAddress5(){
|
||||||
|
# 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" ) )
|
||||||
|
}
|
||||||
|
|
||||||
|
_jboss5()
|
||||||
|
{
|
||||||
|
|
||||||
|
local cur prev words cword
|
||||||
|
COMPREPLY=()
|
||||||
|
_get_comp_words_by_ref -n = cur prev words cword
|
||||||
|
|
||||||
|
case $cur in
|
||||||
|
|
||||||
|
-Djboss.service.binding.set=*)
|
||||||
|
cur=${cur#*=}
|
||||||
|
#static list of common bindings sets
|
||||||
|
local bindings="ports-01 ports-02 ports-03 ports-04"
|
||||||
|
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
|
||||||
|
;;
|
||||||
|
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
|
||||||
|
;;
|
||||||
|
-l)
|
||||||
|
local loggers="log4j jdk"
|
||||||
|
COMPREPLY=( $(compgen -W "${loggers}" -- ${cur}) )
|
||||||
|
return 0
|
||||||
|
;;
|
||||||
|
-b)
|
||||||
|
_bindingAddress5
|
||||||
|
return 0
|
||||||
|
;;
|
||||||
|
-c)
|
||||||
|
_serverProfiles5
|
||||||
|
return 0
|
||||||
|
;;
|
||||||
|
*)
|
||||||
|
;;
|
||||||
|
esac
|
||||||
|
|
||||||
|
|
||||||
|
COMPREPLY=( $( compgen -W ' -u -c -m - -b -g -l -d -p -n -B -L -C -P -v -help -Djboss.platform.mbeanserver' -- "$cur" ) \
|
||||||
|
$( compgen -W '-Djboss.Domain -Djboss.modcluster.proxyList -Djboss.service.binding.set -Djboss.jvmRoute -Djboss.messaging.ServerPeerID -Djboss.default.jgroups.stack -Dorg.jboss.ejb3.remoting.IsLocalInterceptor.passByRef -Djboss.platform.mbeanserver -Dcom.sun.management.jmxremote.port -Dcom.sun.management.jmxremote.ssl' \
|
||||||
|
-S '=' -- "$cur" ) )
|
||||||
|
return 0
|
||||||
|
|
||||||
|
|
||||||
|
}
|
||||||
|
complete -o nospace -F _jboss5 run.sh
|
||||||
141
vendor/github.com/rparree/jboss-bash-completion/jboss7
generated
vendored
Normal file
141
vendor/github.com/rparree/jboss-bash-completion/jboss7
generated
vendored
Normal file
@@ -0,0 +1,141 @@
|
|||||||
|
# Completions for JBoss Application Server 7 (EAP 6)
|
||||||
|
# VERSION: 0.6
|
||||||
|
# DATE: 2012-10-30
|
||||||
|
# rparree-at-edc4it-dot-com
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
_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
|
||||||
Reference in New Issue
Block a user