command function
This commit is contained in:
parent
ffdfe0fc90
commit
278dd75556
2 changed files with 22 additions and 11 deletions
15
sh/code.awk
15
sh/code.awk
|
@ -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)) {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue