Merge pull request #1687 from NoahGorny/enforce-pre-commit-only-newlines

Enforce pre-commit newline fixes
pull/1695/head
Noah Gorny 2020-10-31 12:32:02 +02:00 committed by GitHub
commit af6af2d932
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
61 changed files with 325 additions and 339 deletions

View File

@ -5,6 +5,7 @@ indent_style = space
indent_size = 2 indent_size = 2
end_of_line = lf end_of_line = lf
charset = utf-8 charset = utf-8
trim_trailing_whitespace = true trim_trailing_whitespace = true
insert_final_newline = true insert_final_newline = true
@ -13,3 +14,17 @@ trim_trailing_whitespace = false
[.git*] [.git*]
indent_style = tab indent_style = tab
[*.*sh]
indent_style = tab
indent_size = 4
shell_variant = bash
binary_next_line = true # like -bn
switch_case_indent = true # like -ci
space_redirects = true # like -sr
keep_padding = true # like -kp
end_of_line = lf
charset = utf-8
trim_trailing_whitespace = true
insert_final_newline = true

View File

@ -13,7 +13,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: 1.11.0 rev: 2.1.4
hooks: hooks:
- id: git-check # Configure in .gitattributes - id: git-check # Configure in .gitattributes
- id: shellcheck - id: shellcheck

View File

@ -24,7 +24,7 @@ jobs:
include: include:
- language: go - language: go
go: "1.14" go: "1.14"
name: Ubuntu 18.04 name: pre-commit lint
dist: bionic dist: bionic
sudo: required sudo: required
before_script: before_script:

View File

@ -7,7 +7,7 @@ case $OSTYPE in
[[ $XCLIP ]] && \ [[ $XCLIP ]] && \
alias pbcopy="$XCLIP -selection clipboard" && \ alias pbcopy="$XCLIP -selection clipboard" && \
alias pbpaste="$XCLIP -selection clipboard -o" alias pbpaste="$XCLIP -selection clipboard -o"
;; ;;
esac esac
# to use it just install xclip on your distribution and it would work like: # to use it just install xclip on your distribution and it would work like:

View File

@ -8,4 +8,3 @@ fi
alias please=fuck alias please=fuck
alias plz=please alias plz=please
alias fucking=sudo alias fucking=sudo

View File

@ -6,4 +6,3 @@ alias node-dev='export NODE_ENV=development'
# alias to setup nodejs production environment # alias to setup nodejs production environment
alias node-prod='export NODE_ENV=production' alias node-prod='export NODE_ENV=production'

View File

@ -7,4 +7,3 @@ alias puplint="puppet-lint *.pp"
alias pupagt="puppet agent -t" alias pupagt="puppet agent -t"
alias pupagtd="puppet agent -t --debug" alias pupagtd="puppet agent -t --debug"
alias pupapp="puppet apply" alias pupapp="puppet apply"

View File

@ -8,4 +8,3 @@ alias tfv='terraform validate'
alias tfp='terraform plan' alias tfp='terraform plan'
alias tfa='terraform apply' alias tfa='terraform apply'
alias tfd='terraform destory' alias tfd='terraform destory'

View File

@ -13,4 +13,3 @@ alias tgva='terragrunt validate-all'
alias tgpa='terragrunt plan-all' alias tgpa='terragrunt plan-all'
alias tgaa='terragrunt apply-all' alias tgaa='terragrunt apply-all'
alias tgda='terragrunt destroy-all' alias tgda='terragrunt destroy-all'

View File

@ -7,4 +7,4 @@ then
complete -C "$CONSUL_BIN" consul complete -C "$CONSUL_BIN" consul
fi fi
unset CONSUL_BIN unset CONSUL_BIN

View File

@ -69,4 +69,3 @@ else
fi fi
complete -F _python_django_completion -o default $pythons complete -F _python_django_completion -o default $pythons

View File

@ -670,4 +670,4 @@ _docker_compose() {
eval "$__docker_compose_previous_extglob_setting" eval "$__docker_compose_previous_extglob_setting"
unset __docker_compose_previous_extglob_setting unset __docker_compose_previous_extglob_setting
complete -F _docker_compose docker-compose docker-compose.exe complete -F _docker_compose docker-compose docker-compose.exe

View File

@ -413,4 +413,4 @@ _docker_machine() {
return 0 return 0
} }
complete -F _docker_machine docker-machine docker-machine.exe complete -F _docker_machine docker-machine docker-machine.exe

View File

@ -6,7 +6,7 @@ _installcomp() {
then then
REMOTE_GEMS=( $(gem list --remote --no-versions | tr '\n' ' ') ) REMOTE_GEMS=( $(gem list --remote --no-versions | tr '\n' ' ') )
fi fi
local cur=${COMP_WORDS[COMP_CWORD]} local cur=${COMP_WORDS[COMP_CWORD]}
COMPREPLY=( $(compgen -W "${REMOTE_GEMS[*]}" -- $cur) ) COMPREPLY=( $(compgen -W "${REMOTE_GEMS[*]}" -- $cur) )
} }
@ -16,7 +16,7 @@ _uninstallcomp() {
then then
LOCAL_GEMS=( $(gem list --no-versions | sed 's/\*\*\* LOCAL GEMS \*\*\*//' | tr '\n' ' ') ) LOCAL_GEMS=( $(gem list --no-versions | sed 's/\*\*\* LOCAL GEMS \*\*\*//' | tr '\n' ' ') )
fi fi
local cur=${COMP_WORDS[COMP_CWORD]} local cur=${COMP_WORDS[COMP_CWORD]}
COMPREPLY=( $(compgen -W "${LOCAL_GEMS[*]}" -- $cur) ) COMPREPLY=( $(compgen -W "${LOCAL_GEMS[*]}" -- $cur) )
} }

View File

@ -2,47 +2,47 @@
# #
# git-flow-completion # git-flow-completion
# =================== # ===================
# #
# Bash completion support for [git-flow](http://github.com/nvie/gitflow) # Bash completion support for [git-flow](http://github.com/nvie/gitflow)
# #
# The contained completion routines provide support for completing: # The contained completion routines provide support for completing:
# #
# * git-flow init and version # * git-flow init and version
# * feature, hotfix and release branches # * feature, hotfix and release branches
# * remote feature branch names (for `git-flow feature track`) # * remote feature branch names (for `git-flow feature track`)
# #
# #
# Installation # Installation
# ------------ # ------------
# #
# To achieve git-flow completion nirvana: # To achieve git-flow completion nirvana:
# #
# 0. Install git-completion. # 0. Install git-completion.
# #
# 1. Install this file. Either: # 1. Install this file. Either:
# #
# a. Place it in a `bash-completion.d` folder: # a. Place it in a `bash-completion.d` folder:
# #
# * /etc/bash-completion.d # * /etc/bash-completion.d
# * /usr/local/etc/bash-completion.d # * /usr/local/etc/bash-completion.d
# * ~/bash-completion.d # * ~/bash-completion.d
# #
# b. Or, copy it somewhere (e.g. ~/.git-flow-completion.sh) and put the following line in # b. Or, copy it somewhere (e.g. ~/.git-flow-completion.sh) and put the following line in
# your .bashrc: # your .bashrc:
# #
# source ~/.git-flow-completion.sh # source ~/.git-flow-completion.sh
# #
# 2. If you are using Git < 1.7.1: Edit git-completion.sh and add the following line to the giant # 2. If you are using Git < 1.7.1: Edit git-completion.sh and add the following line to the giant
# $command case in _git: # $command case in _git:
# #
# flow) _git_flow ;; # flow) _git_flow ;;
# #
# #
# The Fine Print # The Fine Print
# -------------- # --------------
# #
# Copyright (c) 2010 [Justin Hileman](http://justinhileman.com) # Copyright (c) 2010 [Justin Hileman](http://justinhileman.com)
# #
# Distributed under the [MIT License](http://creativecommons.org/licenses/MIT/) # Distributed under the [MIT License](http://creativecommons.org/licenses/MIT/)
_git_flow () _git_flow ()
@ -128,7 +128,7 @@ __git_flow_release ()
__gitcomp "$subcommands" __gitcomp "$subcommands"
return return
fi fi
case "$subcommand" in case "$subcommand" in
finish) finish)
__gitcomp "$(__git_flow_list_releases)" __gitcomp "$(__git_flow_list_releases)"
@ -174,4 +174,4 @@ __git_flow_list_hotfixes ()
# temporarily wrap __git_find_on_cmdline() for backwards compatibility # temporarily wrap __git_find_on_cmdline() for backwards compatibility
if [ -z "`type -t __git_find_subcommand`" ]; then if [ -z "`type -t __git_find_subcommand`" ]; then
alias __git_find_subcommand=__git_find_on_cmdline alias __git_find_subcommand=__git_find_on_cmdline
fi fi

View File

@ -57,4 +57,3 @@ _homesick_complete()
} }
complete -o bashdefault -o default -F _homesick_complete homesick complete -o bashdefault -o default -F _homesick_complete homesick

View File

@ -28,4 +28,3 @@ _complete_invoke() {
# * -o default: when function generates no results, use filenames. # * -o default: when function generates no results, use filenames.
# * positional args: program names to complete for. # * positional args: program names to complete for.
complete -F _complete_invoke -o default invoke inv complete -F _complete_invoke -o default invoke inv

View File

@ -14,17 +14,17 @@ _serverProfiles(){
# assume is domain.sh # assume is domain.sh
serverdir="../domain/configuration/" serverdir="../domain/configuration/"
fi fi
for i in ${!COMP_WORDS[*]} for i in ${!COMP_WORDS[*]}
do do
if [[ "${COMP_WORDS[i]}" == "-Djboss.server.base.dir" || "${COMP_WORDS[i]}" == "-Djboss.domain.base.dir" ]]; then if [[ "${COMP_WORDS[i]}" == "-Djboss.server.base.dir" || "${COMP_WORDS[i]}" == "-Djboss.domain.base.dir" ]]; then
serverdir="${COMP_WORDS[i+2]}/configuration" serverdir="${COMP_WORDS[i+2]}/configuration"
fi fi
done done
if [ -d "${serverdir}" ] if [ -d "${serverdir}" ]
then then
IFS=$'\n' tmp="$(ls "${serverdir}" | grep xml)" IFS=$'\n' tmp="$(ls "${serverdir}" | grep xml)"
local fls="${tmp[@]// /\ }" local fls="${tmp[@]// /\ }"
unset IFS unset IFS
@ -42,13 +42,13 @@ _bindingAddress(){
} }
_jboss(){ _jboss(){
local cur prev words cword local cur prev words cword
COMPREPLY=() COMPREPLY=()
_get_comp_words_by_ref -n = cur prev words cword _get_comp_words_by_ref -n = cur prev words cword
case $cur in case $cur in
-Djboss.socket.binding.port-offset=*) -Djboss.socket.binding.port-offset=*)
cur=${cur#*=} cur=${cur#*=}
#static list of common bindings sets #static list of common bindings sets
@ -70,13 +70,13 @@ _jboss(){
COMPREPLY=( $(compgen -W "${booleans}" -- ${cur}) ) COMPREPLY=( $(compgen -W "${booleans}" -- ${cur}) )
return 0 return 0
;; ;;
-Djboss.server.base.dir=*|-Djboss.home.dir=*|-Djboss.domain.base.dir=*) -Djboss.server.base.dir=*|-Djboss.home.dir=*|-Djboss.domain.base.dir=*)
cur=${cur#*=} cur=${cur#*=}
_filedir -d _filedir -d
return 0 return 0
;; ;;
-Djboss.domain.master.address=*|-Djboss.bind.address*=*) -Djboss.domain.master.address=*|-Djboss.bind.address*=*)
cur=${cur#*=} cur=${cur#*=}
_bindingAddress _bindingAddress
@ -85,8 +85,8 @@ _jboss(){
--server-config=*|-c=|--host-config=*) --server-config=*|-c=|--host-config=*)
cur=${cur#*=} cur=${cur#*=}
_serverProfiles _serverProfiles
return 0 return 0
esac esac
@ -110,14 +110,14 @@ _jboss(){
;; ;;
esac esac
# *** from jboss5 ******************** # *** from jboss5 ********************
# *** -modulepath -c -m -g -l -d -p -n -B -L -C -Djboss.platform.mbeanserver -Djboss.server.base.directory # *** -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 # *** -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 # standard commands for standalone and domain mode
local commandsWithoutEqualSign='-b -bmanagement -bunsecure -bpublic --admin-only -h -help -u -version -V -v' 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' 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* ]] if [[ $COMP_WORDS == *standalone.sh* ]]
then then
commandsWithoutEqualSign="${commandsWithoutEqualSign} -c" commandsWithoutEqualSign="${commandsWithoutEqualSign} -c"
@ -127,15 +127,15 @@ _jboss(){
commandsWithoutEqualSign="${commandsWithoutEqualSign} --backup --cached-dc" commandsWithoutEqualSign="${commandsWithoutEqualSign} --backup --cached-dc"
commandsWithEqualSign="${commandsWithEqualSign} -Djboss.domain.master.address --host-config -Djboss.domain.master.port -Djboss.domain.base.dir " commandsWithEqualSign="${commandsWithEqualSign} -Djboss.domain.master.address --host-config -Djboss.domain.master.port -Djboss.domain.base.dir "
fi fi
COMPREPLY=( $( compgen -W "$commandsWithoutEqualSign" -- "$cur" )
$( compgen -W "$commandsWithEqualSign" -S '=' -- "$cur" ) ) COMPREPLY=( $( compgen -W "$commandsWithoutEqualSign" -- "$cur" )
$( compgen -W "$commandsWithEqualSign" -S '=' -- "$cur" ) )
return 0 return 0
} }
complete -o nospace -F _jboss standalone.sh complete -o nospace -F _jboss standalone.sh
complete -o nospace -F _jboss domain.sh complete -o nospace -F _jboss domain.sh

View File

@ -3,4 +3,3 @@
if _command_exists kind; then if _command_exists kind; then
eval "$(kind completion bash)" eval "$(kind completion bash)"
fi fi

View File

@ -10,7 +10,6 @@ if command -v laravel > /dev/null; then
fi fi
done done
} }
complete -F __laravel_completion laravel complete -F __laravel_completion laravel
fi fi

View File

@ -33,4 +33,4 @@ _mvn()
return 0 return 0
} && } &&
complete -F _mvn mvn complete -F _mvn mvn

View File

@ -1,4 +1,3 @@
if _command_exists ng; then if _command_exists ng; then
# No longer supported, please see https://github.com/angular/angular-cli/issues/11043 # No longer supported, please see https://github.com/angular/angular-cli/issues/11043
# Fix courtesy of https://stackoverflow.com/questions/50194674/ng-completion-no-longer-exists # Fix courtesy of https://stackoverflow.com/questions/50194674/ng-completion-no-longer-exists

View File

@ -161,4 +161,3 @@ _packer_completion ()
} }
complete -o nospace -F _packer_completion packer complete -o nospace -F _packer_completion packer

View File

@ -8,4 +8,3 @@
if command -v pip3 >/dev/null; then if command -v pip3 >/dev/null; then
eval "$(pip3 completion --bash)" eval "$(pip3 completion --bash)"
fi fi

View File

@ -44,4 +44,3 @@ _pj() {
complete -F _pj -o nospace pj complete -F _pj -o nospace pj
complete -F _pj -o nospace pjo complete -F _pj -o nospace pjo

View File

@ -13,7 +13,7 @@
_salt_get_grains(){ _salt_get_grains(){
if [ "$1" = 'local' ] ; then if [ "$1" = 'local' ] ; then
salt-call --out=txt -- grains.ls | sed 's/^.*\[//' | tr -d ",']" |sed 's:\([a-z0-9]\) :\1\: :g' salt-call --out=txt -- grains.ls | sed 's/^.*\[//' | tr -d ",']" |sed 's:\([a-z0-9]\) :\1\: :g'
else else
salt '*' --timeout 2 --out=txt -- grains.ls | sed 's/^.*\[//' | tr -d ",']" |sed 's:\([a-z0-9]\) :\1\: :g' salt '*' --timeout 2 --out=txt -- grains.ls | sed 's/^.*\[//' | tr -d ",']" |sed 's:\([a-z0-9]\) :\1\: :g'
@ -22,23 +22,23 @@ _salt_get_grains(){
_salt_get_grain_values(){ _salt_get_grain_values(){
if [ "$1" = 'local' ] ; then if [ "$1" = 'local' ] ; then
salt-call --out=txt -- grains.item $1 |sed 's/^\S*:\s//' |grep -v '^\s*$' salt-call --out=txt -- grains.item $1 |sed 's/^\S*:\s//' |grep -v '^\s*$'
else else
salt '*' --timeout 2 --out=txt -- grains.item $1 |sed 's/^\S*:\s//' |grep -v '^\s*$' salt '*' --timeout 2 --out=txt -- grains.item $1 |sed 's/^\S*:\s//' |grep -v '^\s*$'
fi fi
} }
_salt(){ _salt(){
local cur prev opts _salt_grains _salt_coms pprev ppprev local cur prev opts _salt_grains _salt_coms pprev ppprev
COMPREPLY=() COMPREPLY=()
cur="${COMP_WORDS[COMP_CWORD]}" cur="${COMP_WORDS[COMP_CWORD]}"
prev="${COMP_WORDS[COMP_CWORD-1]}" prev="${COMP_WORDS[COMP_CWORD-1]}"
if [ ${COMP_CWORD} -gt 2 ]; then if [ ${COMP_CWORD} -gt 2 ]; then
pprev="${COMP_WORDS[COMP_CWORD-2]}" pprev="${COMP_WORDS[COMP_CWORD-2]}"
fi fi
if [ ${COMP_CWORD} -gt 3 ]; then if [ ${COMP_CWORD} -gt 3 ]; then
ppprev="${COMP_WORDS[COMP_CWORD-3]}" ppprev="${COMP_WORDS[COMP_CWORD-3]}"
fi fi
opts="-h --help -d --doc --documentation --version --versions-report -c \ opts="-h --help -d --doc --documentation --version --versions-report -c \
@ -58,11 +58,11 @@ _salt(){
case "${pprev}" in case "${pprev}" in
-G|--grain|--grain-pcre) -G|--grain|--grain-pcre)
if [ "${cur}" = ":" ]; then if [ "${cur}" = ":" ]; then
COMPREPLY=($(compgen -W "`_salt_get_grain_values ${prev}`" )) COMPREPLY=($(compgen -W "`_salt_get_grain_values ${prev}`" ))
return 0 return 0
fi fi
;; ;;
esac esac
case "${ppprev}" in case "${ppprev}" in
-G|--grain|--grain-pcre) -G|--grain|--grain-pcre)
if [ "${prev}" = ":" ]; then if [ "${prev}" = ":" ]; then
@ -70,17 +70,17 @@ _salt(){
return 0 return 0
fi fi
;; ;;
esac esac
if [ "${cur}" = "=" ] && [[ "${prev}" == --* ]]; then if [ "${cur}" = "=" ] && [[ "${prev}" == --* ]]; then
cur="" cur=""
fi fi
if [ "${prev}" = "=" ] && [[ "${pprev}" == --* ]]; then if [ "${prev}" = "=" ] && [[ "${pprev}" == --* ]]; then
prev="${pprev}" prev="${pprev}"
fi fi
case "${prev}" in case "${prev}" in
-c|--config) -c|--config)
COMPREPLY=($(compgen -f -- ${cur})) COMPREPLY=($(compgen -f -- ${cur}))
return 0 return 0
@ -89,14 +89,14 @@ _salt(){
COMPREPLY=($(compgen -W "\'*\' ${opts} `salt-key --no-color -l acc`" -- ${cur})) COMPREPLY=($(compgen -W "\'*\' ${opts} `salt-key --no-color -l acc`" -- ${cur}))
return 0 return 0
;; ;;
-E|--pcre) -E|--pcre)
COMPREPLY=($(compgen -W "`salt-key --no-color -l acc`" -- ${cur})) COMPREPLY=($(compgen -W "`salt-key --no-color -l acc`" -- ${cur}))
return 0 return 0
;; ;;
-G|--grain|--grain-pcre) -G|--grain|--grain-pcre)
COMPREPLY=($(compgen -W "$(_salt_get_grains)" -- ${cur})) COMPREPLY=($(compgen -W "$(_salt_get_grains)" -- ${cur}))
return 0 return 0
;; ;;
-C|--compound) -C|--compound)
COMPREPLY=() # TODO: finish this one? how? COMPREPLY=() # TODO: finish this one? how?
return 0 return 0
@ -109,10 +109,10 @@ _salt(){
COMPREPLY=($(compgen -W "1 2 3 4 5 6 7 8 9 10 15 20 30 40 50 60 70 80 90 100 120 150 200")) COMPREPLY=($(compgen -W "1 2 3 4 5 6 7 8 9 10 15 20 30 40 50 60 70 80 90 100 120 150 200"))
return 0 return 0
;; ;;
-N|--nodegroup) -N|--nodegroup)
MASTER_CONFIG='/etc/salt/master' MASTER_CONFIG='/etc/salt/master'
COMPREPLY=($(compgen -W "`awk -F ':' 'BEGIN {print_line = 0}; /^nodegroups/ {print_line = 1;getline } print_line && /^ */ {print $1} /^[^ ]/ {print_line = 0}' <${MASTER_CONFIG}`" -- ${cur})) COMPREPLY=($(compgen -W "`awk -F ':' 'BEGIN {print_line = 0}; /^nodegroups/ {print_line = 1;getline } print_line && /^ */ {print $1} /^[^ ]/ {print_line = 0}' <${MASTER_CONFIG}`" -- ${cur}))
return 0 return 0
;; ;;
esac esac
@ -133,8 +133,8 @@ _saltkey(){
prev="${COMP_WORDS[COMP_CWORD-1]}" prev="${COMP_WORDS[COMP_CWORD-1]}"
opts="-c --config-dir= -h --help --version --versions-report -q --quiet \ opts="-c --config-dir= -h --help --version --versions-report -q --quiet \
-y --yes --gen-keys= --gen-keys-dir= --keysize= --key-logfile= \ -y --yes --gen-keys= --gen-keys-dir= --keysize= --key-logfile= \
-l --list= -L --list-all -a --accept= -A --accept-all \ -l --list= -L --list-all -a --accept= -A --accept-all \
-r --reject= -R --reject-all -p --print= -P --print-all \ -r --reject= -R --reject-all -p --print= -P --print-all \
-d --delete= -D --delete-all -f --finger= -F --finger-all \ -d --delete= -D --delete-all -f --finger= -F --finger-all \
--out=pprint --out=yaml --out=overstatestage --out=json --out=raw \ --out=pprint --out=yaml --out=overstatestage --out=json --out=raw \
--out=highstate --out=key --out=txt --no-color --out-indent= " --out=highstate --out=key --out=txt --no-color --out-indent= "
@ -150,13 +150,13 @@ _saltkey(){
fi fi
if [ "${cur}" = "=" ] && [[ "${prev}" == --* ]]; then if [ "${cur}" = "=" ] && [[ "${prev}" == --* ]]; then
cur="" cur=""
fi fi
if [ "${prev}" = "=" ] && [[ "${pprev}" == --* ]]; then if [ "${prev}" = "=" ] && [[ "${pprev}" == --* ]]; then
prev="${pprev}" prev="${pprev}"
fi fi
case "${prev}" in case "${prev}" in
-a|--accept) -a|--accept)
COMPREPLY=($(compgen -W "$(salt-key -l un --no-color; salt-key -l rej --no-color)" -- ${cur})) COMPREPLY=($(compgen -W "$(salt-key -l un --no-color; salt-key -l rej --no-color)" -- ${cur}))
return 0 return 0
@ -177,7 +177,7 @@ _saltkey(){
COMPREPLY=($(compgen -W "2048 3072 4096 5120 6144" -- ${cur})) COMPREPLY=($(compgen -W "2048 3072 4096 5120 6144" -- ${cur}))
return 0 return 0
;; ;;
--gen-keys) --gen-keys)
return 0 return 0
;; ;;
--gen-keys-dir) --gen-keys-dir)
@ -193,7 +193,7 @@ _saltkey(){
return 0 return 0
;; ;;
--accept-all) --accept-all)
return 0 return 0
;; ;;
esac esac
COMPREPLY=($(compgen -W "${opts} " -- ${cur})) COMPREPLY=($(compgen -W "${opts} " -- ${cur}))
@ -221,30 +221,30 @@ _saltcall(){
COMPREPLY=($(compgen -W "${opts}" -- ${cur})) COMPREPLY=($(compgen -W "${opts}" -- ${cur}))
return 0 return 0
fi fi
if [ "${cur}" = "=" ] && [[ ${prev} == --* ]]; then if [ "${cur}" = "=" ] && [[ ${prev} == --* ]]; then
cur="" cur=""
fi fi
if [ "${prev}" = "=" ] && [[ ${pprev} == --* ]]; then if [ "${prev}" = "=" ] && [[ ${pprev} == --* ]]; then
prev="${pprev}" prev="${pprev}"
fi fi
case ${prev} in case ${prev} in
-m|--module-dirs) -m|--module-dirs)
COMPREPLY=( $(compgen -d ${cur} )) COMPREPLY=( $(compgen -d ${cur} ))
return 0 return 0
;; ;;
-l|--log-level) -l|--log-level)
COMPREPLY=( $(compgen -W "info none garbage trace warning error debug" -- ${cur})) COMPREPLY=( $(compgen -W "info none garbage trace warning error debug" -- ${cur}))
return 0 return 0
;; ;;
-g|grains) -g|grains)
return 0 return 0
;; ;;
salt-call) salt-call)
COMPREPLY=($(compgen -W "${opts}" -- ${cur})) COMPREPLY=($(compgen -W "${opts}" -- ${cur}))
return 0 return 0
;; ;;
esac esac
_salt_coms="$(salt-call --out=txt -- sys.list_functions|sed 's/^.*\[//' | tr -d ",']" )" _salt_coms="$(salt-call --out=txt -- sys.list_functions|sed 's/^.*\[//' | tr -d ",']" )"
@ -262,7 +262,7 @@ _saltcp(){
prev="${COMP_WORDS[COMP_CWORD-1]}" prev="${COMP_WORDS[COMP_CWORD-1]}"
opts="-t --timeout= -s --static -b --batch= --batch-size= \ opts="-t --timeout= -s --static -b --batch= --batch-size= \
-h --help --version --versions-report -c --config-dir= \ -h --help --version --versions-report -c --config-dir= \
-E --pcre -L --list -G --grain --grain-pcre -N --nodegroup \ -E --pcre -L --list -G --grain --grain-pcre -N --nodegroup \
-R --range -C --compound -I --pillar \ -R --range -C --compound -I --pillar \
--out=pprint --out=yaml --out=overstatestage --out=json --out=raw \ --out=pprint --out=yaml --out=overstatestage --out=json --out=raw \
--out=highstate --out=key --out=txt --no-color --out-indent= " --out=highstate --out=key --out=txt --no-color --out-indent= "
@ -270,60 +270,59 @@ _saltcp(){
COMPREPLY=($(compgen -W "${opts}" -- ${cur})) COMPREPLY=($(compgen -W "${opts}" -- ${cur}))
return 0 return 0
fi fi
if [ "${cur}" = "=" ] && [[ "${prev}" == --* ]]; then if [ "${cur}" = "=" ] && [[ "${prev}" == --* ]]; then
cur="" cur=""
fi fi
if [ "${prev}" = "=" ] && [[ "${pprev}" == --* ]]; then if [ "${prev}" = "=" ] && [[ "${pprev}" == --* ]]; then
prev=${pprev} prev=${pprev}
fi fi
case ${prev} in
salt-cp)
COMPREPLY=($(compgen -W "${opts} `salt-key -l acc --no-color`" -- ${cur}))
return 0
;;
-t|--timeout)
# those numbers are just a hint
COMPREPLY=($(compgen -W "2 3 4 8 10 15 20 25 30 40 60 90 120 180 240 300" -- ${cur} ))
return 0
;;
-E|--pcre)
COMPREPLY=($(compgen -W "`salt-key -l acc --no-color`" -- ${cur}))
return 0
;;
-L|--list)
# IMPROVEMENTS ARE WELCOME
prefpart="${cur%,*},"
postpart=${cur##*,}
filt="^\($(echo ${cur}| sed 's:,:\\|:g')\)$"
helper=($(salt-key -l acc --no-color | grep -v "${filt}" | sed "s/^/${prefpart}/"))
COMPREPLY=($(compgen -W "${helper[*]}" -- ${cur}))
return 0 case ${prev} in
;; salt-cp)
-G|--grain|--grain-pcre) COMPREPLY=($(compgen -W "${opts} `salt-key -l acc --no-color`" -- ${cur}))
COMPREPLY=($(compgen -W "$(_salt_get_grains)" -- ${cur})) return 0
return 0 ;;
;; -t|--timeout)
# FIXME # those numbers are just a hint
-R|--range) COMPREPLY=($(compgen -W "2 3 4 8 10 15 20 25 30 40 60 90 120 180 240 300" -- ${cur} ))
# FIXME ?? return 0
return 0 ;;
;; -E|--pcre)
-C|--compound) COMPREPLY=($(compgen -W "`salt-key -l acc --no-color`" -- ${cur}))
# FIXME ?? return 0
return 0 ;;
;; -L|--list)
-c|--config) # IMPROVEMENTS ARE WELCOME
COMPREPLY=($(compgen -f -- ${cur})) prefpart="${cur%,*},"
return 0 postpart=${cur##*,}
;; filt="^\($(echo ${cur}| sed 's:,:\\|:g')\)$"
helper=($(salt-key -l acc --no-color | grep -v "${filt}" | sed "s/^/${prefpart}/"))
COMPREPLY=($(compgen -W "${helper[*]}" -- ${cur}))
return 0
;;
-G|--grain|--grain-pcre)
COMPREPLY=($(compgen -W "$(_salt_get_grains)" -- ${cur}))
return 0
;;
# FIXME
-R|--range)
# FIXME ??
return 0
;;
-C|--compound)
# FIXME ??
return 0
;;
-c|--config)
COMPREPLY=($(compgen -f -- ${cur}))
return 0
;;
esac esac
# default is using opts: # default is using opts:
COMPREPLY=( $(compgen -W "${opts}" -- ${cur}) ) COMPREPLY=( $(compgen -W "${opts}" -- ${cur}) )
} }
complete -F _saltcp salt-cp complete -F _saltcp salt-cp

View File

@ -4,7 +4,7 @@
# | # |
# Thanks to Alexander Korznikov | # Thanks to Alexander Korznikov |
# http://www.korznikov.com/2014/12/bash-tab-completion-for-awesome-tool.html | # http://www.korznikov.com/2014/12/bash-tab-completion-for-awesome-tool.html |
# | # |
# ---------------------------------------------------------------------------+ # ---------------------------------------------------------------------------+
if command -v sqlmap > /dev/null; then if command -v sqlmap > /dev/null; then
@ -18,7 +18,7 @@ if command -v sqlmap > /dev/null; then
prev=$(_get_pword) prev=$(_get_pword)
case $prev in case $prev in
# List directory content # List directory content
--tamper) --tamper)
COMPREPLY=( $( compgen -W "$tamper" -- "$cur" ) ) COMPREPLY=( $( compgen -W "$tamper" -- "$cur" ) )
@ -108,7 +108,7 @@ if command -v sqlmap > /dev/null; then
-z --alert --answers --beep --check-waf --cleanup \ -z --alert --answers --beep --check-waf --cleanup \
--dependencies --disable-coloring --gpage --identify-waf \ --dependencies --disable-coloring --gpage --identify-waf \
--mobile --page-rank --purge-output --smart \ --mobile --page-rank --purge-output --smart \
--sqlmap-shell --wizard' -- "$cur" ) ) --sqlmap-shell --wizard' -- "$cur" ) )
# this removes any options from the list of completions that have # this removes any options from the list of completions that have
# already been specified somewhere on the command line, as long as # already been specified somewhere on the command line, as long as
# these options can only be used once (in a word, "options", in # these options can only be used once (in a word, "options", in
@ -155,7 +155,7 @@ if command -v sqlmap > /dev/null; then
done done
printf '%s ' "${COMPREPLY[@]}") <<<"${COMP_WORDS[@]}" printf '%s ' "${COMPREPLY[@]}") <<<"${COMP_WORDS[@]}"
) ) ) )
# else # else
# _filedir bat # _filedir bat
fi fi

View File

@ -13,8 +13,8 @@ _sshcomplete() {
# parse all defined hosts from .ssh/config and files included there # parse all defined hosts from .ssh/config and files included there
for fl in "$HOME/.ssh/config" \ for fl in "$HOME/.ssh/config" \
$(grep "^\s*Include" "$HOME/.ssh/config" | $(grep "^\s*Include" "$HOME/.ssh/config" |
awk '{for (i=2; i<=NF; i++) print $i}' | awk '{for (i=2; i<=NF; i++) print $i}' |
sed -Ee "s|^([^/~])|$HOME/.ssh/\1|" -e "s|^~/|$HOME/|") sed -Ee "s|^([^/~])|$HOME/.ssh/\1|" -e "s|^~/|$HOME/|")
do do
if [ -r "$fl" ]; then if [ -r "$fl" ]; then

View File

@ -28,4 +28,3 @@ __kitchen_options () {
esac esac
} }
complete -F __kitchen_options kitchen complete -F __kitchen_options kitchen

View File

@ -185,4 +185,3 @@ _tmux() {
complete -F _tmux tmux complete -F _tmux tmux
# END tmux completion # END tmux completion

View File

@ -10,7 +10,7 @@ _contain_cmd()
{ {
local e f local e f
local array1=($1) array2=($2) local array1=($1) array2=($2)
for e in "${array1[@]}" for e in "${array1[@]}"
do do
for f in "${array2[@]}" for f in "${array2[@]}"
@ -80,7 +80,7 @@ _virsh_list_nwfilters()
virsh -q nwfilter-list | cut -d\ -f4 | awk '{print $1}' virsh -q nwfilter-list | cut -d\ -f4 | awk '{print $1}'
} }
_virsh() _virsh()
{ {
local cur prev cmds doms options nets pools cmds_help local cur prev cmds doms options nets pools cmds_help
local flag_all=1 array ret a b ifaces nwfilters files local flag_all=1 array ret a b ifaces nwfilters files

View File

@ -10,30 +10,30 @@ __vboxmanage_startvm() {
AVAILABLE="" AVAILABLE=""
for VM in $TOTAL; do for VM in $TOTAL; do
MATCH=0; MATCH=0;
for RUN in $RUNNING "x"; do for RUN in $RUNNING "x"; do
if [ "$VM" == "$RUN" ]; then if [ "$VM" == "$RUN" ]; then
MATCH=1 MATCH=1
fi fi
done done
(( $MATCH == 0 )) && AVAILABLE="$AVAILABLE $VM " (( $MATCH == 0 )) && AVAILABLE="$AVAILABLE $VM "
done done
echo $AVAILABLE echo $AVAILABLE
} }
__vboxmanage_list() { __vboxmanage_list() {
INPUT=$(vboxmanage list | tr -s '[\[\]\|\n]' ' ' | cut -d' ' -f4-) INPUT=$(vboxmanage list | tr -s '[\[\]\|\n]' ' ' | cut -d' ' -f4-)
PRUNED="" PRUNED=""
if [ "$1" == "long" ]; then if [ "$1" == "long" ]; then
for WORD in $INPUT; do for WORD in $INPUT; do
[ "$WORD" == "-l" ] && continue; [ "$WORD" == "-l" ] && continue;
[ "$WORD" == "--long" ] && continue; [ "$WORD" == "--long" ] && continue;
PRUNED="$PRUNED $WORD" PRUNED="$PRUNED $WORD"
done done
else else
PRUNED=$INPUT PRUNED=$INPUT
fi fi
echo $PRUNED echo $PRUNED
@ -43,14 +43,14 @@ __vboxmanage_list() {
__vboxmanage_list_vms() { __vboxmanage_list_vms() {
VMS="" VMS=""
if [ "x$1" == "x" ]; then if [ "x$1" == "x" ]; then
SEPARATOR=" " SEPARATOR=" "
else else
SEPARATOR=$1 SEPARATOR=$1
fi fi
for VM in $(vboxmanage list vms | cut -d' ' -f1 | tr -d '"'); do for VM in $(vboxmanage list vms | cut -d' ' -f1 | tr -d '"'); do
[ "$VMS" != "" ] && VMS="${VMS}${SEPARATOR}" [ "$VMS" != "" ] && VMS="${VMS}${SEPARATOR}"
VMS="${VMS}${VM}" VMS="${VMS}${VM}"
done done
echo $VMS echo $VMS
@ -59,14 +59,14 @@ __vboxmanage_list_vms() {
__vboxmanage_list_runningvms() { __vboxmanage_list_runningvms() {
VMS="" VMS=""
if [ "$1" == "" ]; then if [ "$1" == "" ]; then
SEPARATOR=" " SEPARATOR=" "
else else
SEPARATOR=$1 SEPARATOR=$1
fi fi
for VM in $(vboxmanage list runningvms | cut -d' ' -f1 | tr -d '"'); do for VM in $(vboxmanage list runningvms | cut -d' ' -f1 | tr -d '"'); do
[ "$VMS" != "" ] && VMS="${VMS}${SEPARATOR}" [ "$VMS" != "" ] && VMS="${VMS}${SEPARATOR}"
VMS="${VMS}${VM}" VMS="${VMS}${VM}"
done done
echo $VMS echo $VMS
@ -81,7 +81,7 @@ __vboxmanage_controlvm() {
echo "screenshotpng setcredentials teleport plugcpu unplugcpu" echo "screenshotpng setcredentials teleport plugcpu unplugcpu"
echo "cpuexecutioncap" echo "cpuexecutioncap"
# setlinkstate<1-N> # setlinkstate<1-N>
# nic<1-N> null|nat|bridged|intnet|hostonly|generic # nic<1-N> null|nat|bridged|intnet|hostonly|generic
# [<devicename>] | # [<devicename>] |
# nictrace<1-N> on|off # nictrace<1-N> on|off
@ -102,43 +102,43 @@ __vboxmanage_default() {
# echo "DEBUG: cur: $cur, prev: $prev" # echo "DEBUG: cur: $cur, prev: $prev"
# echo "DEBUG: default: |$p1|$p2|$p3|$p4|" # echo "DEBUG: default: |$p1|$p2|$p3|$p4|"
case ${cur} in case ${cur} in
-*) -*)
echo $opts echo $opts
# COMPREPLY=($(compgen -W "${opts}" -- ${cur})) # COMPREPLY=($(compgen -W "${opts}" -- ${cur}))
return 0 return 0
;; ;;
esac; esac;
for WORD in $opts; do for WORD in $opts; do
MATCH=0 MATCH=0
for OPT in "${COMP_WORDS[@]}"; do for OPT in "${COMP_WORDS[@]}"; do
# opts=$(echo ${opts} | grep -v $OPT); # opts=$(echo ${opts} | grep -v $OPT);
if [ "$OPT" == "$WORD" ]; then if [ "$OPT" == "$WORD" ]; then
MATCH=1 MATCH=1
break; break;
fi fi
if [ "$OPT" == "-v" ] && [ "$WORD" == "--version" ]; then if [ "$OPT" == "-v" ] && [ "$WORD" == "--version" ]; then
MATCH=1 MATCH=1
break; break;
fi fi
if [ "$OPT" == "--version" ] && [ "$WORD" == "-v" ]; then if [ "$OPT" == "--version" ] && [ "$WORD" == "-v" ]; then
MATCH=1 MATCH=1
break; break;
fi fi
if [ "$OPT" == "-q" ] && [ "$WORD" == "--nologo" ]; then if [ "$OPT" == "-q" ] && [ "$WORD" == "--nologo" ]; then
MATCH=1 MATCH=1
break; break;
fi fi
if [ "$OPT" == "--nologo" ] && [ "$WORD" == "-q" ]; then if [ "$OPT" == "--nologo" ] && [ "$WORD" == "-q" ]; then
MATCH=1 MATCH=1
break; break;
fi fi
done
(( $MATCH == 1 )) && continue;
pruned="$pruned $WORD"
done done
(( $MATCH == 1 )) && continue;
pruned="$pruned $WORD"
done
# COMPREPLY=($(compgen -W "${pruned}" -- ${cur})) # COMPREPLY=($(compgen -W "${pruned}" -- ${cur}))
echo $pruned echo $pruned
return 0 return 0
@ -156,65 +156,65 @@ _vboxmanage() {
# In case current is complete command # In case current is complete command
case $cur in case $cur in
startvm|list|controlvm) startvm|list|controlvm)
COMPREPLY=($(compgen -W "$cur ")) COMPREPLY=($(compgen -W "$cur "))
return 0 return 0
;; ;;
esac esac
case $prev in case $prev in
-v|--version) -v|--version)
return 0 return 0
;; ;;
-l|--long) -l|--long)
opts=$(__vboxmanage_list "long") opts=$(__vboxmanage_list "long")
COMPREPLY=($(compgen -W "${opts}" -- ${cur})) COMPREPLY=($(compgen -W "${opts}" -- ${cur}))
return 0 return 0
;; ;;
startvm|list) startvm|list)
opts=$(__vboxmanage_$prev) opts=$(__vboxmanage_$prev)
COMPREPLY=($(compgen -W "${opts}" -- ${cur})) COMPREPLY=($(compgen -W "${opts}" -- ${cur}))
return 0 return 0
;; ;;
--type) --type)
COMPREPLY=($(compgen -W "gui headless" -- ${cur})) COMPREPLY=($(compgen -W "gui headless" -- ${cur}))
return 0 return 0
;; ;;
gui|headless) gui|headless)
# Done. no more completion possible # Done. no more completion possible
return 0 return 0
;; ;;
vboxmanage|-q|--nologo) vboxmanage|-q|--nologo)
# echo "Got vboxmanage" # echo "Got vboxmanage"
opts=$(__vboxmanage_default) opts=$(__vboxmanage_default)
COMPREPLY=($(compgen -W "${opts}" -- ${cur})) COMPREPLY=($(compgen -W "${opts}" -- ${cur}))
return 0 return 0
;; ;;
controlvm) controlvm)
opts=$(__vboxmanage_list_vms) opts=$(__vboxmanage_list_vms)
COMPREPLY=($(compgen -W "${opts}" -- ${cur})) COMPREPLY=($(compgen -W "${opts}" -- ${cur}))
return 0 return 0
;; ;;
esac esac
for VM in $(__vboxmanage_list_vms); do for VM in $(__vboxmanage_list_vms); do
if [ "$VM" == "$prev" ]; then if [ "$VM" == "$prev" ]; then
pprev=${COMP_WORDS[COMP_CWORD-2]} pprev=${COMP_WORDS[COMP_CWORD-2]}
# echo "previous: $pprev" # echo "previous: $pprev"
case $pprev in case $pprev in
startvm) startvm)
opts="--type" opts="--type"
COMPREPLY=($(compgen -W "${opts}" -- ${cur})) COMPREPLY=($(compgen -W "${opts}" -- ${cur}))
return 0 return 0
;; ;;
controlvm) controlvm)
opts=$(__vboxmanage_controlvm) opts=$(__vboxmanage_controlvm)
COMPREPLY=($(compgen -W "${opts}" -- ${cur})) COMPREPLY=($(compgen -W "${opts}" -- ${cur}))
return 0; return 0;
;; ;;
esac esac
fi fi
done done
# echo "Got to end withoug completion" # echo "Got to end withoug completion"

