From 486ee8afbfb12877d0f4bfbccd86601763407ecb Mon Sep 17 00:00:00 2001 From: bretello Date: Thu, 31 Mar 2022 19:37:57 +0200 Subject: [PATCH] zsh: cleanup functions --- functions/misc.zsh | 32 ++------------------------------ 1 file changed, 2 insertions(+), 30 deletions(-) diff --git a/functions/misc.zsh b/functions/misc.zsh index 50d3130..433f466 100755 --- a/functions/misc.zsh +++ b/functions/misc.zsh @@ -53,7 +53,7 @@ function ppath ## Color string with given color. Usage: `color $NAME "string"`, available colors in `colors.sh` function color { - color=$1 + local color=$1 shift 1 echo -e "${color}$@${CLEAR}" } @@ -160,7 +160,7 @@ function genpwd ## List defined functions in $DOTFILES/functions.sh function list_functions { - grep --color=no -A 1 '^##' $DOTFILES/functions.zsh | sed -E 's/function (.*)/\1/g' + grep --color=no -A 1 '^##' $DOTFILES/functions/*.zsh| sed -E 's/function (.*)/\1/g' } @@ -191,33 +191,6 @@ if [[ "$(uname)" == "Darwin" ]]; then } fi -pipupdate(){ - set -x - if [[ "$1" == "user" ]]; then - user_flags='--user' - shift - fi - if [[ -n "$@" ]]; then - pip="$1" - shift - flags="$*" - echo "pip command is: '$pip $flags'" - if ! command -v "$pip" ; then - echo "Given command ($1) does not exist." 1>&2 - return - fi - - else - pip='python' - flags='-m pip' - echo "Using default pip: $pip $flags" - fi - - for package in $($pip $flags freeze $user_flags --local | grep -v '^\-e' | cut -d = -f 1) ; do - $pip $flags install "$user_flags" -U "$package" - done - set +x -} # unzip file to directory with the same name of the zip file (without extension) function unzipd { @@ -244,7 +217,6 @@ function retry() { } - __completion_wrapper(){ # Wrapper for completion functions. # These can be used to force loading of all completions