unindent
All checks were successful
/ job (push) Successful in 2m55s

This commit is contained in:
Marc Beninca 2025-08-02 02:57:21 +02:00
parent 6918ff603f
commit 42ebc151c3
Signed by: marc.beninca
GPG key ID: 9C7613450C80C24F

View file

@ -1,5 +1,7 @@
# code
# functions
function alias_eval(alias, name, type) {
text = alias "() { "
if (type == "function") {
@ -62,7 +64,10 @@ function trim(string) {
return text
}
# begin
BEGIN {
RE_ANY = "(.*)"
RE_BEGIN = "^"
RE_CONST = "([_A-Z][_0-9A-Z]*)"
@ -95,13 +100,18 @@ BEGIN {
match_module = 0
match_task = 0
reset()
}
# main
{
if (action == "filter") {
if (match($0, re[target])) {
unique[extract($0, target)] = ""
}
} else if (action == "tasks") {
line++
if (match($0, RE_MODULE)) {
@ -133,6 +143,7 @@ BEGIN {
doc = ""
match_task = 0
}
} else if (action == "eval") {
if (match($0, re[target])) {
append(extract($0, target))
@ -145,6 +156,7 @@ BEGIN {
} else {
reset()
}
} else if (action == "function") {
if (match($0, re["command"])) {
append(extract($0, "command"))
@ -160,6 +172,7 @@ BEGIN {
} else {
reset()
}
} else if (action == "doc") {
# doc
if (match($0, RE_SHEBANG)) {
@ -226,12 +239,17 @@ BEGIN {
}
}
}
}
# end
END {
if (action == "filter") {
for (item in unique) {
print item
}
}
}