diff --git a/sh/core/code.awk b/sh/core/code.awk index 7b18345..6418469 100644 --- a/sh/core/code.awk +++ b/sh/core/code.awk @@ -145,37 +145,6 @@ if (action == "tasks") { 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 } else if (action == "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 } else if (action == "filter") { if (match($0, re[target])) {