From 9fb8af9a09c37d7c55e6ad3cfaf708f5f06b2392 Mon Sep 17 00:00:00 2001 From: David Kebler Date: Sat, 7 Nov 2020 10:01:17 -0800 Subject: [PATCH] fix grep deprecation, change name to get block to list block, refactor verbosity on module functions --- env/colors.env | 2 -- env/grep.env | 3 +++ function/modules | 8 +++++--- modules/editing/block/block.sh | 2 +- 4 files changed, 9 insertions(+), 6 deletions(-) create mode 100644 env/grep.env diff --git a/env/colors.env b/env/colors.env index b224f68..59f763e 100644 --- a/env/colors.env +++ b/env/colors.env @@ -1,10 +1,8 @@ #!/bin/bash export TERM=xterm-color -export GREP_OPTIONS='--color=auto' GREP_COLOR='1;32' export CLICOLOR=1 export LSCOLORS=ExFxCxDxBxegedabagacad - export COLOR_NC='\e[0m' # No Color export COLOR_BLACK='\e[0;30m' export COLOR_GRAY='\e[1;30m' diff --git a/env/grep.env b/env/grep.env new file mode 100644 index 0000000..1c52d27 --- /dev/null +++ b/env/grep.env @@ -0,0 +1,3 @@ +alias grep="grep --color=auto" +alias fgrep="fgrep --color=auto" +alias egrep="egrep --color=auto" diff --git a/function/modules b/function/modules index c2a8229..a747412 100644 --- a/function/modules +++ b/function/modules @@ -87,10 +87,12 @@ module_loaded () { # echo "$(function_list $file)" for func in $(function_list $file) do - [ ! $(function_list | grep $func) ] && echo "$func not loaded" && ret=1 || echo "$func loaded" + [ ! $(function_list | grep $func) ] && ret=1 + [[ $2 = -vv ]] && ([[ $ret = 0 ]] && echo "$func loaded" || echo "$func not loaded") done - [ $ret = 0 ] && echo all functions loaded - return $ret + [[ $2 = -v ]] && echo "module: $1" && ([[ $ret = 0 ]] && echo "all functions " || echo "some or all functions not loaded") + [[ $ret = 0 ]] && echo "loaded" + return $ret } function test_modules { diff --git a/modules/editing/block/block.sh b/modules/editing/block/block.sh index bc3767b..81ec2ba 100755 --- a/modules/editing/block/block.sh +++ b/modules/editing/block/block.sh @@ -76,7 +76,7 @@ else fi } -get_block () { +list_block () { if [[ $1 =~ -?r(aw)? ]]; then echo $BLOCK else