awk/↕
This commit is contained in:
parent
845065a374
commit
2183d22f4e
1 changed files with 31 additions and 31 deletions
|
@ -145,37 +145,6 @@ if (action == "tasks") {
|
||||||
match_task = 0
|
match_task = 0
|
||||||
}
|
}
|
||||||
|
|
||||||
# eval
|
|
||||||
} else if (action == "eval") {
|
|
||||||
if (match($0, re[target])) {
|
|
||||||
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()
|
|
||||||
}
|
|
||||||
|
|
||||||
# function
|
|
||||||
} else if (action == "function") {
|
|
||||||
if (match($0, re["command"])) {
|
|
||||||
append(extract($0, "command"))
|
|
||||||
} else if (match($0, re["function"])) {
|
|
||||||
split(doc, array, "\n")
|
|
||||||
for (item in array) {
|
|
||||||
if (array[item] == target) {
|
|
||||||
print extract($0, "function")
|
|
||||||
exit
|
|
||||||
}
|
|
||||||
}
|
|
||||||
reset()
|
|
||||||
} else {
|
|
||||||
reset()
|
|
||||||
}
|
|
||||||
|
|
||||||
# doc
|
# doc
|
||||||
} else if (action == "doc") {
|
} else if (action == "doc") {
|
||||||
# doc
|
# doc
|
||||||
|
@ -243,6 +212,37 @@ if (action == "tasks") {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
# function
|
||||||
|
} else if (action == "function") {
|
||||||
|
if (match($0, re["command"])) {
|
||||||
|
append(extract($0, "command"))
|
||||||
|
} else if (match($0, re["function"])) {
|
||||||
|
split(doc, array, "\n")
|
||||||
|
for (item in array) {
|
||||||
|
if (array[item] == target) {
|
||||||
|
print extract($0, "function")
|
||||||
|
exit
|
||||||
|
}
|
||||||
|
}
|
||||||
|
reset()
|
||||||
|
} else {
|
||||||
|
reset()
|
||||||
|
}
|
||||||
|
|
||||||
|
# eval
|
||||||
|
} else if (action == "eval") {
|
||||||
|
if (match($0, re[target])) {
|
||||||
|
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()
|
||||||
|
}
|
||||||
|
|
||||||
# filter
|
# filter
|
||||||
} else if (action == "filter") {
|
} else if (action == "filter") {
|
||||||
if (match($0, re[target])) {
|
if (match($0, re[target])) {
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue