diff --git a/README.md b/README.md index 0fac682..37fd6b7 100644 --- a/README.md +++ b/README.md @@ -158,6 +158,37 @@ Output: ``` +### Helpers / Function Arguments with + +Function Arguments are not a part of the official Mustache implementation, and are more often associated with Handlebar's Helper functionality. + +`mo` allows for passing strings to functions. + +```handlebars +{{myfunc foo bar}} +``` + +For security reasons, this arguments are not immediately available to function calls without a flag. + +#### with `--allow-function-arguments` + +```bash +myfunc() { + # Outputs "foo, bar" + echo "$1, $2"; +} +``` + +#### Using `$MO_FUNCTION_ARGS` + +```bash +myfunc() { + # Outputs "foo, bar" + echo "${MO_FUNCTION_ARGS[0]}, ${MO_FUNCTION_ARGS[1]}"; +} +``` + + Concessions -----------