mawk/function
This commit is contained in:
parent
80f244fb08
commit
596126bb85
2 changed files with 6 additions and 6 deletions
|
@ -135,14 +135,14 @@ BEGIN {
|
||||||
} else {
|
} else {
|
||||||
reset()
|
reset()
|
||||||
}
|
}
|
||||||
} else if (action == "command function") {
|
} else if (action == "function") {
|
||||||
if (match($0, re["command"], m)) {
|
if (match($0, re["command"])) {
|
||||||
append(m[1])
|
append(extract($0, "command"))
|
||||||
} else if (match($0, re["function"], m)) {
|
} else if (match($0, re["function"])) {
|
||||||
split(doc, array, "\n")
|
split(doc, array, "\n")
|
||||||
for (item in array) {
|
for (item in array) {
|
||||||
if (array[item] == target) {
|
if (array[item] == target) {
|
||||||
print m[1]
|
print extract($0, "function")
|
||||||
exit
|
exit
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -204,7 +204,7 @@ rwx_shell_main() {
|
||||||
*) ;;
|
*) ;;
|
||||||
esac
|
esac
|
||||||
# find the matching function
|
# find the matching function
|
||||||
function="$(rwx_code_action_target "command function" "${command}")"
|
function="$(rwx_code_action_target "function" "${command}")"
|
||||||
if [ -n "${function}" ]; then
|
if [ -n "${function}" ]; then
|
||||||
"${function}" "${@}"
|
"${function}" "${@}"
|
||||||
fi
|
fi
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue