mirror of
https://github.com/nushell/nushell.git
synced 2025-08-14 05:58:40 +02:00
@ -16,3 +16,15 @@ Define a custom command
|
||||
- `params`: parameters
|
||||
- `block`: body of the definition
|
||||
|
||||
## Examples
|
||||
|
||||
Define a command and run it
|
||||
```shell
|
||||
> def say-hi [] { echo 'hi' }; say-hi
|
||||
```
|
||||
|
||||
Define a command and run it with parameter(s)
|
||||
```shell
|
||||
> def say-sth [sth: string] { echo $sth }; say-sth hi
|
||||
```
|
||||
|
||||
|
Reference in New Issue
Block a user