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
end_of_line = lf
charset = utf-8
trim_trailing_whitespace = true
insert_final_newline = true
@ -13,3 +14,17 @@ trim_trailing_whitespace = false
[.git*]
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: check-added-large-files
- repo: https://github.com/jumanjihouse/pre-commit-hooks
rev: 1.11.0
rev: 2.1.4
hooks:
- id: git-check # Configure in .gitattributes
- id: shellcheck

View File

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

View File

@ -7,7 +7,7 @@ case $OSTYPE in
[[ $XCLIP ]] && \
alias pbcopy="$XCLIP -selection clipboard" && \
alias pbpaste="$XCLIP -selection clipboard -o"
;;
;;
esac
# 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 plz=please
alias fucking=sudo

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

@ -670,4 +670,4 @@ _docker_compose() {
eval "$__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
}
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
REMOTE_GEMS=( $(gem list --remote --no-versions | tr '\n' ' ') )
fi
local cur=${COMP_WORDS[COMP_CWORD]}
COMPREPLY=( $(compgen -W "${REMOTE_GEMS[*]}" -- $cur) )
}
@ -16,7 +16,7 @@ _uninstallcomp() {
then
LOCAL_GEMS=( $(gem list --no-versions | sed 's/\*\*\* LOCAL GEMS \*\*\*//' | tr '\n' ' ') )
fi
local cur=${COMP_WORDS[COMP_CWORD]}
COMPREPLY=( $(compgen -W "${LOCAL_GEMS[*]}" -- $cur) )
}

View File

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

View File

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

View File

