helpers: Add bash-it doctor command
parent
802c45b401
commit
86824a93ed
|
|
@ -43,7 +43,7 @@ alias reload_plugins="$(_make_reload_alias plugin plugins)"
|
||||||
bash-it ()
|
bash-it ()
|
||||||
{
|
{
|
||||||
about 'Bash-it help and maintenance'
|
about 'Bash-it help and maintenance'
|
||||||
param '1: verb [one of: help | show | enable | disable | migrate | update | search | version | reload ] '
|
param '1: verb [one of: help | show | enable | disable | migrate | update | search | version | reload | doctor ] '
|
||||||
param '2: component type [one of: alias(es) | completion(s) | plugin(s) ] or search term(s)'
|
param '2: component type [one of: alias(es) | completion(s) | plugin(s) ] or search term(s)'
|
||||||
param '3: specific component [optional]'
|
param '3: specific component [optional]'
|
||||||
example '$ bash-it show plugins'
|
example '$ bash-it show plugins'
|
||||||
|
|
@ -55,6 +55,7 @@ bash-it ()
|
||||||
example '$ bash-it search [-|@]term1 [-|@]term2 ... [ -e/--enable ] [ -d/--disable ] [ -r/--refresh ] [ -c/--no-color ]'
|
example '$ bash-it search [-|@]term1 [-|@]term2 ... [ -e/--enable ] [ -d/--disable ] [ -r/--refresh ] [ -c/--no-color ]'
|
||||||
example '$ bash-it version'
|
example '$ bash-it version'
|
||||||
example '$ bash-it reload'
|
example '$ bash-it reload'
|
||||||
|
example '$ bash-it doctor errors|warnings|all'
|
||||||
typeset verb=${1:-}
|
typeset verb=${1:-}
|
||||||
shift
|
shift
|
||||||
typeset component=${1:-}
|
typeset component=${1:-}
|
||||||
|
|
@ -70,6 +71,8 @@ bash-it ()
|
||||||
func=_disable-$component;;
|
func=_disable-$component;;
|
||||||
help)
|
help)
|
||||||
func=_help-$component;;
|
func=_help-$component;;
|
||||||
|
doctor)
|
||||||
|
func=_bash-it-doctor-$component;;
|
||||||
search)
|
search)
|
||||||
_bash-it-search $component "$@"
|
_bash-it-search $component "$@"
|
||||||
return;;
|
return;;
|
||||||
|
|
@ -263,6 +266,44 @@ _bash-it-version() {
|
||||||
cd - &> /dev/null || return
|
cd - &> /dev/null || return
|
||||||
}
|
}
|
||||||
|
|
||||||
|
_bash-it-doctor() {
|
||||||
|
_about 'reloads a profile file with a BASH_IT_LOG_LEVEL set'
|
||||||
|
_param '1: BASH_IT_LOG_LEVEL argument: "errors" "warnings" "all"'
|
||||||
|
_group 'lib'
|
||||||
|
|
||||||
|
BASH_IT_LOG_LEVEL=$1
|
||||||
|
_bash-it-reload
|
||||||
|
unset BASH_IT_LOG_LEVEL
|
||||||
|
}
|
||||||
|
|
||||||
|
_bash-it-doctor-all() {
|
||||||
|
_about 'reloads a profile file with error, warning and debug logs'
|
||||||
|
_group 'lib'
|
||||||
|
|
||||||
|
_bash-it-doctor $BASH_IT_LOG_LEVEL_ALL
|
||||||
|
}
|
||||||
|
|
||||||
|
_bash-it-doctor-warnings() {
|
||||||
|
_about 'reloads a profile file with error and warning logs'
|
||||||
|
_group 'lib'
|
||||||
|
|
||||||
|
_bash-it-doctor $BASH_IT_LOG_LEVEL_WARNING
|
||||||
|
}
|
||||||
|
|
||||||
|
_bash-it-doctor-errors() {
|
||||||
|
_about 'reloads a profile file with error logs'
|
||||||
|
_group 'lib'
|
||||||
|
|
||||||
|
_bash-it-doctor $BASH_IT_LOG_LEVEL_ERROR
|
||||||
|
}
|
||||||
|
|
||||||
|
_bash-it-doctor-() {
|
||||||
|
_about 'default bash-it doctor behavior, behaves like bash-it doctor all'
|
||||||
|
_group 'lib'
|
||||||
|
|
||||||
|
_bash-it-doctor-all
|
||||||
|
}
|
||||||
|
|
||||||
_bash-it-reload() {
|
_bash-it-reload() {
|
||||||
_about 'reloads a profile file'
|
_about 'reloads a profile file'
|
||||||
_group 'lib'
|
_group 'lib'
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue