General housekeeping tasks

This commit is contained in:
Gal Szkolnik 2022-07-25 11:21:39 -04:00
parent d1fe086f7c
commit 9f1181ae02
6 changed files with 114 additions and 46 deletions

View file

@ -2,8 +2,15 @@ if [[ -n "$(which-command direnv)" ]]; then
function _env() {
if [[ -z "$_DIRENV_ShowEnvLogic" ]]; then
echo "_DIRENV_ShowEnvLogic is not defined."
else
eval "$_DIRENV_ShowEnvLogic" | LC_ALL=C sort -h
if [[ $# -gt 0 ]]; then
local _DIRENV_ShowEnvLogic='printenv'
printf "Searching environment for: '${@}'\n\n"
fi
fi
if [[ -n "$_DIRENV_ShowEnvLogic" ]]; then
FILTER=''
[[ $# -gt 0 ]] && FILTER="| grep ${@}"
eval "$_DIRENV_ShowEnvLogic | LC_ALL=C sort -h $FILTER"
fi
}
fi