miaou-bash helper function
This commit is contained in:
+12
-2
@@ -202,11 +202,21 @@ alias egrep='egrep $COLOR_OPTIONS '
|
||||
alias transfer_cp='rsync -a --info=progress2 --no-inc-recursive'
|
||||
alias ssu='ss -tupn'
|
||||
# OVERRIDDEN ALIASES
|
||||
# shellcheck disable=SC1090,SC1091
|
||||
# shellcheck source=/dev/null
|
||||
[[ -f "/etc/bash.aliases" ]] && source "/etc/bash.aliases"
|
||||
# shellcheck disable=SC1090,SC1091
|
||||
# shellcheck source=/dev/null
|
||||
[[ -f "$HOME/.bash_aliases" ]] && source "$HOME/.bash_aliases"
|
||||
|
||||
# the miaou-bash helper function
|
||||
function miaou-bash {
|
||||
if "$MIAOU_BASH_DIR"/bin/miaou-bash "$@"; then
|
||||
if [[ "${1:-}" =~ --self-upgrade|--uninstall ]]; then
|
||||
echo 'reloading session now!'
|
||||
exec bash -l
|
||||
fi
|
||||
fi
|
||||
}
|
||||
|
||||
# BASH COMPLETIONS
|
||||
if ! shopt -oq posix; then
|
||||
if [ -f /usr/share/bash-completion/bash_completion ]; then
|
||||
|
||||
@@ -2,7 +2,7 @@ function _miaou_bash {
|
||||
local cur="${COMP_WORDS[COMP_CWORD]}"
|
||||
if ((COMP_CWORD == 1)); then
|
||||
if [[ $cur =~ ^- ]]; then
|
||||
compopt -o nospace
|
||||
# compopt -o nospace
|
||||
mapfile -t COMPREPLY < <(compgen -W "--self-upgrade --version --help --uninstall" -- "$cur")
|
||||
else
|
||||
compopt -o filenames
|
||||
|
||||
Reference in New Issue
Block a user