This commit is contained in:
sagie gur ari 2020-04-24 12:36:50 +00:00
parent 7a55aeec49
commit 56c635b949
2 changed files with 8 additions and 5 deletions

View file

@ -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"

View file

@ -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)<br>
In order to invoke the function, simply call the function name with any amount of paramters.<br>
Those parameters will be set as $1, $2, ... and so on.<br>
Those parameters will be set as ${1}, ${2}, ... and so on.<br>
Since variables are global, it will overwrite any older values stored in those variables.<br>
To exist a function and return a value, simply use the **return** command with the value you want to return.<br>
@ -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