| title | attr example |
|---|---|
| categories | core |
| version | 0.103.0 |
| core | Attribute for adding examples to custom commands. |
| usage | Attribute for adding examples to custom commands. |
| editLink | false |
| contributors | false |
attr example for core
Attribute for adding examples to custom commands.
> attr example {flags} (description) (example)
--result {any}: Expected output of example.
description: Description of the example.example: Example code snippet.
| input | output |
|---|---|
| nothing | record<description: string, example: string> |
Add examples to custom command
> # Double numbers
@example "double an int" { 2 | double } --result 4
@example "double a float" { 0.25 | double } --result 0.5
def double []: [number -> number] { $in * 2 }