self/command

This commit is contained in:
Marc Beninca 2024-12-01 21:48:04 +01:00
parent b61ec7044d
commit 52b6c06cb1
Signed by: marc.beninca
GPG key ID: 9C7613450C80C24F
2 changed files with 4 additions and 4 deletions

View file

@ -7,7 +7,7 @@
RWX_MAIN_NAME="main.sh"
RWX_SELF_NAME="rwx"
RWX_PREFIX_COMMAND="_${RWX_SELF_NAME}_cmd_"
RWX_SELF_COMMAND="_${RWX_SELF_NAME}_cmd_"
# ╭───────────╮
# │ variables │
@ -151,7 +151,7 @@ rwx_main() {
local argument="${0}"
local function name
name="$(basename "${argument}")"
function="${RWX_PREFIX_COMMAND}${name}"
function="${RWX_SELF_COMMAND}${name}"
"${function}" "${@}"
;;
esac

View file

@ -3,9 +3,9 @@ rwx_self_commands() {
grep \
--directories "recurse" \
--no-filename \
"^${RWX_PREFIX_COMMAND}" "${RWX_ROOT_SYSTEM}" |
"^${RWX_SELF_COMMAND}" "${RWX_ROOT_SYSTEM}" |
cut --delimiter "(" --fields 1 |
sed "s|^${RWX_PREFIX_COMMAND}||"
sed "s|^${RWX_SELF_COMMAND}||"
}
# get functions from root