This commit is contained in:
parent
8d8042fefe
commit
f9252e1ee8
1 changed files with 7 additions and 3 deletions
|
@ -5,10 +5,14 @@ function append(line) {
|
|||
doc = doc line
|
||||
}
|
||||
|
||||
function eval(alias, target) {
|
||||
function alias_function(alias, target) {
|
||||
print alias "() { " target " \"${@}\"; }"
|
||||
}
|
||||
|
||||
function alias_variable(alias, target) {
|
||||
print alias "() { echo \"${" target "}\"; }"
|
||||
}
|
||||
|
||||
function output(name, type) {
|
||||
print "↙ " type
|
||||
print name
|
||||
|
@ -109,7 +113,7 @@ BEGIN {
|
|||
} else if (match($0, re["function"], m)) {
|
||||
split(doc, array, "\n")
|
||||
for (item in array) {
|
||||
eval(array[item], m[1])
|
||||
alias_function(array[item], m[1])
|
||||
}
|
||||
reset()
|
||||
} else {
|
||||
|
@ -121,7 +125,7 @@ BEGIN {
|
|||
} else if (match($0, re["function"], m)) {
|
||||
split(doc, array, "\n")
|
||||
for (item in array) {
|
||||
eval(array[item], m[1])
|
||||
alias_function(array[item], m[1])
|
||||
}
|
||||
reset()
|
||||
} else {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue