mirror of
https://github.com/nushell/nushell.git
synced 2025-08-14 05:58:40 +02:00
Autogenerate missing docs (#3514)
* Autogenerate missing docs * Update ansi.md * Rename question mark command docs * Delete empty?.md
This commit is contained in:
27
docs/commands/if.md
Normal file
27
docs/commands/if.md
Normal file
@ -0,0 +1,27 @@
|
||||
# if
|
||||
Run blocks if a condition is true or false.
|
||||
|
||||
## Usage
|
||||
```shell
|
||||
> if <condition> <then_case> <else_case> {flags}
|
||||
```
|
||||
|
||||
## Parameters
|
||||
* `<condition>` the condition that must match
|
||||
* `<then_case>` block to run if condition is true
|
||||
* `<else_case>` block to run if condition is false
|
||||
|
||||
## Flags
|
||||
* -h, --help: Display this help message
|
||||
|
||||
## Examples
|
||||
Run a block if a condition is true
|
||||
```shell
|
||||
> let x = 10; if $x > 5 { echo 'greater than 5' } { echo 'less than or equal to 5' }
|
||||
```
|
||||
|
||||
Run a block if a condition is false
|
||||
```shell
|
||||
> let x = 1; if $x > 5 { echo 'greater than 5' } { echo 'less than or equal to 5' }
|
||||
```
|
||||
|
Reference in New Issue
Block a user