mirror of
https://github.com/go-sylixos/elvish.git
synced 2024-12-13 09:57:51 +08:00
_website: Fix Elvish codeblocks.
This commit is contained in:
parent
d1a47ec49a
commit
b7f11e6816
|
@ -1228,7 +1228,7 @@ executed.
|
||||||
The condition part is an expression, not a command like in other shells.
|
The condition part is an expression, not a command like in other shells.
|
||||||
Example:
|
Example:
|
||||||
|
|
||||||
```elvish-transcript
|
```elvish
|
||||||
fn tell-language [fname]{
|
fn tell-language [fname]{
|
||||||
if (has-suffix $fname .go) {
|
if (has-suffix $fname .go) {
|
||||||
echo $fname" is a Go file!"
|
echo $fname" is a Go file!"
|
||||||
|
@ -1237,12 +1237,13 @@ fn tell-language [fname]{
|
||||||
} else {
|
} else {
|
||||||
echo $fname" is a mysterious file!"
|
echo $fname" is a mysterious file!"
|
||||||
}
|
}
|
||||||
|
}
|
||||||
```
|
```
|
||||||
|
|
||||||
The condition part must be syntactically a single expression, but it can
|
The condition part must be syntactically a single expression, but it can
|
||||||
evaluate to multiple values, in which case they are and'ed:
|
evaluate to multiple values, in which case they are and'ed:
|
||||||
|
|
||||||
```elvish-transcript
|
```elvish
|
||||||
if (put $true $false) {
|
if (put $true $false) {
|
||||||
echo "will not be executed"
|
echo "will not be executed"
|
||||||
}
|
}
|
||||||
|
@ -1253,7 +1254,7 @@ how `and` works.
|
||||||
|
|
||||||
Tip: a combination of `if` and `?()` gives you a semantics close to other shells:
|
Tip: a combination of `if` and `?()` gives you a semantics close to other shells:
|
||||||
|
|
||||||
```elvish-transcript
|
```elvish
|
||||||
if ?(test -d .git) {
|
if ?(test -d .git) {
|
||||||
# do something
|
# do something
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue
Block a user