View File

@ -10,6 +10,6 @@ if command -v vue > /dev/null; then
fi fi
done done
} }
complete -F __vuejs_completion vue complete -F __vuejs_completion vue
fi fi

View File

@ -10,7 +10,6 @@ if command -v wpscan > /dev/null; then
fi fi
done done
} }
complete -F __wpscan_completion wpscan complete -F __wpscan_completion wpscan
fi fi

View File

@ -8,5 +8,5 @@ if command -v brew &>/dev/null && [[ -s $(brew --prefix)/etc/profile.d/autojump.
elif command -v dpkg &>/dev/null && dpkg -s autojump &>/dev/null ; then elif command -v dpkg &>/dev/null && dpkg -s autojump &>/dev/null ; then
. "$(dpkg-query -S autojump.sh | cut -d' ' -f2)" . "$(dpkg-query -S autojump.sh | cut -d' ' -f2)"
elif command -v pacman &>/dev/null && pacman -Q autojump &>/dev/null ; then elif command -v pacman &>/dev/null && pacman -Q autojump &>/dev/null ; then
. "$(pacman -Ql autojump | grep autojump.sh | cut -d' ' -f2)" . "$(pacman -Ql autojump | grep autojump.sh | cut -d' ' -f2)"
fi fi

View File

@ -21,4 +21,3 @@ explain () {
echo "explain 'cmd -o | ...' one quoted command to explain it." echo "explain 'cmd -o | ...' one quoted command to explain it."
fi fi
} }

View File

@ -227,7 +227,7 @@ function gitignore-reload() {
example '$ gitignore-reload' example '$ gitignore-reload'
# The .gitignore file should not be reloaded if there are uncommited changes. # The .gitignore file should not be reloaded if there are uncommited changes.
# Firstly, require a clean work tree. The function require_clean_work_tree() # Firstly, require a clean work tree. The function require_clean_work_tree()
# was stolen with love from https://www.spinics.net/lists/git/msg142043.html # was stolen with love from https://www.spinics.net/lists/git/msg142043.html
# Begin require_clean_work_tree() # Begin require_clean_work_tree()
@ -273,5 +273,3 @@ function gitignore-reload() {
echo >&2 "Files readded. Commit your new changes now." echo >&2 "Files readded. Commit your new changes now."
fi fi
} }

View File

@ -19,4 +19,3 @@ function gw() {
# Call gradle # Call gradle
"${result}" $* "${result}" $*
} }

View File

@ -7,4 +7,4 @@ export LESS_TERMCAP_me=$'\e[0m'
export LESS_TERMCAP_se=$'\e[0m' export LESS_TERMCAP_se=$'\e[0m'
export LESS_TERMCAP_so=$'\e[01;33m' export LESS_TERMCAP_so=$'\e[01;33m'
export LESS_TERMCAP_ue=$'\e[0m' export LESS_TERMCAP_ue=$'\e[0m'
export LESS_TERMCAP_us=$'\e[1;4;31m' export LESS_TERMCAP_us=$'\e[1;4;31m'

View File

@ -11,7 +11,7 @@ do
if [ -f "$possible/pg_hba.conf" ] if [ -f "$possible/pg_hba.conf" ]
then then
# echo "PGDATA: $possible" # echo "PGDATA: $possible"
export PGDATA=$possible export PGDATA=$possible
fi fi
done done
@ -23,7 +23,7 @@ function postgres_start {
about 'Starts PostgreSQL server' about 'Starts PostgreSQL server'
group 'postgres' group 'postgres'
echo 'Starting Postgres....'; echo 'Starting Postgres....';
$POSTGRES_BIN/pg_ctl -D $PGDATA -l $PGDATA/logfile start $POSTGRES_BIN/pg_ctl -D $PGDATA -l $PGDATA/logfile start
} }
@ -31,7 +31,7 @@ function postgres_stop {
about 'Stops PostgreSQL server' about 'Stops PostgreSQL server'
group 'postgres' group 'postgres'
echo 'Stopping Postgres....'; echo 'Stopping Postgres....';
$POSTGRES_BIN/pg_ctl -D $PGDATA -l $PGDATA/logfile stop -s -m fast $POSTGRES_BIN/pg_ctl -D $PGDATA -l $PGDATA/logfile stop -s -m fast
} }
@ -39,7 +39,7 @@ function postgres_status {
about 'Returns status of PostgreSQL server' about 'Returns status of PostgreSQL server'
group 'postgres' group 'postgres'
# $POSTGRES_BIN/pg_ctl -D $PGDATA status # $POSTGRES_BIN/pg_ctl -D $PGDATA status
if [[ $(is_postgres_running) == "no server running" ]] if [[ $(is_postgres_running) == "no server running" ]]
then then
echo "Postgres service [STOPPED]" echo "Postgres service [STOPPED]"
@ -58,7 +58,7 @@ function postgres_restart {
about 'Restarts status of PostgreSQL server' about 'Restarts status of PostgreSQL server'
group 'postgres' group 'postgres'
echo 'Restarting Postgres....'; echo 'Restarting Postgres....';
$POSTGRES_BIN/pg_ctl -D $PGDATA restart $POSTGRES_BIN/pg_ctl -D $PGDATA restart
} }
@ -84,4 +84,3 @@ function postgres_serverlog {
# tail -500 $PGDATA/pg_log/`ls -Art $PGDATA/pg_log | tail -n 1` | less # tail -500 $PGDATA/pg_log/`ls -Art $PGDATA/pg_log | tail -n 1` | less
# } # }
# #

View File

@ -22,5 +22,5 @@ bashPowerlineInit=$(python -c \
'bindings', \ 'bindings', \
'bash', \ 'bash', \
'powerline.sh'))") 'powerline.sh'))")
[ -e $bashPowerlineInit ] || return [ -e $bashPowerlineInit ] || return
. $bashPowerlineInit . $bashPowerlineInit

View File

@ -6,4 +6,3 @@ about-plugin 'Load Software Development Kit Manager'
export SDKMAN_DIR=${SDKMAN_DIR:-$HOME/.sdkman} export SDKMAN_DIR=${SDKMAN_DIR:-$HOME/.sdkman}
[[ -s "${SDKMAN_DIR}/bin/sdkman-init.sh" ]] && source "${SDKMAN_DIR}/bin/sdkman-init.sh" [[ -s "${SDKMAN_DIR}/bin/sdkman-init.sh" ]] && source "${SDKMAN_DIR}/bin/sdkman-init.sh"

View File

@ -73,24 +73,24 @@ ____atomic_top() {
_TOP_RIGHT="" _TOP_RIGHT=""
__TOP_RIGHT_LEN=0 __TOP_RIGHT_LEN=0
__SEG_AT_RIGHT=0 __SEG_AT_RIGHT=0
for seg in ${___ATOMIC_TOP_LEFT}; do for seg in ${___ATOMIC_TOP_LEFT}; do
info="$(___atomic_prompt_"${seg}")" info="$(___atomic_prompt_"${seg}")"
[ -n "${info}" ] && ____atomic_top_left_parse "${info}" [ -n "${info}" ] && ____atomic_top_left_parse "${info}"
done done
___cursor_right="\e[500C" ___cursor_right="\e[500C"
_TOP_LEFT+="${___cursor_right}" _TOP_LEFT+="${___cursor_right}"
for seg in ${___ATOMIC_TOP_RIGHT}; do for seg in ${___ATOMIC_TOP_RIGHT}; do
info="$(___atomic_prompt_"${seg}")" info="$(___atomic_prompt_"${seg}")"
[ -n "${info}" ] && ____atomic_top_right_parse "${info}" [ -n "${info}" ] && ____atomic_top_right_parse "${info}"
done done
[ $__TOP_RIGHT_LEN -gt 0 ] && __TOP_RIGHT_LEN=$(( __TOP_RIGHT_LEN - 0 )) [ $__TOP_RIGHT_LEN -gt 0 ] && __TOP_RIGHT_LEN=$(( __TOP_RIGHT_LEN - 0 ))
___cursor_adjust="\e[${__TOP_RIGHT_LEN}D" ___cursor_adjust="\e[${__TOP_RIGHT_LEN}D"
_TOP_LEFT+="${___cursor_adjust}" _TOP_LEFT+="${___cursor_adjust}"
printf "%s%s" "${_TOP_LEFT}" "${_TOP_RIGHT}" printf "%s%s" "${_TOP_LEFT}" "${_TOP_RIGHT}"
} }
@ -111,7 +111,7 @@ ___atomic_prompt_user_info() {
color=$white color=$white
box="${normal}${LineA}\$([[ \$? != 0 ]] && echo \"${BIWhite}[${IRed}${SX}${BIWhite}]${normal}${Line}\")${Line}${BIWhite}[|${BIWhite}]${normal}${Line}" box="${normal}${LineA}\$([[ \$? != 0 ]] && echo \"${BIWhite}[${IRed}${SX}${BIWhite}]${normal}${Line}\")${Line}${BIWhite}[|${BIWhite}]${normal}${Line}"
info="${IYellow}\u${IRed}@${IGreen}\h" info="${IYellow}\u${IRed}@${IGreen}\h"
printf "%s|%s|%s|%s" "${color}" "${info}" "${white}" "${box}" printf "%s|%s|%s|%s" "${color}" "${info}" "${white}" "${box}"
} }
@ -234,7 +234,7 @@ _atomic_completion() {
return 0 return 0
;; ;;
esac esac
COMPREPLY=( $(compgen -W "${actions}" -- "${cur}") ) COMPREPLY=( $(compgen -W "${actions}" -- "${cur}") )
return 0 return 0
} }
@ -312,7 +312,7 @@ __atomic_ps2() {
_atomic_prompt() { _atomic_prompt() {
exitcode="$?" exitcode="$?"
PS1="$(__atomic_ps1)" PS1="$(__atomic_ps1)"
PS2="$(__atomic_ps2)" PS2="$(__atomic_ps2)"
} }

View File

@ -84,7 +84,7 @@ chmod 400 /etc/sudoers.d/keepenv
### Clean ### Clean
```bash ```bash
~ ~
``` ```
### Git ### Git

View File

@ -4,7 +4,7 @@
Minimal theme overrides from bash_it base theming Minimal theme overrides from bash_it base theming
## `user@host:path[virt-env][scm] $` ## `user@host:path[virt-env][scm] $`
Breakdown of the segments: Breakdown of the segments:
- **user@host:path** - *convienient for LAN based `ssh` and `scp` tasks* - **user@host:path** - *convienient for LAN based `ssh` and `scp` tasks*

View File

@ -54,7 +54,7 @@ function _exit-status-prompt() {
local -r exit_status_color="${bold_red}" local -r exit_status_color="${bold_red}"
fi fi
echo -ne "${exit_status_color}" echo -ne "${exit_status_color}"
if [[ "${prompt_string}" -eq 1 ]]; then if [[ "${prompt_string}" -eq 1 ]]; then
# $PS1: # $PS1:
echo -e " +${normal} " echo -e " +${normal} "

View File

@ -11,7 +11,7 @@ function _git-symbolic-ref {
function _git-branch { function _git-branch {
if [[ "${SCM_GIT_GITSTATUS_RAN}" == "true" ]]; then if [[ "${SCM_GIT_GITSTATUS_RAN}" == "true" ]]; then
test -n "${VCS_STATUS_LOCAL_BRANCH}" && echo "${VCS_STATUS_LOCAL_BRANCH}" || return 1 test -n "${VCS_STATUS_LOCAL_BRANCH}" && echo "${VCS_STATUS_LOCAL_BRANCH}" || return 1
else else
git symbolic-ref -q --short HEAD 2> /dev/null || return 1 git symbolic-ref -q --short HEAD 2> /dev/null || return 1
fi fi
} }
@ -19,7 +19,7 @@ function _git-branch {
function _git-tag { function _git-tag {
if [[ "${SCM_GIT_GITSTATUS_RAN}" == "true" ]]; then if [[ "${SCM_GIT_GITSTATUS_RAN}" == "true" ]]; then
test -n "${VCS_STATUS_TAG}" && echo "${VCS_STATUS_TAG}" test -n "${VCS_STATUS_TAG}" && echo "${VCS_STATUS_TAG}"
else else
git describe --tags --exact-match 2> /dev/null git describe --tags --exact-match 2> /dev/null
fi fi
} }
@ -40,7 +40,7 @@ function _git-short-sha {
function _git-friendly-ref { function _git-friendly-ref {
if [[ "${SCM_GIT_GITSTATUS_RAN}" == "true" ]]; then if [[ "${SCM_GIT_GITSTATUS_RAN}" == "true" ]]; then
_git-branch || _git-tag || _git-short-sha # there is no tag based describe output in gitstatus _git-branch || _git-tag || _git-short-sha # there is no tag based describe output in gitstatus
else else
_git-branch || _git-tag || _git-commit-description || _git-short-sha _git-branch || _git-tag || _git-commit-description || _git-short-sha
fi fi
} }

View File

@ -225,4 +225,3 @@ function __powerline_prompt_command {
LEFT_PROMPT \ LEFT_PROMPT \
SEGMENTS_AT_LEFT SEGMENTS_AT_LEFT
} }

View File

@ -1,6 +1,6 @@
#!/usr/bin/env bash #!/usr/bin/env bash
# #
# This theme was obviously inspired a lot by # This theme was obviously inspired a lot by
# #
# - Demula theme # - Demula theme
# #
@ -17,8 +17,8 @@
# - configurable directory length # - configurable directory length
# - hg, svn, git detection (I work in all of them) # - hg, svn, git detection (I work in all of them)
# - virtualenv, rvm + gemsets # - virtualenv, rvm + gemsets
# #
# Screenshot: http://i.imgur.com/4IAMJ.png # Screenshot: http://i.imgur.com/4IAMJ.png
# #
# by Ryan Kanno <ryankanno@localkinegrinds.com> # by Ryan Kanno <ryankanno@localkinegrinds.com>
# #
@ -26,7 +26,7 @@
# #
# Note: I also am really new to this bash scripting game, so if you see things # Note: I also am really new to this bash scripting game, so if you see things
# that are flat out wrong, or if you think of something neat, just send a pull # that are flat out wrong, or if you think of something neat, just send a pull
# request. This probably only works on a Mac - as some functions are OS # request. This probably only works on a Mac - as some functions are OS
# specific like getting ip, etc. # specific like getting ip, etc.
# #
@ -88,11 +88,11 @@ function get_ip_info {
echo -e "$(ips | sed -e :a -e '$!N;s/\n/${IP_SEPARATOR}/;ta' | sed -e 's/127\.0\.0\.1\${IP_SEPARATOR}//g'), ${myip}" echo -e "$(ips | sed -e :a -e '$!N;s/\n/${IP_SEPARATOR}/;ta' | sed -e 's/127\.0\.0\.1\${IP_SEPARATOR}//g'), ${myip}"
} }
# Displays ip prompt # Displays ip prompt
function ip_prompt_info() { function ip_prompt_info() {
if [[ $IP_ENABLED == 1 ]]; then if [[ $IP_ENABLED == 1 ]]; then
echo -e " ${DEFAULT_COLOR}(${IP_COLOR}$(get_ip_info)${DEFAULT_COLOR})" echo -e " ${DEFAULT_COLOR}(${IP_COLOR}$(get_ip_info)${DEFAULT_COLOR})"
fi fi
} }
# Displays virtual info prompt (virtualenv/rvm) # Displays virtual info prompt (virtualenv/rvm)
@ -165,10 +165,10 @@ function svn_prompt_info() {
echo -e "$prefix${REF_COLOR}$ref${DEFAULT_COLOR}:$revision$state$suffix" echo -e "$prefix${REF_COLOR}$ref${DEFAULT_COLOR}:$revision$state$suffix"
} }
# Displays last X characters of pwd # Displays last X characters of pwd
function limited_pwd() { function limited_pwd() {
# Replace $HOME with ~ if possible # Replace $HOME with ~ if possible
RELATIVE_PWD=${PWD/#$HOME/\~} RELATIVE_PWD=${PWD/#$HOME/\~}
local offset=$((${#RELATIVE_PWD}-$MAX_PWD_LENGTH)) local offset=$((${#RELATIVE_PWD}-$MAX_PWD_LENGTH))

View File

@ -1,2 +1 @@
liquidprompt liquidprompt

View File

@ -31,4 +31,4 @@ function prompt() {
PS1="\n${n_commands} ${user_host} ${prompt_symbol} ${ruby} ${open}${current_path}${git_branch}${close}${return_status}\n${prompt_char}" PS1="\n${n_commands} ${user_host} ${prompt_symbol} ${ruby} ${open}${current_path}${git_branch}${close}${return_status}\n${prompt_char}"
} }
safe_append_prompt_command prompt safe_append_prompt_command prompt

View File

@ -19,7 +19,7 @@ GIT_THEME_PROMPT_PREFIX="${bold_blue}(${bold_white}"
GIT_THEME_PROMPT_SUFFIX="${bold_blue})" GIT_THEME_PROMPT_SUFFIX="${bold_blue})"
## alternate chars ## alternate chars
# #
SCM_THEME_PROMPT_DIRTY="*" SCM_THEME_PROMPT_DIRTY="*"
SCM_THEME_PROMPT_CLEAN="" SCM_THEME_PROMPT_CLEAN=""
SCM_THEME_PROMPT_PREFIX="(" SCM_THEME_PROMPT_PREFIX="("

View File

@ -26,4 +26,3 @@ Here it is in action:
## Usage Scenario ## Usage Scenario
This theme is especially useful when connecting to many different machines and switching between them often. Yes, the hostname *is* present in the prompt. But I argue that it's a lot faster to get a "feel" of what machine you are currently on because of the custom colors on that machine's prompt than by reading the hostname. This theme is especially useful when connecting to many different machines and switching between them often. Yes, the hostname *is* present in the prompt. But I argue that it's a lot faster to get a "feel" of what machine you are currently on because of the custom colors on that machine's prompt than by reading the hostname.

View File

@ -20,15 +20,15 @@ function prompt() {
# We have color support; assume it's compliant with Ecma-48 # We have color support; assume it's compliant with Ecma-48
# (ISO/IEC-6429). (Lack of such support is extremely rare, and such # (ISO/IEC-6429). (Lack of such support is extremely rare, and such
# a case would tend to support setf rather than setaf.) # a case would tend to support setf rather than setaf.)
local color_prompt=yes local color_prompt=yes
else else
local color_prompt= local color_prompt=
fi fi
fi fi
if [ "$color_prompt" = yes ]; then if [ "$color_prompt" = yes ]; then
PS1="\[\033[0;31m\]\342\224\214\342\224\200\$([[ \$? != 0 ]] && echo \"[\[\033[0;31m\]\342\234\227\[\033[0;37m\]]\342\224\200\")[$(if [[ ${EUID} == 0 ]]; then echo '\[\033[01;31m\]root\[\033[01;33m\]@\[\033[01;96m\]\h'; else echo '\[\033[0;39m\]\u\[\033[01;33m\]@\[\033[01;96m\]\h'; fi)\[\033[0;31m\]]\342\224\200[\[\033[0;32m\]\w\[\033[0;31m\]]\n\[\033[0;31m\]\342\224\224\342\224\200\342\224\200\342\225\274 \[\033[0m\]\[\e[01;33m\]$(parse_git_branch) $\[\e[0m\] " PS1="\[\033[0;31m\]\342\224\214\342\224\200\$([[ \$? != 0 ]] && echo \"[\[\033[0;31m\]\342\234\227\[\033[0;37m\]]\342\224\200\")[$(if [[ ${EUID} == 0 ]]; then echo '\[\033[01;31m\]root\[\033[01;33m\]@\[\033[01;96m\]\h'; else echo '\[\033[0;39m\]\u\[\033[01;33m\]@\[\033[01;96m\]\h'; fi)\[\033[0;31m\]]\342\224\200[\[\033[0;32m\]\w\[\033[0;31m\]]\n\[\033[0;31m\]\342\224\224\342\224\200\342\224\200\342\225\274 \[\033[0m\]\[\e[01;33m\]$(parse_git_branch) $\[\e[0m\] "
else else
PS1='┌──[\u@\h]─[\w]\n└──╼ $(parse_git_branch_no_color) $ ' PS1='┌──[\u@\h]─[\w]\n└──╼ $(parse_git_branch_no_color) $ '
fi fi

View File

@ -66,7 +66,7 @@ The contents of both prompt sides can be "reordered", all the "segments" (every
and `conda` supported) and `conda` supported)
* `ruby` - Current ruby version if using `rvm` * `ruby` - Current ruby version if using `rvm`
* `node` - Current node version (only `nvm` is supported) * `node` - Current node version (only `nvm` is supported)
* `scm` - Version control information, `git` * `scm` - Version control information, `git`
* `terraform` - Current terraform workspace * `terraform` - Current terraform workspace
* `user_info` - Current user * `user_info` - Current user
* `wd` - Working directory, like `cwd` but doesn't show the full folder * `wd` - Working directory, like `cwd` but doesn't show the full folder

View File

@ -280,4 +280,3 @@ function __powerline_prompt_command {
LEFT_PROMPT \ LEFT_PROMPT \
SEGMENTS_AT_LEFT SEGMENTS_AT_LEFT
} }

View File

@ -182,4 +182,3 @@ function powerline_prompt_command() {
} }
PROMPT_COMMAND=powerline_prompt_command PROMPT_COMMAND=powerline_prompt_command

View File

@ -17,13 +17,13 @@ VIRTUALENV_THEME_PROMPT_SUFFIX=")"
# 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() { scm_prompt() {
CHAR=$(scm_char) CHAR=$(scm_char)
if [ $CHAR = $SCM_NONE_CHAR ] if [ $CHAR = $SCM_NONE_CHAR ]
then then
return return
else else
echo "[$(scm_char)$(scm_prompt_info)]" echo "[$(scm_char)$(scm_prompt_info)]"
fi fi
} }
pure_prompt() { pure_prompt() {

View File

@ -49,7 +49,7 @@ modern_scm_prompt() {
# show chroot if exist # show chroot if exist
chroot(){ chroot(){
if [ -n "$debian_chroot" ] if [ -n "$debian_chroot" ]
then then
my_ps_chroot="${bold_cyan}$debian_chroot${normal}"; my_ps_chroot="${bold_cyan}$debian_chroot${normal}";
echo "($my_ps_chroot)"; echo "($my_ps_chroot)";
fi fi
@ -63,7 +63,7 @@ my_ve(){
my_ps_ve="${bold_purple}${CONDA_DEFAULT_ENV}${normal}"; my_ps_ve="${bold_purple}${CONDA_DEFAULT_ENV}${normal}";
echo "($my_ps_ve)"; echo "($my_ps_ve)";
elif [ -n "$VIRTUAL_ENV" ] elif [ -n "$VIRTUAL_ENV" ]
then then
my_ps_ve="${bold_purple}$ve${normal}"; my_ps_ve="${bold_purple}$ve${normal}";
echo "($my_ps_ve)"; echo "($my_ps_ve)";
fi fi
@ -75,7 +75,7 @@ prompt() {
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}";
my_ps_user="${bold_green}\u${normal}" my_ps_user="${bold_green}\u${normal}"
my_ps_root="${bold_red}\u${normal}"; my_ps_root="${bold_red}\u${normal}";

View File

@ -13,7 +13,7 @@ function rvm_version_prompt {
[ "$full" != "" ] && echo "$full" [ "$full" != "" ] && echo "$full"
} }
function prompt_command() { function prompt_command() {
# Check http://github.com/Sirupsen/dotfiles for screenshot # Check http://github.com/Sirupsen/dotfiles for screenshot
PS1="$blue\W/$bold_blue$(rvm_version_prompt)$bold_green$(__git_ps1 " (%s)") ${normal}$ " PS1="$blue\W/$bold_blue$(rvm_version_prompt)$bold_green$(__git_ps1 " (%s)") ${normal}$ "

View File

@ -49,7 +49,7 @@ modern_scm_prompt() {
# show chroot if exist # show chroot if exist
chroot(){ chroot(){
if [ -n "$debian_chroot" ] if [ -n "$debian_chroot" ]
then then
my_ps_chroot="${bold_cyan}$debian_chroot${normal}"; my_ps_chroot="${bold_cyan}$debian_chroot${normal}";
echo "($my_ps_chroot)"; echo "($my_ps_chroot)";
fi fi
@ -63,7 +63,7 @@ my_ve(){
my_ps_ve="${bold_purple}${CONDA_DEFAULT_ENV}${normal}"; my_ps_ve="${bold_purple}${CONDA_DEFAULT_ENV}${normal}";
echo "($my_ps_ve)"; echo "($my_ps_ve)";
elif [ -n "$VIRTUAL_ENV" ] elif [ -n "$VIRTUAL_ENV" ]
then then
my_ps_ve="${bold_purple}$ve${normal}"; my_ps_ve="${bold_purple}$ve${normal}";
echo "($my_ps_ve)"; echo "($my_ps_ve)";
fi fi
@ -75,7 +75,7 @@ prompt() {
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}";
my_ps_user="${bold_green}\u${normal}" my_ps_user="${bold_green}\u${normal}"
my_ps_root="${bold_red}\u${normal}"; my_ps_root="${bold_red}\u${normal}";