parent
457d82fade
commit
80f244fb08
2 changed files with 7 additions and 19 deletions
|
@ -123,21 +123,9 @@ BEGIN {
|
||||||
doc = ""
|
doc = ""
|
||||||
match_task = 0
|
match_task = 0
|
||||||
}
|
}
|
||||||
} else if (action == "aliases functions") {
|
} else if (action == "eval") {
|
||||||
if (match($0, re["alias"])) {
|
if (match($0, re[target])) {
|
||||||
append(extract($0, "alias"))
|
append(extract($0, target))
|
||||||
} else if (match($0, re["function"])) {
|
|
||||||
split(doc, array, "\n")
|
|
||||||
for (item in array) {
|
|
||||||
alias_eval(array[item], extract($0, "function"), "function")
|
|
||||||
}
|
|
||||||
reset()
|
|
||||||
} else {
|
|
||||||
reset()
|
|
||||||
}
|
|
||||||
} else if (action == "commands functions") {
|
|
||||||
if (match($0, re["command"])) {
|
|
||||||
append(extract($0, "command"))
|
|
||||||
} else if (match($0, re["function"])) {
|
} else if (match($0, re["function"])) {
|
||||||
split(doc, array, "\n")
|
split(doc, array, "\n")
|
||||||
for (item in array) {
|
for (item in array) {
|
||||||
|
|
|
@ -238,15 +238,15 @@ rwx_code_doc() {
|
||||||
|
|
||||||
rwx_code_load() {
|
rwx_code_load() {
|
||||||
local line
|
local line
|
||||||
# parse aliases functions
|
# parse functions aliases
|
||||||
_rwx_code_aliases_functions="$(rwx_code_parse "aliases functions")"
|
_rwx_code_aliases_functions="$(rwx_code_action_target "eval" "alias")"
|
||||||
while IFS= read -r line; do
|
while IFS= read -r line; do
|
||||||
eval "${line}"
|
eval "${line}"
|
||||||
done <<EOF
|
done <<EOF
|
||||||
${_rwx_code_aliases_functions}
|
${_rwx_code_aliases_functions}
|
||||||
EOF
|
EOF
|
||||||
# parse commands functions
|
# parse functions commands
|
||||||
_rwx_code_commands_functions="$(rwx_code_parse "commands functions")"
|
_rwx_code_commands_functions="$(rwx_code_action_target "eval" "command")"
|
||||||
while IFS= read -r line; do
|
while IFS= read -r line; do
|
||||||
eval "${line}"
|
eval "${line}"
|
||||||
done <<EOF
|
done <<EOF
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue