mirror of
https://github.com/nushell/nushell
synced 2024-12-31 23:39:00 +00:00
18 lines
245 B
Markdown
18 lines
245 B
Markdown
|
# def
|
||
|
|
||
|
Use `def` to create a custom command.
|
||
|
|
||
|
## Examples
|
||
|
|
||
|
```
|
||
|
> def my_command [] { echo hi nu }
|
||
|
> my_command
|
||
|
hi nu
|
||
|
```
|
||
|
|
||
|
```
|
||
|
> def my_command [adjective: string, num: int] { echo $adjective $num meet nu }
|
||
|
> my_command nice 2
|
||
|
nice 2 meet nu
|
||
|
```
|