mawk/tasks
This commit is contained in:
parent
b0abc4db45
commit
a57e3f4eea
1 changed files with 8 additions and 5 deletions
|
@ -23,6 +23,9 @@ function extract(string, type) {
|
|||
} else if (type == "function") {
|
||||
split(string, array, "()")
|
||||
return trim(array[1])
|
||||
} else if (type == "module") {
|
||||
split(string, array, "#\\.")
|
||||
return trim(array[2])
|
||||
} else if ((type == "constant") || (type == "variable")) {
|
||||
split(string, array, "=")
|
||||
return trim(array[1])
|
||||
|
@ -90,7 +93,7 @@ BEGIN {
|
|||
unique[extract($0, target)] = ""
|
||||
}
|
||||
} else if (action == "tasks") {
|
||||
if (match($0, RE_MODULE, m)) {
|
||||
if (match($0, RE_MODULE)) {
|
||||
if (output_tasks) {
|
||||
print ""
|
||||
print output_module
|
||||
|
@ -99,17 +102,17 @@ BEGIN {
|
|||
}
|
||||
doc = ""
|
||||
match_task = 0
|
||||
output_module = ". " m[1]
|
||||
} else if (match($0, RE_TASK, m)) {
|
||||
output_module = ". " extract($0, "module")
|
||||
} else if (match($0, RE_TASK)) {
|
||||
if (target) {
|
||||
if (target == m[1]) {
|
||||
if (target == extract($0, "task")) {
|
||||
match_task = 1
|
||||
}
|
||||
} else {
|
||||
match_task = 1
|
||||
}
|
||||
append($0)
|
||||
} else if (match($0, RE_COMMENT, m)) {
|
||||
} else if (match($0, RE_COMMENT)) {
|
||||
append($0)
|
||||
} else {
|
||||
if (match_task) {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue