alias/function

This commit is contained in:
Marc Beninca 2025-07-07 04:23:21 +02:00
parent 47ff6043d5
commit 0761ae6020
Signed by: marc.beninca
GPG key ID: 9C7613450C80C24F
2 changed files with 16 additions and 0 deletions

View file

@ -79,6 +79,21 @@ rwx_code_aliases() {
echo "${_rwx_code_aliases}" echo "${_rwx_code_aliases}"
} }
# find aliased function
rwx_code_alias_function() {
local target="${1}"
local line name
while IFS= read -r line; do
name="$(echo "${line}" | awk "{print \$1}")"
if [ "${name}" = "${target}" ]; then
echo "${line}" |
awk "{print \$2}"
fi
done <<EOF
${_rwx_code_aliases_functions}
EOF
}
# show the cached aliases and functions # show the cached aliases and functions
#= rcaf #= rcaf
rwx_code_aliases_functions() { rwx_code_aliases_functions() {

View file

@ -67,6 +67,7 @@ rwx_main() {
rwx_code_load rwx_code_load
# context / command # context / command
if [ -n "${RWX_COMMAND_NAME}" ]; then if [ -n "${RWX_COMMAND_NAME}" ]; then
# TODO
"${RWX_SELF_COMMAND}${RWX_COMMAND_NAME}" "${@}" "${RWX_SELF_COMMAND}${RWX_COMMAND_NAME}" "${@}"
# context / shell # context / shell
else else