@ -14,17 +14,17 @@ _serverProfiles(){
# 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
fi
done
if [ -d "${serverdir}" ]
then
IFS=$'\n' tmp="$(ls "${serverdir}" | grep xml)"
local fls="${tmp[@]// /\ }"
unset IFS
@ -42,13 +42,13 @@ _bindingAddress(){
}
_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
@ -70,13 +70,13 @@ _jboss(){
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
@ -85,8 +85,8 @@ _jboss(){
--server-config=*|-c=|--host-config=*)
cur=${cur#*=}
_serverProfiles
return 0
return 0
esac
@ -110,14 +110,14 @@ _jboss(){
;;
esac
# *** 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
# *************************************
# 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"
@ -127,15 +127,15 @@ _jboss(){
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" ) )
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

View File

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

View File

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

View File

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

View File

@ -1,4 +1,3 @@
if _command_exists ng; then
# 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

View File

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

View File

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

View File

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

View File

@ -13,7 +13,7 @@
_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'
else
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(){
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
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
}
_salt(){
local cur prev opts _salt_grains _salt_coms pprev ppprev
local cur prev opts _salt_grains _salt_coms pprev ppprev
COMPREPLY=()
cur="${COMP_WORDS[COMP_CWORD]}"
prev="${COMP_WORDS[COMP_CWORD-1]}"
if [ ${COMP_CWORD} -gt 2 ]; then
pprev="${COMP_WORDS[COMP_CWORD-2]}"
pprev="${COMP_WORDS[COMP_CWORD-2]}"
fi
if [ ${COMP_CWORD} -gt 3 ]; then
ppprev="${COMP_WORDS[COMP_CWORD-3]}"
ppprev="${COMP_WORDS[COMP_CWORD-3]}"
fi
opts="-h --help -d --doc --documentation --version --versions-report -c \
@ -58,11 +58,11 @@ _salt(){
case "${pprev}" in
-G|--grain|--grain-pcre)
if [ "${cur}" = ":" ]; then
COMPREPLY=($(compgen -W "`_salt_get_grain_values ${prev}`" ))
COMPREPLY=($(compgen -W "`_salt_get_grain_values ${prev}`" ))
return 0
fi
;;
esac
esac
case "${ppprev}" in
-G|--grain|--grain-pcre)
if [ "${prev}" = ":" ]; then
@ -70,17 +70,17 @@ _salt(){
return 0
fi
;;
esac
esac
if [ "${cur}" = "=" ] && [[ "${prev}" == --* ]]; then
cur=""
cur=""
fi
if [ "${prev}" = "=" ] && [[ "${pprev}" == --* ]]; then
prev="${pprev}"
fi
case "${prev}" in
-c|--config)
COMPREPLY=($(compgen -f -- ${cur}))
return 0
@ -89,14 +89,14 @@ _salt(){
COMPREPLY=($(compgen -W "\'*\' ${opts} `salt-key --no-color -l acc`" -- ${cur}))
return 0
;;
-E|--pcre)
-E|--pcre)
COMPREPLY=($(compgen -W "`salt-key --no-color -l acc`" -- ${cur}))
return 0
;;
-G|--grain|--grain-pcre)
COMPREPLY=($(compgen -W "$(_salt_get_grains)" -- ${cur}))
COMPREPLY=($(compgen -W "$(_salt_get_grains)" -- ${cur}))
return 0
;;
;;
-C|--compound)
COMPREPLY=() # TODO: finish this one? how?
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"))
return 0
;;
-N|--nodegroup)
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}))
return 0
-N|--nodegroup)
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}))
return 0
;;
esac
@ -133,8 +133,8 @@ _saltkey(){
prev="${COMP_WORDS[COMP_CWORD-1]}"
opts="-c --config-dir= -h --help --version --versions-report -q --quiet \
-y --yes --gen-keys= --gen-keys-dir= --keysize= --key-logfile= \
-l --list= -L --list-all -a --accept= -A --accept-all \
-r --reject= -R --reject-all -p --print= -P --print-all \
-l --list= -L --list-all -a --accept= -A --accept-all \
-r --reject= -R --reject-all -p --print= -P --print-all \
-d --delete= -D --delete-all -f --finger= -F --finger-all \
--out=pprint --out=yaml --out=overstatestage --out=json --out=raw \
--out=highstate --out=key --out=txt --no-color --out-indent= "
@ -150,13 +150,13 @@ _saltkey(){
fi
if [ "${cur}" = "=" ] && [[ "${prev}" == --* ]]; then
cur=""
cur=""
fi
if [ "${prev}" = "=" ] && [[ "${pprev}" == --* ]]; then
prev="${pprev}"
fi
case "${prev}" in
case "${prev}" in
-a|--accept)
COMPREPLY=($(compgen -W "$(salt-key -l un --no-color; salt-key -l rej --no-color)" -- ${cur}))
return 0
@ -177,7 +177,7 @@ _saltkey(){
COMPREPLY=($(compgen -W "2048 3072 4096 5120 6144" -- ${cur}))
return 0
;;
--gen-keys)
--gen-keys)
return 0
;;
--gen-keys-dir)
@ -193,7 +193,7 @@ _saltkey(){
return 0
;;
--accept-all)
return 0
return 0
;;
esac
COMPREPLY=($(compgen -W "${opts} " -- ${cur}))
@ -221,30 +221,30 @@ _saltcall(){
COMPREPLY=($(compgen -W "${opts}" -- ${cur}))
return 0
fi
if [ "${cur}" = "=" ] && [[ ${prev} == --* ]]; then
cur=""
fi
if [ "${prev}" = "=" ] && [[ ${pprev} == --* ]]; then
prev="${pprev}"
fi
case ${prev} in
-m|--module-dirs)
COMPREPLY=( $(compgen -d ${cur} ))
return 0
;;
-l|--log-level)
COMPREPLY=( $(compgen -W "info none garbage trace warning error debug" -- ${cur}))
return 0
;;
-g|grains)
return 0
;;
salt-call)
COMPREPLY=($(compgen -W "${opts}" -- ${cur}))
return 0
;;
-m|--module-dirs)
COMPREPLY=( $(compgen -d ${cur} ))
return 0
;;
-l|--log-level)
COMPREPLY=( $(compgen -W "info none garbage trace warning error debug" -- ${cur}))
return 0
;;
-g|grains)
return 0
;;
salt-call)
COMPREPLY=($(compgen -W "${opts}" -- ${cur}))
return 0
;;
esac
_salt_coms="$(salt-call --out=txt -- sys.list_functions|sed 's/^.*\[//' | tr -d ",']" )"
@ -262,7 +262,7 @@ _saltcp(){
prev="${COMP_WORDS[COMP_CWORD-1]}"
opts="-t --timeout= -s --static -b --batch= --batch-size= \
-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 \
--out=pprint --out=yaml --out=overstatestage --out=json --out=raw \
--out=highstate --out=key --out=txt --no-color --out-indent= "
@ -270,60 +270,59 @@ _saltcp(){
COMPREPLY=($(compgen -W "${opts}" -- ${cur}))
return 0
fi
if [ "${cur}" = "=" ] && [[ "${prev}" == --* ]]; then
cur=""
cur=""
fi
if [ "${prev}" = "=" ] && [[ "${pprev}" == --* ]]; then
prev=${pprev}
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
;;
-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
;;
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
;;
-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
# default is using opts:
COMPREPLY=( $(compgen -W "${opts}" -- ${cur}) )
}
complete -F _saltcp salt-cp

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

@ -10,7 +10,6 @@ if command -v wpscan > /dev/null; then
fi
done
}
complete -F __wpscan_completion wpscan
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
. "$(dpkg-query -S autojump.sh | cut -d' ' -f2)"
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

View File

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

View File

@ -227,7 +227,7 @@ function gitignore-reload() {
example '$ gitignore-reload'
# 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
# Begin require_clean_work_tree()
@ -273,5 +273,3 @@ function gitignore-reload() {
echo >&2 "Files readded. Commit your new changes now."
fi
}

View File

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

View File

@ -7,4 +7,4 @@ export LESS_TERMCAP_me=$'\e[0m'
export LESS_TERMCAP_se=$'\e[0m'
export LESS_TERMCAP_so=$'\e[01;33m'
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" ]
then
# echo "PGDATA: $possible"
export PGDATA=$possible
export PGDATA=$possible
fi
done
@ -23,7 +23,7 @@ function postgres_start {
about 'Starts PostgreSQL server'
group 'postgres'
echo 'Starting Postgres....';
echo 'Starting Postgres....';
$POSTGRES_BIN/pg_ctl -D $PGDATA -l $PGDATA/logfile start
}
@ -31,7 +31,7 @@ function postgres_stop {
about 'Stops PostgreSQL server'
group 'postgres'
echo 'Stopping Postgres....';
echo 'Stopping Postgres....';
$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'
group 'postgres'
# $POSTGRES_BIN/pg_ctl -D $PGDATA status
# $POSTGRES_BIN/pg_ctl -D $PGDATA status
if [[ $(is_postgres_running) == "no server running" ]]
then
echo "Postgres service [STOPPED]"
@ -58,7 +58,7 @@ function postgres_restart {
about 'Restarts status of PostgreSQL server'
group 'postgres'
echo 'Restarting Postgres....';
echo 'Restarting Postgres....';
$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
# }
#

View File

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

View File

@ -6,4 +6,3 @@ about-plugin 'Load Software Development Kit Manager'
export SDKMAN_DIR=${SDKMAN_DIR:-$HOME/.sdkman}
[[ -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_LEN=0
__SEG_AT_RIGHT=0
for seg in ${___ATOMIC_TOP_LEFT}; do
info="$(___atomic_prompt_"${seg}")"
[ -n "${info}" ] && ____atomic_top_left_parse "${info}"
done
___cursor_right="\e[500C"
_TOP_LEFT+="${___cursor_right}"
for seg in ${___ATOMIC_TOP_RIGHT}; do
info="$(___atomic_prompt_"${seg}")"
[ -n "${info}" ] && ____atomic_top_right_parse "${info}"
done
[ $__TOP_RIGHT_LEN -gt 0 ] && __TOP_RIGHT_LEN=$(( __TOP_RIGHT_LEN - 0 ))
___cursor_adjust="\e[${__TOP_RIGHT_LEN}D"
_TOP_LEFT+="${___cursor_adjust}"
printf "%s%s" "${_TOP_LEFT}" "${_TOP_RIGHT}"
}
@ -111,7 +111,7 @@ ___atomic_prompt_user_info() {
color=$white
box="${normal}${LineA}\$([[ \$? != 0 ]] && echo \"${BIWhite}[${IRed}${SX}${BIWhite}]${normal}${Line}\")${Line}${BIWhite}[|${BIWhite}]${normal}${Line}"
info="${IYellow}\u${IRed}@${IGreen}\h"
printf "%s|%s|%s|%s" "${color}" "${info}" "${white}" "${box}"
}
@ -234,7 +234,7 @@ _atomic_completion() {
return 0
;;
esac
COMPREPLY=( $(compgen -W "${actions}" -- "${cur}") )
return 0
}
@ -312,7 +312,7 @@ __atomic_ps2() {
_atomic_prompt() {
exitcode="$?"
PS1="$(__atomic_ps1)"
PS2="$(__atomic_ps2)"
}

View File

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

View File

@ -4,7 +4,7 @@
Minimal theme overrides from bash_it base theming
## `user@host:path[virt-env][scm] $`
## `user@host:path[virt-env][scm] $`
Breakdown of the segments:
- **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}"
fi
echo -ne "${exit_status_color}"
echo -ne "${exit_status_color}"
if [[ "${prompt_string}" -eq 1 ]]; then
# $PS1:
echo -e " +${normal} "

View File

@ -11,7 +11,7 @@ function _git-symbolic-ref {
function _git-branch {
if [[ "${SCM_GIT_GITSTATUS_RAN}" == "true" ]]; then
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
fi
}
@ -19,7 +19,7 @@ function _git-branch {
function _git-tag {
if [[ "${SCM_GIT_GITSTATUS_RAN}" == "true" ]]; then
test -n "${VCS_STATUS_TAG}" && echo "${VCS_STATUS_TAG}"
else
else
git describe --tags --exact-match 2> /dev/null
fi
}
@ -40,7 +40,7 @@ function _git-short-sha {
function _git-friendly-ref {
if [[ "${SCM_GIT_GITSTATUS_RAN}" == "true" ]]; then
_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
fi
}

View File

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

View File

@ -1,6 +1,6 @@
#!/usr/bin/env bash
#
# This theme was obviously inspired a lot by
# This theme was obviously inspired a lot by
#
# - Demula theme
#
@ -17,8 +17,8 @@
# - configurable directory length
# - hg, svn, git detection (I work in all of them)
# - virtualenv, rvm + gemsets
#
# Screenshot: http://i.imgur.com/4IAMJ.png
#
# Screenshot: http://i.imgur.com/4IAMJ.png
#
# 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
# 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.
#
@ -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}"
}
# Displays ip prompt
# Displays ip prompt
function ip_prompt_info() {
if [[ $IP_ENABLED == 1 ]]; then
echo -e " ${DEFAULT_COLOR}(${IP_COLOR}$(get_ip_info)${DEFAULT_COLOR})"
fi
fi
}
# 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"
}
# Displays last X characters of pwd
# Displays last X characters of pwd
function limited_pwd() {
# Replace $HOME with ~ if possible
# Replace $HOME with ~ if possible
RELATIVE_PWD=${PWD/#$HOME/\~}
local offset=$((${#RELATIVE_PWD}-$MAX_PWD_LENGTH))

View File

@ -1,2 +1 @@
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}"
}
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})"
## alternate chars
#
#
SCM_THEME_PROMPT_DIRTY="*"
SCM_THEME_PROMPT_CLEAN=""
SCM_THEME_PROMPT_PREFIX="("

View File

@ -26,4 +26,3 @@ Here it is in action:
## 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.

View File

@ -20,15 +20,15 @@ function prompt() {
# We have color support; assume it's compliant with Ecma-48
# (ISO/IEC-6429). (Lack of such support is extremely rare, and such
# a case would tend to support setf rather than setaf.)
local color_prompt=yes
local color_prompt=yes
else
local color_prompt=
local color_prompt=
fi
fi
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\] "
else
PS1='┌──[\u@\h]─[\w]\n└──╼ $(parse_git_branch_no_color) $ '
fi

View File

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

View File

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

View File

@ -182,4 +182,3 @@ function 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:'
scm_prompt() {
CHAR=$(scm_char)
if [ $CHAR = $SCM_NONE_CHAR ]
then
CHAR=$(scm_char)
if [ $CHAR = $SCM_NONE_CHAR ]
then
return
else
else
echo "[$(scm_char)$(scm_prompt_info)]"
fi
fi
}
pure_prompt() {

View File

@ -49,7 +49,7 @@ modern_scm_prompt() {
# show chroot if exist
chroot(){
if [ -n "$debian_chroot" ]
then
then
my_ps_chroot="${bold_cyan}$debian_chroot${normal}";
echo "($my_ps_chroot)";
fi
@ -63,7 +63,7 @@ my_ve(){
my_ps_ve="${bold_purple}${CONDA_DEFAULT_ENV}${normal}";
echo "($my_ps_ve)";
elif [ -n "$VIRTUAL_ENV" ]
then
then
my_ps_ve="${bold_purple}$ve${normal}";
echo "($my_ps_ve)";
fi
@ -75,7 +75,7 @@ prompt() {
my_ps_host="${green}\h${normal}";
# yes, these are the the same for now ...
my_ps_host_root="${green}\h${normal}";
my_ps_user="${bold_green}\u${normal}"
my_ps_root="${bold_red}\u${normal}";

View File

@ -13,7 +13,7 @@ function rvm_version_prompt {
[ "$full" != "" ] && echo "$full"
}
function prompt_command() {
# Check http://github.com/Sirupsen/dotfiles for screenshot
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
chroot(){
if [ -n "$debian_chroot" ]
then
then
my_ps_chroot="${bold_cyan}$debian_chroot${normal}";
echo "($my_ps_chroot)";
fi
@ -63,7 +63,7 @@ my_ve(){
my_ps_ve="${bold_purple}${CONDA_DEFAULT_ENV}${normal}";
echo "($my_ps_ve)";
elif [ -n "$VIRTUAL_ENV" ]
then
then
my_ps_ve="${bold_purple}$ve${normal}";
echo "($my_ps_ve)";
fi
@ -75,7 +75,7 @@ prompt() {
my_ps_host="${green}\h${normal}";
# yes, these are the the same for now ...
my_ps_host_root="${green}\h${normal}";
my_ps_user="${bold_green}\u${normal}"
my_ps_root="${bold_red}\u${normal}";