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