filter/aliases

This commit is contained in:
Marc Beninca 2025-07-11 03:03:15 +02:00
parent fa9a2435a4
commit 030be80a01
Signed by: marc.beninca
GPG key ID: 9C7613450C80C24F
2 changed files with 16 additions and 4 deletions

View file

@ -107,6 +107,18 @@ rwx_code_awk() {
echo "${_rwx_code_awk}"
}
# call awk for action with target
rwx_code_action_target() {
local action="${1}"
local target="${2}"
[ -n "${action}" ] || return
rwx_code_cache |
awk \
-v action="${action}" \
-v target="${target}" \
"${_rwx_code_awk}"
}
# show the cached aliases
#= rca
rwx_code_aliases() {
@ -232,7 +244,7 @@ EOF
${_rwx_code_commands_functions}
EOF
# parse aliases
_rwx_code_aliases="$(rwx_code_parse "aliases")"
_rwx_code_aliases="$(rwx_code_action_target "filter" "alias")"
# parse binaries
_rwx_code_binaries="$(rwx_code_parse "binaries")"
# parse commands