awk/eval
This commit is contained in:
parent
23c0c18797
commit
faeda4feb9
2 changed files with 6 additions and 19 deletions
|
@ -5,6 +5,10 @@ function append(line) {
|
|||
doc = doc line
|
||||
}
|
||||
|
||||
function eval(alias, target) {
|
||||
print alias "() { " target " \"\\${@}\"; }"
|
||||
}
|
||||
|
||||
function output(name, type) {
|
||||
print "↙ " type
|
||||
print name
|
||||
|
@ -80,7 +84,7 @@ BEGIN {
|
|||
} else if (match($0, RE_FUNCTION, m)) {
|
||||
split(doc, array, "\n")
|
||||
for (item in array) {
|
||||
print array[item] " " m[1]
|
||||
eval(array[item], m[1])
|
||||
}
|
||||
reset()
|
||||
} else {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue