Compare commits
75 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 | ||
|
|
ebe59c9adc | ||
|
|
a6e2c2fc13 | ||
|
|
6678788f19 | ||
|
|
4f0fa7ebe7 | ||
|
|
905abd37f8 | ||
|
|
a8b43620f8 | ||
|
|
0239ab8c31 | ||
|
|
1dfaf36d91 | ||
|
|
e06066c367 | ||
|
|
035fc920ad | ||
|
|
ab011cd9ba | ||
|
|
d42a1206f9 | ||
|
|
ce854255b4 | ||
|
|
9524bf85ae | ||
|
|
6866648ac6 | ||
|
|
514a753901 | ||
|
|
e481eb41e5 | ||
|
|
a3ae37b385 | ||
|
|
0b808b17f1 | ||
|
|
4860fb8c60 | ||
|
|
cda81f3d74 | ||
|
|
7331cd2676 | ||
|
|
399b5199b0 | ||
|
|
64c4c30706 | ||
|
|
ea444459cf | ||
|
|
682d6d728d | ||
|
|
64d827c3da | ||
|
|
a30a76906c | ||
|
|
e89948a7f0 | ||
|
|
e25e371ba7 | ||
|
|
e4e0c151b2 |
@@ -15,7 +15,7 @@ repos:
|
||||
- id: mixed-line-ending
|
||||
- id: check-added-large-files
|
||||
- repo: https://github.com/jumanjihouse/pre-commit-hooks
|
||||
rev: 2.1.4
|
||||
rev: 2.1.5
|
||||
hooks:
|
||||
- id: git-check # Configure in .gitattributes
|
||||
- id: shellcheck
|
||||
@@ -43,3 +43,8 @@ repos:
|
||||
language: system
|
||||
files: "\\.bash$"
|
||||
types: [file]
|
||||
- id: clean-files-txt
|
||||
name: Check that clean_files.txt is sorted alphabetically.
|
||||
entry: ./hooks/check-clean-files-txt.sh
|
||||
language: system
|
||||
files: clean_files.txt
|
||||
|
||||
2
LICENSE
2
LICENSE
@@ -1,6 +1,6 @@
|
||||
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
|
||||
of this software and associated documentation files (the "Software"), to deal
|
||||
|
||||
@@ -7,3 +7,4 @@ alias dco="docker-compose"
|
||||
alias dcofresh="docker-compose-fresh"
|
||||
alias dcol="docker-compose logs -f --tail 100"
|
||||
alias dcou="docker-compose up"
|
||||
alias dcouns="dcou --no-start"
|
||||
|
||||
@@ -37,8 +37,8 @@ alias gcb='git checkout -b'
|
||||
alias gco='git checkout'
|
||||
alias gcob='git checkout -b'
|
||||
alias gcobu='git checkout -b ${USER}/'
|
||||
alias gcom='git checkout master'
|
||||
alias gcpd='git checkout master; git pull; git branch -D'
|
||||
alias gcom='git checkout $(get_default_branch)'
|
||||
alias gcpd='git checkout $(get_default_branch); git pull; git branch -D'
|
||||
alias gct='git checkout --track'
|
||||
|
||||
# clone
|
||||
@@ -64,13 +64,14 @@ alias gf='git fetch --all --prune'
|
||||
alias gft='git fetch --all --prune --tags'
|
||||
alias gftv='git fetch --all --prune --tags --verbose'
|
||||
alias gfv='git fetch --all --prune --verbose'
|
||||
alias gmu='git fetch origin -v; git fetch upstream -v; git merge upstream/master'
|
||||
alias gmu='git fetch origin -v; git fetch upstream -v; git merge upstream/$(get_default_branch)'
|
||||
alias gup='git fetch && git rebase'
|
||||
|
||||
# log
|
||||
alias gg='git log --graph --pretty=format:'\''%C(bold)%h%Creset%C(magenta)%d%Creset %s %C(yellow)<%an> %C(cyan)(%cr)%Creset'\'' --abbrev-commit --date=relative'
|
||||
alias ggf='git log --graph --date=short --pretty=format:'\''%C(auto)%h %Cgreen%an%Creset %Cblue%cd%Creset %C(auto)%d %s'\'''
|
||||
alias ggs='gg --stat'
|
||||
alias ggup='git log --branches --not --remotes --no-walk --decorate --oneline' # FROM https://stackoverflow.com/questions/39220870/in-git-list-names-of-branches-with-unpushed-commits
|
||||
alias gll='git log --graph --pretty=oneline --abbrev-commit'
|
||||
alias gnew='git log HEAD@{1}..HEAD@{0}' # Show commits since last pull, see http://blogs.atlassian.com/2014/10/advanced-git-aliases/
|
||||
alias gwc='git whatchanged'
|
||||
@@ -104,7 +105,7 @@ alias gp='git push'
|
||||
alias gpd='git push --delete'
|
||||
alias gpf='git push --force'
|
||||
alias gpo='git push origin HEAD'
|
||||
alias gpom='git push origin master'
|
||||
alias gpom='git push origin $(get_default_branch)'
|
||||
alias gpu='git push --set-upstream'
|
||||
alias gpunch='git push --force-with-lease'
|
||||
alias gpuo='git push --set-upstream origin'
|
||||
@@ -112,7 +113,7 @@ alias gpuoc='git push --set-upstream origin $(git symbolic-ref --short HEAD)'
|
||||
|
||||
# pull
|
||||
alias gl='git pull'
|
||||
alias glum='git pull upstream master'
|
||||
alias glum='git pull upstream $(get_default_branch)'
|
||||
alias gpl='git pull'
|
||||
alias gpp='git pull && git push'
|
||||
alias gpr='git pull --rebase'
|
||||
@@ -128,9 +129,9 @@ alias grm='git rm'
|
||||
# rebase
|
||||
alias grb='git rebase'
|
||||
alias grbc='git rebase --continue'
|
||||
alias grm='git rebase master'
|
||||
alias grmi='git rebase master -i'
|
||||
alias gprom='git fetch origin master && git rebase origin/master && git update-ref refs/heads/master origin/master' # Rebase with latest remote master
|
||||
alias grm='git rebase $(get_default_branch)'
|
||||
alias grmi='git rebase $(get_default_branch) -i'
|
||||
alias gprom='git fetch origin $(get_default_branch) && git rebase origin/$(get_default_branch) && git update-ref refs/heads/$(get_default_branch) origin/$(get_default_branch)' # Rebase with latest remote
|
||||
|
||||
# reset
|
||||
alias gus='git reset HEAD'
|
||||
@@ -174,7 +175,7 @@ alias gsu='git submodule update --init --recursive'
|
||||
# these aliases requires git v2.23+
|
||||
alias gsw='git switch'
|
||||
alias gswc='git switch --create'
|
||||
alias gswm='git switch master'
|
||||
alias gswm='git switch $(get_default_branch)'
|
||||
alias gswt='git switch --track'
|
||||
|
||||
# tag
|
||||
@@ -196,3 +197,11 @@ esac
|
||||
function gdv() {
|
||||
git diff --ignore-all-space "$@" | vim -R -
|
||||
}
|
||||
|
||||
function get_default_branch() {
|
||||
if git branch | grep -q main; then
|
||||
echo main
|
||||
else
|
||||
echo master
|
||||
fi
|
||||
}
|
||||
|
||||
@@ -7,4 +7,4 @@ alias tf='terraform'
|
||||
alias tfv='terraform validate'
|
||||
alias tfp='terraform plan'
|
||||
alias tfa='terraform apply'
|
||||
alias tfd='terraform destory'
|
||||
alias tfd='terraform destroy'
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
#######################################################################
|
||||
# Allow-list of files to be lint-checked by CI
|
||||
#
|
||||
# Directory Suport
|
||||
# Directory Support
|
||||
# Directory references are allowed within the file, ie:
|
||||
#
|
||||
# themes/powerline
|
||||
@@ -16,47 +16,22 @@
|
||||
|
||||
# root directories
|
||||
#
|
||||
docs
|
||||
hooks
|
||||
docs/
|
||||
hooks/
|
||||
|
||||
# root files
|
||||
#
|
||||
.gitattributes
|
||||
lint_clean_files.sh
|
||||
install.sh
|
||||
bash_it.sh
|
||||
clean_files.txt
|
||||
install.sh
|
||||
lint_clean_files.sh
|
||||
|
||||
# themes
|
||||
# aliases
|
||||
#
|
||||
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
|
||||
aliases/available/dnf.aliases.bash
|
||||
aliases/available/git.aliases.bash
|
||||
aliases/available/vim.aliases.bash
|
||||
|
||||
# completions
|
||||
#
|
||||
@@ -68,19 +43,23 @@ completion/available/composer.completion.bash
|
||||
completion/available/conda.completion.bash
|
||||
completion/available/consul.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.completion.bash
|
||||
completion/available/gcloud.completion.bash
|
||||
completion/available/gem.completion.bash
|
||||
completion/available/go.completion.bash
|
||||
completion/available/github-cli.completion.bash
|
||||
completion/available/go.completion.bash
|
||||
completion/available/helm.completion.bash
|
||||
completion/available/jboss5.completion.bash
|
||||
completion/available/jboss7.completion.bash
|
||||
completion/available/jungle.completion.bash
|
||||
completion/available/knife.completion.bash
|
||||
completion/available/kontena.completion.bash
|
||||
completion/available/kubectl.completion.bash
|
||||
completion/available/lerna.completion.bash
|
||||
completion/available/minikube.completion.bash
|
||||
completion/available/ngrok.completion.bash
|
||||
completion/available/notify-send.completion.bash
|
||||
completion/available/npm.completion.bash
|
||||
completion/available/packer.completion.bash
|
||||
@@ -89,19 +68,54 @@ completion/available/pip3.completion.bash
|
||||
completion/available/pipenv.completion.bash
|
||||
completion/available/pipx.completion.bash
|
||||
completion/available/rustup.completion.bash
|
||||
completion/available/vault.completion.bash
|
||||
completion/available/sdkman.completion.bash
|
||||
completion/available/vault.completion.bash
|
||||
completion/available/vuejs.completion.bash
|
||||
completion/available/wpscan.completion.bash
|
||||
|
||||
# aliases
|
||||
# plugins
|
||||
#
|
||||
aliases/available/dnf.aliases.bash
|
||||
aliases/available/vim.aliases.bash
|
||||
aliases/available/git.aliases.bash
|
||||
plugins/available/alias-completion.plugin.bash
|
||||
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-search.plugin.bash
|
||||
plugins/available/history-substring-search.plugin.bash
|
||||
plugins/available/history.plugin.bash
|
||||
plugins/available/xterm.plugin.bash
|
||||
|
||||
# tests
|
||||
#
|
||||
test/plugins/alias-completion.plugin.bats
|
||||
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/.gitattributes
|
||||
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)
|
||||
# VERSION: 0.6
|
||||
# DATE: 2012-10-30
|
||||
# rparree-at-edc4it-dot-com
|
||||
|
||||
# MIT License
|
||||
|
||||
# Copyright (c) 2020 Raphael Parree
|
||||
|
||||
# Permission is hereby granted, free of charge, to any person obtaining a copy
|
||||
# of this software and associated documentation files (the "Software"), to deal
|
||||
# in the Software without restriction, including without limitation the rights
|
||||
# to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
||||
# copies of the Software, and to permit persons to whom the Software is
|
||||
# furnished to do so, subject to the following conditions:
|
||||
|
||||
# The above copyright notice and this permission notice shall be included in all
|
||||
# copies or substantial portions of the Software.
|
||||
|
||||
# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
||||
# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
||||
# FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
||||
# AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
||||
# LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
||||
# OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
||||
# SOFTWARE.
|
||||
|
||||
_serverProfiles(){
|
||||
if [[ $COMP_WORDS == *standalone.sh* ]]
|
||||
then
|
||||
serverdir="../standalone/configuration/"
|
||||
else
|
||||
# assume is domain.sh
|
||||
serverdir="../domain/configuration/"
|
||||
fi
|
||||
|
||||
for i in ${!COMP_WORDS[*]}
|
||||
do
|
||||
if [[ "${COMP_WORDS[i]}" == "-Djboss.server.base.dir" || "${COMP_WORDS[i]}" == "-Djboss.domain.base.dir" ]]; then
|
||||
serverdir="${COMP_WORDS[i+2]}/configuration"
|
||||
fi
|
||||
|
||||
done
|
||||
if [ -d "${serverdir}" ]
|
||||
then
|
||||
|
||||
IFS=$'\n' tmp="$(ls "${serverdir}" | grep xml)"
|
||||
local fls="${tmp[@]// /\ }"
|
||||
unset IFS
|
||||
COMPREPLY=( $(compgen -W "${fls} initial boot last v" -- "$cur" ))
|
||||
fi
|
||||
}
|
||||
|
||||
_bindingAddress(){
|
||||
# from /etc/bash_completion.d/ssh
|
||||
COMPREPLY=( "${COMPREPLY[@]}" $( compgen -W \
|
||||
"0.0.0.0 $( PATH="$PATH:/sbin" ifconfig -a | \
|
||||
sed -ne 's/.*addr:\([^[:space:]]*\).*/\1/p' \
|
||||
-ne 's/.*inet[[:space:]]\{1,\}\([^[:space:]]*\).*/\1/p' )" \
|
||||
-- "$cur" ) )
|
||||
}
|
||||
|
||||
_jboss(){
|
||||
|
||||
local cur prev words cword
|
||||
COMPREPLY=()
|
||||
_get_comp_words_by_ref -n = cur prev words cword
|
||||
|
||||
case $cur in
|
||||
|
||||
-Djboss.socket.binding.port-offset=*)
|
||||
cur=${cur#*=}
|
||||
#static list of common bindings sets
|
||||
local bindings="100 200 300 400 10000 20000 30000 40000"
|
||||
COMPREPLY=( $(compgen -W "${bindings}" -- ${cur}) )
|
||||
return 0
|
||||
;;
|
||||
-Djboss.default.jgroups.stack=*)
|
||||
cur=${cur#*=}
|
||||
#static list of standard JGroups stacks
|
||||
local stacks="udp udp-async udp-sync tcp tcp-sync"
|
||||
COMPREPLY=( $(compgen -W "${stacks}" -- ${cur}) )
|
||||
return 0
|
||||
;;
|
||||
|
||||
-Dorg.jboss.ejb3.remoting.IsLocalInterceptor.passByRef=*|-Dcom.sun.management.jmxremote.authenticate=*|-Dcom.sun.management.jmxremote.ssl=*)
|
||||
cur=${cur#*=}
|
||||
local booleans="true false"
|
||||
COMPREPLY=( $(compgen -W "${booleans}" -- ${cur}) )
|
||||
return 0
|
||||
;;
|
||||
|
||||
-Djboss.server.base.dir=*|-Djboss.home.dir=*|-Djboss.domain.base.dir=*)
|
||||
cur=${cur#*=}
|
||||
_filedir -d
|
||||
return 0
|
||||
;;
|
||||
|
||||
-Djboss.domain.master.address=*|-Djboss.bind.address*=*)
|
||||
cur=${cur#*=}
|
||||
_bindingAddress
|
||||
return 0
|
||||
;;
|
||||
--server-config=*|-c=|--host-config=*)
|
||||
cur=${cur#*=}
|
||||
_serverProfiles
|
||||
return 0
|
||||
|
||||
|
||||
esac
|
||||
|
||||
|
||||
case $prev in
|
||||
-u)
|
||||
# a few from RFC 2365 IPv4 Local Scope ()
|
||||
local addresses="239.255.0.1 239.255.0.2 239.255.0.3"
|
||||
COMPREPLY=( $(compgen -W "${addresses}" -- ${cur}) )
|
||||
return 0
|
||||
;;
|
||||
-b*)
|
||||
_bindingAddress
|
||||
return 0
|
||||
;;
|
||||
-c)
|
||||
_serverProfiles
|
||||
return 0
|
||||
;;
|
||||
*)
|
||||
;;
|
||||
esac
|
||||
# *** from jboss5 ********************
|
||||
# *** -modulepath -c -m -g -l -d -p -n -B -L -C -Djboss.platform.mbeanserver -Djboss.server.base.directory
|
||||
# *** -Djboss.Domain -Djboss.modcluster.proxyList -Djboss.jvmRoute -Djboss.default.jgroups.stack -Dorg.jboss.ejb3.remoting.IsLocalInterceptor.passByRef -Djboss.platform.mbeanserver -Dcom.sun.management.jmxremote.port -Dcom.sun.management.jmxremote.ssl
|
||||
# *************************************
|
||||
|
||||
# standard commands for standalone and domain mode
|
||||
local commandsWithoutEqualSign='-b -bmanagement -bunsecure -bpublic --admin-only -h -help -u -version -V -v'
|
||||
local commandsWithEqualSign='-P -Djboss.node.name -Djboss.home.dir -Djboss.socket.binding.port-offset -Djboss.bind.address.management -Djboss.bind.address -Djboss.bind.address.unsecure'
|
||||
|
||||
if [[ $COMP_WORDS == *standalone.sh* ]]
|
||||
then
|
||||
commandsWithoutEqualSign="${commandsWithoutEqualSign} -c"
|
||||
commandsWithEqualSign="${commandsWithEqualSign} --server-config -Djboss.server.base.dir -c"
|
||||
else
|
||||
# assume is domain.sh
|
||||
commandsWithoutEqualSign="${commandsWithoutEqualSign} --backup --cached-dc"
|
||||
commandsWithEqualSign="${commandsWithEqualSign} -Djboss.domain.master.address --host-config -Djboss.domain.master.port -Djboss.domain.base.dir "
|
||||
fi
|
||||
|
||||
|
||||
|
||||
|
||||
COMPREPLY=( $( compgen -W "$commandsWithoutEqualSign" -- "$cur" )
|
||||
$( compgen -W "$commandsWithEqualSign" -S '=' -- "$cur" ) )
|
||||
return 0
|
||||
|
||||
|
||||
}
|
||||
complete -o nospace -F _jboss standalone.sh
|
||||
complete -o nospace -F _jboss domain.sh
|
||||
# shellcheck shell=bash
|
||||
about-completion "jboss7 completion"
|
||||
# shellcheck disable=SC1090
|
||||
source "${BASH_IT}"/vendor/github.com/rparree/jboss-bash-completion/jboss7
|
||||
|
||||
45
completion/available/ngrok.completion.bash
Normal file
45
completion/available/ngrok.completion.bash
Normal file
@@ -0,0 +1,45 @@
|
||||
# shellcheck shell=bash
|
||||
|
||||
__ngrok_completion() {
|
||||
local prev=$(_get_pword)
|
||||
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,15 +1,15 @@
|
||||
#!/usr/bin/bash
|
||||
# shellcheck shell=bash
|
||||
|
||||
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
|
||||
}
|
||||
__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
|
||||
}
|
||||
|
||||
complete -F __wpscan_completion wpscan
|
||||
complete -F __wpscan_completion wpscan
|
||||
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+.
|
||||
(And a shameless ripoff of [oh-my-zsh](https://github.com/robbyrussell/oh-my-zsh) :smiley:)
|
||||
@@ -9,7 +12,7 @@
|
||||
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.
|
||||
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.
|
||||
|
||||
- [Main Page](https://bash-it.readthedocs.io/en/latest)
|
||||
@@ -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``
|
||||
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.
|
||||
For more information, see detailed instructions [here](https://bash-it.readthedocs.io/en/latest/installation/).
|
||||
|
||||
@@ -53,6 +57,8 @@ please feel free to read through this page if you're interested in how Bash-it l
|
||||
|
||||
## Contributors
|
||||
|
||||
* [List of contributors][contribute]
|
||||
[List of contributors](https://github.com/Bash-it/bash-it/contributors)
|
||||
|
||||
[contribute]: https://github.com/Bash-it/bash-it/contributors
|
||||
## License
|
||||
|
||||
Bash-it is licensed under the [MIT License](https://github.com/Bash-it/bash-it/blob/master/LICENSE).
|
||||
|
||||
@@ -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,
|
||||
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.
|
||||
|
||||
@@ -8,7 +8,7 @@ Welcome to Bash-it's documentation!
|
||||
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.
|
||||
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.
|
||||
|
||||
.. toctree::
|
||||
|
||||
14
docs/themes-list/easy.rst
Normal file
14
docs/themes-list/easy.rst
Normal file
@@ -0,0 +1,14 @@
|
||||
.. _easy:
|
||||
|
||||
Easy Theme
|
||||
==========
|
||||
|
||||
A simple theme
|
||||
|
||||
Examples
|
||||
--------
|
||||
|
||||
.. code-block:: bash
|
||||
|
||||
user@hostname ~/.bash_it
|
||||
[ master ✓ ] ❯
|
||||
@@ -187,6 +187,22 @@ Doubletime Multiline Python Only
|
||||
:alt:
|
||||
|
||||
|
||||
----
|
||||
|
||||
Easy
|
||||
^^^^
|
||||
|
||||
|
||||
.. image:: https://bash-it.github.io/bash-it/docs/images/easy-black.jpg
|
||||
:target: https://bash-it.github.io/bash-it/docs/images/easy-black.jpg
|
||||
:alt:
|
||||
|
||||
|
||||
.. image:: https://bash-it.github.io/bash-it/docs/images/easy-white.jpg
|
||||
:target: https://bash-it.github.io/bash-it/docs/images/easy-white.jpg
|
||||
:alt:
|
||||
|
||||
|
||||
----
|
||||
|
||||
Envy
|
||||
|
||||
@@ -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)
|
||||
* ``clock`` - Current time in ``HH:MM:SS`` format
|
||||
* ``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
|
||||
* ``hostname`` - Host name of machine
|
||||
* ``in_toolbox`` - Show identifier if running inside a `toolbox <https://github.com/containers/toolbox>`_
|
||||
* ``in_vim`` - Show identifier if running in ``:terminal`` from vim
|
||||
* ``k8s_context`` - Show current kubernetes context
|
||||
* ``k8s_namespace`` - Show current kubernetes namespace
|
||||
* ``last_status`` - Exit status of last run command
|
||||
* ``python_venv`` - Python virtual environment information (\ ``virtualenv``\ , ``venv``
|
||||
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
|
||||
@@ -171,7 +171,8 @@ while getopts "hsinaf" opt; do
|
||||
;;
|
||||
esac
|
||||
done
|
||||
shift $(("$OPTIND" - 1))
|
||||
|
||||
shift $((OPTIND - 1))
|
||||
|
||||
if [[ $silent ]] && [[ $interactive ]]; then
|
||||
echo -e "\033[91mOptions --silent and --interactive are mutually exclusive. Please choose one or the other.\033[m"
|
||||
|
||||
@@ -203,7 +203,7 @@ _bash-it_pull_and_update_inner() {
|
||||
_bash-it-migrate
|
||||
echo ""
|
||||
echo "All done, enjoy!"
|
||||
bash-it reload
|
||||
bash-it restart
|
||||
else
|
||||
echo "Error updating Bash-it, please, check if your Bash-it installation folder (${BASH_IT}) is clean."
|
||||
fi
|
||||
@@ -224,6 +224,9 @@ _bash-it-update-() {
|
||||
|
||||
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
|
||||
BASH_IT_REMOTE="origin"
|
||||
fi
|
||||
|
||||
@@ -1,3 +1,4 @@
|
||||
# shellcheck shell=bash
|
||||
# Load after the other completions to understand what needs to be completed
|
||||
# BASH_IT_LOAD_PRIORITY: 365
|
||||
|
||||
@@ -17,54 +18,61 @@ about-plugin 'Automatic completion of aliases'
|
||||
|
||||
# Automatically add completion for all aliases to commands having completion functions
|
||||
function alias_completion {
|
||||
local namespace="alias_completion"
|
||||
local namespace="alias_completion"
|
||||
|
||||
# parse function based completion definitions, where capture group 2 => function and 3 => trigger
|
||||
local compl_regex='complete( +[^ ]+)* -F ([^ ]+) ("[^"]+"|[^ ]+)'
|
||||
# parse alias definitions, where capture group 1 => trigger, 2 => command, 3 => command arguments
|
||||
local alias_regex="alias( -- | )([^=]+)='(\"[^\"]+\"|[^ ]+)(( +[^ ]+)*)'"
|
||||
# parse function based completion definitions, where capture group 2 => function and 3 => trigger
|
||||
local compl_regex='complete( +[^ ]+)* -F ([^ ]+) ("[^"]+"|[^ ]+)'
|
||||
# parse alias definitions, where capture group 1 => trigger, 2 => command, 3 => command arguments
|
||||
local alias_regex="alias( -- | )([^=]+)='(\"[^\"]+\"|[^ ]+)(( +[^ ]+)*)'"
|
||||
|
||||
# create array of function completion triggers, keeping multi-word triggers together
|
||||
eval "local completions=($(complete -p | sed -Ene "/$compl_regex/s//'\3'/p"))"
|
||||
(( ${#completions[@]} == 0 )) && return 0
|
||||
# create array of function completion triggers, keeping multi-word triggers together
|
||||
eval "local completions=($(complete -p | sed -Ene "/$compl_regex/s//'\3'/p"))"
|
||||
((${#completions[@]} == 0)) && return 0
|
||||
|
||||
# create temporary file for wrapper functions and completions
|
||||
local tmp_file; tmp_file="$(mktemp -t "${namespace}-${RANDOM}XXXXXX")" || return 1
|
||||
# create temporary file for wrapper functions and completions
|
||||
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
|
||||
local line; 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]# }"
|
||||
# read in "<alias> '<aliased command>' '<command args>'" lines from defined aliases
|
||||
local line
|
||||
|
||||
# skip aliases to pipes, boolean control structures and other command lists
|
||||
# (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
|
||||
# avoid expanding wildcards
|
||||
read -a alias_arg_words <<< "$alias_args"
|
||||
# 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]# }"
|
||||
|
||||
# skip alias if there is no completion function triggered by the aliased command
|
||||
if [[ ! " ${completions[*]} " =~ " $alias_cmd " ]]; then
|
||||
if [[ -n "$completion_loader" ]]; then
|
||||
# force loading of completions for the aliased command
|
||||
eval "$completion_loader $alias_cmd"
|
||||
# 124 means completion loader was successful
|
||||
[[ $? -eq 124 ]] || continue
|
||||
completions+=($alias_cmd)
|
||||
else
|
||||
continue
|
||||
fi
|
||||
fi
|
||||
local new_completion="$(complete -p "$alias_cmd" 2>/dev/null)"
|
||||
# skip aliases to pipes, boolean control structures and other command lists
|
||||
# (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
|
||||
# avoid expanding wildcards
|
||||
read -a alias_arg_words <<< "$alias_args"
|
||||
|
||||
# create a wrapper inserting the alias arguments if any
|
||||
if [[ -n $alias_args ]]; then
|
||||
local 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
|
||||
local compl_wrapper="_${namespace}::${alias_name}"
|
||||
echo "function $compl_wrapper {
|
||||
# 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
|
||||
eval "$completion_loader $alias_cmd"
|
||||
# 124 means completion loader was successful
|
||||
[[ $? -eq 124 ]] || continue
|
||||
completions+=("$alias_cmd")
|
||||
else
|
||||
continue
|
||||
fi
|
||||
fi
|
||||
local new_completion="$(complete -p "$alias_cmd" 2> /dev/null)"
|
||||
|
||||
# create a wrapper inserting the alias arguments if any
|
||||
if [[ -n $alias_args ]]; then
|
||||
local 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
|
||||
local 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
|
||||
@@ -81,15 +89,18 @@ function alias_completion {
|
||||
(( 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
|
||||
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 | sed -Ene "s/$alias_regex/\2 '\3' '\4'/p")
|
||||
source "$tmp_file" && command rm -f "$tmp_file"
|
||||
}; alias_completion
|
||||
# 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 | sed -Ene "s/$alias_regex/\2 '\3' '\4'/p")
|
||||
# shellcheck source=/dev/null
|
||||
source "$tmp_file" && command rm -f "$tmp_file"
|
||||
}
|
||||
|
||||
alias_completion
|
||||
|
||||
@@ -37,7 +37,7 @@ End-Of-Usage
|
||||
|
||||
local -r filename=$(basename -- $1)
|
||||
local -r filedirname=$(dirname -- $1)
|
||||
local targetdirname=$(sed 's/\(\.tar\.bz2$\|\.tbz$\|\.tbz2$\|\.tar\.gz$\|\.tgz$\|\.tar$\|\.tar\.xz$\|\.txz$\|\.tar\.Z$\|\.7z$\)//g' <<< $filename)
|
||||
local targetdirname=$(sed 's/\(\.tar\.bz2$\|\.tbz$\|\.tbz2$\|\.tar\.gz$\|\.tgz$\|\.tar$\|\.tar\.xz$\|\.txz$\|\.tar\.Z$\|\.7z$\|\.nupkg$\|\.zip$\|\.war$\|\.jar$\)//g' <<< $filename)
|
||||
if [ "$filename" = "$targetdirname" ]; then
|
||||
# archive type either not supported or it doesn't need dir creation
|
||||
targetdirname=""
|
||||
@@ -61,9 +61,9 @@ End-Of-Usage
|
||||
*.rpm) rpm2cpio "$1" | cpio -idm${verbose} ;;
|
||||
*.tar) tar "x${verbose}f" "$1" -C "$filedirname/$targetdirname" ;;
|
||||
*.xz) xz --decompress "$1" ;;
|
||||
*.zip|*.war|*.jar) unzip "$1" ;;
|
||||
*.zip|*.war|*.jar|*.nupkg) unzip "$1" -d "$filedirname/$targetdirname" ;;
|
||||
*.Z) uncompress "$1" ;;
|
||||
*.7z) 7za x "$1" ;;
|
||||
*.7z) 7za x -o"$filedirname/$targetdirname" "$1" ;;
|
||||
*) echo "'$1' cannot be extracted via extract" >&2;;
|
||||
esac
|
||||
fi
|
||||
|
||||
@@ -121,6 +121,18 @@ function scm {
|
||||
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 {
|
||||
if [[ -z $SCM ]]; then scm; fi
|
||||
if [[ $SCM == "$SCM_GIT" ]]; then
|
||||
@@ -359,7 +371,9 @@ function hg_prompt_vars {
|
||||
|
||||
if [ -f "$HG_ROOT/branch" ]; then
|
||||
# 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
|
||||
SCM_BRANCH=$(hg summary 2> /dev/null | grep branch: | awk '{print $2}')
|
||||
fi
|
||||
@@ -435,6 +449,10 @@ function k8s_context_prompt {
|
||||
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 {
|
||||
if [[ -n "$VIRTUAL_ENV" ]]; then
|
||||
virtualenv=$(basename "$VIRTUAL_ENV")
|
||||
|
||||
@@ -31,15 +31,6 @@ function set_user_color() {
|
||||
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
|
||||
# non-printable bytes in PS1 need to be contained within \[ \].
|
||||
# Otherwise, bash will count them in the length of the prompt
|
||||
|
||||
@@ -15,16 +15,8 @@ is_vim_shell() {
|
||||
fi
|
||||
}
|
||||
|
||||
scm_prompt() {
|
||||
CHAR=$(scm_char)
|
||||
if [ "$CHAR" = "$SCM_NONE_CHAR" ]; then
|
||||
return
|
||||
else
|
||||
echo " $(scm_char) (${white}$(scm_prompt_info)${normal})"
|
||||
fi
|
||||
}
|
||||
|
||||
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} "
|
||||
}
|
||||
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
#!/usr/bin/env bash
|
||||
# shellcheck shell=bash
|
||||
|
||||
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"}
|
||||
|
||||
@@ -3,16 +3,6 @@ SCM_THEME_PROMPT_DIRTY="${bold_red} ✗${normal}"
|
||||
SCM_THEME_PROMPT_CLEAN="${bold_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() {
|
||||
echo "${green}\$${normal}"
|
||||
}
|
||||
@@ -25,6 +15,7 @@ user_host_path_prompt() {
|
||||
}
|
||||
|
||||
prompt() {
|
||||
SCM_PROMPT_FORMAT=' [%s%s]'
|
||||
PS1="$(user_host_path_prompt)$(virtualenv_prompt)$(scm_prompt) $(mark_prompt) "
|
||||
}
|
||||
|
||||
|
||||
@@ -28,17 +28,6 @@ else
|
||||
THEME_PROMPT_HOST_COLOR="$blue"
|
||||
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() {
|
||||
# Save history
|
||||
history -a
|
||||
@@ -46,27 +35,9 @@ function prompt_setter() {
|
||||
history -r
|
||||
PS1="
|
||||
$(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='> '
|
||||
PS4='+ '
|
||||
}
|
||||
|
||||
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}]"
|
||||
|
||||
}
|
||||
|
||||
19
themes/easy/easy.theme.bash
Normal file
19
themes/easy/easy.theme.bash
Normal file
@@ -0,0 +1,19 @@
|
||||
# shellcheck shell=bash
|
||||
|
||||
SCM_THEME_PROMPT_PREFIX="${bold_green}[ ${normal}"
|
||||
SCM_THEME_PROMPT_SUFFIX="${bold_green} ] "
|
||||
SCM_THEME_PROMPT_DIRTY=" ${red}✗"
|
||||
SCM_THEME_PROMPT_CLEAN=" ${bold_green}✓"
|
||||
|
||||
prompt_command() {
|
||||
if [ "$(whoami)" = root ]; then
|
||||
cursor_color="${bold_red}"
|
||||
user_color="${green}"
|
||||
else
|
||||
cursor_color="${bold_green}"
|
||||
user_color="${white}"
|
||||
fi
|
||||
PS1="${user_color}\u${normal}@${white}\h ${bold_black}\w\n${reset_color}$(scm_prompt_info)${cursor_color}❯ ${normal}"
|
||||
}
|
||||
|
||||
safe_append_prompt_command prompt_command
|
||||
@@ -4,26 +4,18 @@ SCM_THEME_PROMPT_SUFFIX=")${normal}"
|
||||
|
||||
SCM_THEME_PROMPT_DIRTY="*"
|
||||
SCM_THEME_PROMPT_CLEAN=""
|
||||
SCM_GIT_CHAR="g"
|
||||
SCM_SVN_CHAR="s"
|
||||
SCM_HG_CHAR="h"
|
||||
SCM_GIT_CHAR="${green}±${normal}"
|
||||
SCM_SVN_CHAR="${bold_cyan}⑆${normal}"
|
||||
SCM_HG_CHAR="${bold_red}☿${normal}"
|
||||
|
||||
### TODO: openSUSE has already colors enabled, check if those differs from stock
|
||||
# LS colors, made with http://geoff.greer.fm/lscolors/
|
||||
# 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:'
|
||||
|
||||
scm_prompt() {
|
||||
CHAR=$(scm_char)
|
||||
if [ $CHAR = $SCM_NONE_CHAR ]
|
||||
then
|
||||
return
|
||||
else
|
||||
echo "$(scm_prompt_info) "
|
||||
fi
|
||||
}
|
||||
gallifrey_prompt() {
|
||||
SCM_PROMPT_FORMAT='%s%s'
|
||||
|
||||
pure_prompt() {
|
||||
ps_host="${green}\h${normal}";
|
||||
ps_user_mark="${bold}\$${normal}";
|
||||
ps_root_mark="${normal}§"
|
||||
@@ -38,4 +30,4 @@ pure_prompt() {
|
||||
esac
|
||||
}
|
||||
|
||||
safe_append_prompt_command pure_prompt
|
||||
safe_append_prompt_command gallifrey_prompt
|
||||
|
||||
@@ -69,16 +69,6 @@ is_vim_shell() {
|
||||
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
|
||||
chroot(){
|
||||
if [ -n "$debian_chroot" ]
|
||||
@@ -99,7 +89,7 @@ my_ve(){
|
||||
}
|
||||
|
||||
prompt() {
|
||||
|
||||
SCM_PROMPT_FORMAT="[%s$GREEN%s]"
|
||||
my_ps_host="$BOLD$ORANGE\h${normal}";
|
||||
# yes, these are the the same for now ...
|
||||
my_ps_host_root="$ORANGE\h${normal}";
|
||||
@@ -114,10 +104,10 @@ prompt() {
|
||||
|
||||
# nice prompt
|
||||
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}"
|
||||
;;
|
||||
*) 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}"
|
||||
;;
|
||||
esac
|
||||
|
||||
@@ -32,26 +32,17 @@ is_vim_shell() {
|
||||
fi
|
||||
}
|
||||
|
||||
modern_scm_prompt() {
|
||||
CHAR=$(scm_char)
|
||||
if [ $CHAR = $SCM_NONE_CHAR ]
|
||||
then
|
||||
return
|
||||
else
|
||||
echo "[$(scm_char)][$(scm_prompt_info)]"
|
||||
fi
|
||||
}
|
||||
|
||||
prompt() {
|
||||
SCM_PROMPT_FORMAT='[%s][%s]'
|
||||
if [ $? -ne 0 ]
|
||||
then
|
||||
# Yes, the indenting on these is weird, but it has to be like
|
||||
# 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} "
|
||||
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
|
||||
}
|
||||
|
||||
@@ -28,30 +28,21 @@ is_vim_shell() {
|
||||
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() {
|
||||
echo "[$(date '+%l:%M%p')]"
|
||||
}
|
||||
|
||||
prompt() {
|
||||
SCM_PROMPT_FORMAT='[%s][%s]'
|
||||
if [ $? -ne 0 ]
|
||||
then
|
||||
# Yes, the indenting on these is weird, but it has to be like
|
||||
# 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} "
|
||||
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
|
||||
}
|
||||
|
||||
@@ -26,15 +26,6 @@ is_vim_shell() {
|
||||
fi
|
||||
}
|
||||
|
||||
modern_scm_prompt() {
|
||||
CHAR=$(scm_char)
|
||||
if [ "$CHAR" = "$SCM_NONE_CHAR" ]; then
|
||||
return
|
||||
else
|
||||
echo "[$(scm_char)][$(scm_prompt_info)]"
|
||||
fi
|
||||
}
|
||||
|
||||
detect_venv() {
|
||||
python_venv=""
|
||||
# Detect python venv
|
||||
@@ -46,11 +37,12 @@ detect_venv() {
|
||||
}
|
||||
|
||||
prompt() {
|
||||
SCM_PROMPT_FORMAT='[%s][%s]'
|
||||
retval=$?
|
||||
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
|
||||
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
|
||||
detect_venv
|
||||
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_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_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_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_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_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_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_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_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}"
|
||||
}
|
||||
|
||||
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() {
|
||||
set +u
|
||||
local python_venv=""
|
||||
@@ -210,6 +220,11 @@ function __powerline_command_number_prompt() {
|
||||
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() {
|
||||
local params
|
||||
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_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_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_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"}
|
||||
|
||||
safe_append_prompt_command __powerline_prompt_command
|
||||
|
||||
@@ -1,3 +1,5 @@
|
||||
# shellcheck shell=bash
|
||||
|
||||
# scm theming
|
||||
SCM_THEME_PROMPT_PREFIX="|"
|
||||
SCM_THEME_PROMPT_SUFFIX=""
|
||||
@@ -16,31 +18,22 @@ VIRTUALENV_THEME_PROMPT_SUFFIX=")"
|
||||
# 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:'
|
||||
|
||||
scm_prompt() {
|
||||
CHAR=$(scm_char)
|
||||
if [ $CHAR = $SCM_NONE_CHAR ]
|
||||
then
|
||||
return
|
||||
else
|
||||
echo "[$(scm_char)$(scm_prompt_info)]"
|
||||
fi
|
||||
}
|
||||
|
||||
pure_prompt() {
|
||||
ps_host="${bold_blue}\h${normal}";
|
||||
ps_user="${green}\u${normal}";
|
||||
ps_user_mark="${green} $ ${normal}";
|
||||
ps_root="${red}\u${red}";
|
||||
ps_root_mark="${red} # ${normal}"
|
||||
ps_path="${yellow}\w${normal}";
|
||||
|
||||
# make it work
|
||||
case $(id -u) in
|
||||
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"
|
||||
;;
|
||||
esac
|
||||
ps_host="${bold_blue}\h${normal}"
|
||||
ps_user="${green}\u${normal}"
|
||||
ps_user_mark="${green} $ ${normal}"
|
||||
ps_root="${red}\u${red}"
|
||||
ps_root_mark="${red} # ${normal}"
|
||||
ps_path="${yellow}\w${normal}"
|
||||
# make it work
|
||||
case $(id -u) in
|
||||
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"
|
||||
;;
|
||||
esac
|
||||
}
|
||||
|
||||
safe_append_prompt_command pure_prompt
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
#!/usr/bin/env bash
|
||||
# shellcheck shell=bash
|
||||
|
||||
SCM_THEME_PROMPT_DIRTY=" ${bold_red}⊘${normal}"
|
||||
SCM_THEME_PROMPT_CLEAN=" ${bold_green}✓${normal}"
|
||||
@@ -14,9 +14,21 @@ STATUS_THEME_PROMPT_BAD="${bold_red}❯${reset_color}${normal} "
|
||||
STATUS_THEME_PROMPT_OK="${bold_green}❯${reset_color}${normal} "
|
||||
PURITY_THEME_PROMPT_COLOR="${PURITY_THEME_PROMPT_COLOR:=$blue}"
|
||||
|
||||
venv_prompt() {
|
||||
python_venv=""
|
||||
# Detect python venv
|
||||
if [[ -n "${CONDA_DEFAULT_ENV}" ]]; then
|
||||
python_venv="($PYTHON_VENV_CHAR${CONDA_DEFAULT_ENV}) "
|
||||
elif [[ -n "${VIRTUAL_ENV}" ]]; then
|
||||
python_venv="($PYTHON_VENV_CHAR$(basename "${VIRTUAL_ENV}")) "
|
||||
fi
|
||||
[[ -n "${python_venv}" ]] && echo "${python_venv}"
|
||||
}
|
||||
|
||||
function prompt_command() {
|
||||
local ret_status="$( [ $? -eq 0 ] && echo -e "$STATUS_THEME_PROMPT_OK" || echo -e "$STATUS_THEME_PROMPT_BAD")"
|
||||
PS1="\n${PURITY_THEME_PROMPT_COLOR}\w $(scm_prompt_info)\n${ret_status} "
|
||||
retval=$?
|
||||
local ret_status="$([ $retval -eq 0 ] && echo -e "$STATUS_THEME_PROMPT_OK" || echo -e "$STATUS_THEME_PROMPT_BAD")"
|
||||
PS1="\n${PURITY_THEME_PROMPT_COLOR}\w $(scm_prompt_info)\n${ret_status}$(venv_prompt)"
|
||||
}
|
||||
|
||||
safe_append_prompt_command prompt_command
|
||||
|
||||
@@ -36,16 +36,6 @@ is_vim_shell() {
|
||||
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
|
||||
chroot(){
|
||||
if [ -n "$debian_chroot" ]
|
||||
@@ -71,7 +61,7 @@ my_ve(){
|
||||
}
|
||||
|
||||
prompt() {
|
||||
|
||||
SCM_PROMPT_FORMAT='[%s][%s]'
|
||||
my_ps_host="${green}\h${normal}";
|
||||
# yes, these are the the same for now ...
|
||||
my_ps_host_root="${green}\h${normal}";
|
||||
@@ -86,10 +76,10 @@ prompt() {
|
||||
|
||||
# nice prompt
|
||||
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}]
|
||||
▪ "
|
||||
;;
|
||||
|
||||
@@ -57,16 +57,6 @@ todo_txt_count() {
|
||||
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() {
|
||||
if [[ $OSTYPE =~ "darwin" ]]; then
|
||||
echo "${BRACKET_COLOR}➞ ${normal}"
|
||||
@@ -76,6 +66,7 @@ my_prompt_char() {
|
||||
}
|
||||
|
||||
prompt() {
|
||||
SCM_PROMPT_FORMAT="${BRACKET_COLOR}[%s${BRACKET_COLOR}][${STRING_COLOR}%s${BRACKET_COLOR}]"
|
||||
|
||||
my_ps_host="${STRING_COLOR}\h${normal}";
|
||||
my_ps_user="${STRING_COLOR}\u${normal}";
|
||||
@@ -84,10 +75,10 @@ prompt() {
|
||||
|
||||
# nice prompt
|
||||
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}"
|
||||
;;
|
||||
*) 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)"
|
||||
;;
|
||||
esac
|
||||
|
||||
@@ -43,18 +43,8 @@ is_vim_shell() {
|
||||
fi
|
||||
}
|
||||
|
||||
modern_scm_prompt() {
|
||||
CHAR=$(scm_char)
|
||||
if [ $CHAR = $SCM_NONE_CHAR ]
|
||||
then
|
||||
return
|
||||
else
|
||||
echo "[$(scm_char)][$(scm_prompt_info)]"
|
||||
fi
|
||||
}
|
||||
|
||||
prompt() {
|
||||
|
||||
SCM_PROMPT_FORMAT='[%s][%s]'
|
||||
case $HOSTNAME in
|
||||
"clappy"* ) my_ps_host="${green}\h${normal}";
|
||||
;;
|
||||
@@ -70,10 +60,10 @@ prompt() {
|
||||
|
||||
# nice prompt
|
||||
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
|
||||
|
||||
@@ -36,16 +36,6 @@ is_vim_shell() {
|
||||
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
|
||||
chroot(){
|
||||
if [ -n "$debian_chroot" ]
|
||||
@@ -71,7 +61,7 @@ my_ve(){
|
||||
}
|
||||
|
||||
prompt() {
|
||||
|
||||
SCM_PROMPT_FORMAT='[%s][%s]'
|
||||
my_ps_host="${green}\h${normal}";
|
||||
# yes, these are the the same for now ...
|
||||
my_ps_host_root="${green}\h${normal}";
|
||||
@@ -86,10 +76,10 @@ prompt() {
|
||||
|
||||
# nice prompt
|
||||
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
|
||||
|
||||
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