From 56c635b949ab24efd0b55c28ee00a68f077c6a0d Mon Sep 17 00:00:00 2001 From: sagie gur ari Date: Fri, 24 Apr 2020 12:36:50 +0000 Subject: [PATCH] docs --- Makefile.toml | 5 ++++- duckscript_sdk/src/sdk/std/flowcontrol/function/help.md | 8 ++++---- 2 files changed, 8 insertions(+), 5 deletions(-) diff --git a/Makefile.toml b/Makefile.toml index a5787a9..526719f 100644 --- a/Makefile.toml +++ b/Makefile.toml @@ -4,7 +4,10 @@ CARGO_MAKE_EXTEND_WORKSPACE_MAKEFILE = "true" CARGO_MAKE_BINARY_EXECUTABLE_NAME = "duck" [env.sdk] -CARGO_MAKE_WORKSPACE_INCLUDE_MEMBERS = "duckscript_sdk;duckscript_cli" +CARGO_MAKE_WORKSPACE_INCLUDE_MEMBERS = [ + "duckscript_sdk", + "duckscript_cli" +] [env.cli] CARGO_MAKE_WORKSPACE_INCLUDE_MEMBERS = "duckscript_cli" diff --git a/duckscript_sdk/src/sdk/std/flowcontrol/function/help.md b/duckscript_sdk/src/sdk/std/flowcontrol/function/help.md index befeec5..971ea0c 100644 --- a/duckscript_sdk/src/sdk/std/flowcontrol/function/help.md +++ b/duckscript_sdk/src/sdk/std/flowcontrol/function/help.md @@ -16,7 +16,7 @@ When a function command is detected, it will search for the end command that com That entire block is considered the function code block (functions cannot be nested in outer functions)
In order to invoke the function, simply call the function name with any amount of paramters.
-Those parameters will be set as $1, $2, ... and so on.
+Those parameters will be set as ${1}, ${2}, ... and so on.
Since variables are global, it will overwrite any older values stored in those variables.
To exist a function and return a value, simply use the **return** command with the value you want to return.
@@ -29,7 +29,7 @@ In case the code reached the **end** call, the function will exist but will retu * function - The function name used later on to invoke the function * end - no parameters * return - optional single paramter to return as an output of the function call -* *function name* - Any number of arguments which will automatically be set as global variables: $1, $2, ... as so on. +* *function name* - Any number of arguments which will automatically be set as global variables: ${1}, ${2}, ... as so on. #### Return Value @@ -61,8 +61,8 @@ echo ${text} # Example of passing arguments fn print_input - # $1 is set with the value 'hello' - # $2 is set with the value 'world' + # ${1} is set with the value 'hello' + # ${2} is set with the value 'world' echo ${1} ${2} end