This commit is contained in:
sagie gur ari 2020-01-01 19:46:47 +00:00
parent 950d07abe1
commit 0eb970b474
3 changed files with 45 additions and 6 deletions

View file

@ -279,13 +279,22 @@ This also means that other developers can replace the function command with thei
Below an example of [if/else command](https://github.com/sagiegurari/duckscript/blob/master/docs/sdk.md#sdk__If):
```sh
if set false
value = set false
if ${value}
echo should not be here
elseif set true
elseif true
echo in else if but not done yet
if set true
value = set true
if not false
echo nested if
if set ${value}
echo after command
else
echo should not be here
end_if
end_if
else
echo should not be here

View file

@ -236,13 +236,22 @@ This also means that other developers can replace the function command with thei
Below an example of [if/else command](https://github.com/sagiegurari/duckscript/blob/master/docs/sdk.md#sdk__If):
```sh
if set false
value = set false
if ${value}
echo should not be here
elseif set true
elseif true
echo in else if but not done yet
if set true
value = set true
if not false
echo nested if
if set ${value}
echo after command
else
echo should not be here
end_if
end_if
else
echo should not be here

View file

@ -40,3 +40,24 @@ elseif set true
else
echo should not be here
end_if
value = set false
if ${value}
echo should not be here
elseif true
echo in else if but not done yet
value = set true
if not false
echo nested if
if set ${value}
echo after command
else
echo should not be here
end_if
end_if
else
echo should not be here
end_if