diff --git a/sh/core/code.awk b/sh/core/code.awk index 78aa6b7..bfdd362 100644 --- a/sh/core/code.awk +++ b/sh/core/code.awk @@ -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 {