command function

This commit is contained in:
Marc Beninca 2025-07-08 21:18:50 +02:00
parent ffdfe0fc90
commit 278dd75556
Signed by: marc.beninca
GPG key ID: 9C7613450C80C24F
2 changed files with 22 additions and 11 deletions

View file

@ -102,6 +102,21 @@ BEGIN {
} else {
reset()
}
} else if (action == "command function") {
if (match($0, RE_COMMAND, m)) {
append(m[1])
} else if (match($0, RE_FUNCTION, m)) {
split(doc, array, "\n")
for (item in array) {
if (item == target) {
print m[1]
exit
}
}
reset()
} else {
reset()
}
} else if (action == "doc") {
# doc
if (match($0, RE_SHEBANG, m)) {