parent
a57e3f4eea
commit
601eef2326
1 changed files with 10 additions and 8 deletions
|
@ -1,9 +1,11 @@
|
|||
function alias_function(alias, name) {
|
||||
print alias "() { " name " \"${@}\"; }"
|
||||
function alias_eval(alias, name, type) {
|
||||
text = alias "() { "
|
||||
if (type == "function") {
|
||||
text = text name " \"${@}\""
|
||||
} else if (type == "variable") {
|
||||
text = text "echo \"${" name "}\""
|
||||
}
|
||||
|
||||
function alias_variable(alias, name) {
|
||||
print alias "() { echo \"${" name "}\"; }"
|
||||
print text "; }"
|
||||
}
|
||||
|
||||
function append(line) {
|
||||
|
@ -127,7 +129,7 @@ BEGIN {
|
|||
} else if (match($0, re["function"], m)) {
|
||||
split(doc, array, "\n")
|
||||
for (item in array) {
|
||||
alias_function(array[item], m[1])
|
||||
alias_eval(array[item], m[1], "function")
|
||||
}
|
||||
reset()
|
||||
} else {
|
||||
|
@ -139,7 +141,7 @@ BEGIN {
|
|||
} else if (match($0, re["function"], m)) {
|
||||
split(doc, array, "\n")
|
||||
for (item in array) {
|
||||
alias_function(array[item], m[1])
|
||||
alias_eval(array[item], m[1], "function")
|
||||
}
|
||||
reset()
|
||||
} else {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue