This commit is contained in:
Marc Beninca 2025-07-06 04:21:03 +02:00
parent ec9907d450
commit d367548c08
Signed by: marc.beninca
GPG key ID: 9C7613450C80C24F
2 changed files with 7 additions and 2 deletions

View file

@ -56,20 +56,24 @@ BEGIN {
} }
} else if (match($0, RE_SET, m)) { } else if (match($0, RE_SET, m)) {
if (m[1] == target) { if (m[1] == target) {
print "set"
output(m[1]) output(m[1])
} else { } else {
reset() reset()
} }
} else if (match($0, RE_FUNCTION, m)) { } else if (match($0, RE_FUNCTION, m)) {
if (alias) { if (alias) {
print "alias"
output(target) output(target)
} else if (m[1] == target) { } else if (m[1] == target) {
print "function"
output(target) output(target)
} else { } else {
reset() reset()
} }
} else { } else {
if (module) { if (module) {
print "module"
output(target) output(target)
} else { } else {
reset() reset()

View file

@ -1,9 +1,8 @@
#! /usr/bin/env sh #! /usr/bin/env sh
# main module
# ╭──────╮ # ╭──────╮
# │ main │ # │ main │
# ╰──────╯ # ╰──────╯
# main module
# ╭──────┬───────────╮ # ╭──────┬───────────╮
# │ main │ constants │ # │ main │ constants │
@ -11,8 +10,10 @@
# name of the entrypoint file # name of the entrypoint file
RWX_MAIN_NAME="main.sh" RWX_MAIN_NAME="main.sh"
# name of the project itself
RWX_SELF_NAME="rwx" RWX_SELF_NAME="rwx"
# prefix for command functions
RWX_SELF_COMMAND="_${RWX_SELF_NAME}_cmd_" RWX_SELF_COMMAND="_${RWX_SELF_NAME}_cmd_"
# ╭──────┬───────────╮ # ╭──────┬───────────╮