mirror of
https://github.com/nushell/nushell
synced 2024-11-14 08:57:08 +00:00
complete the type of --error-label
in std assert
commands (#12998)
i was looking at the website documentation of `std assert` and i noticed one thing - the `--error-label` argument of `assert` and `assert not` was just a `record` -> now it's that complete type `record<text: string, span: record<start: int, end: int>>`
This commit is contained in:
parent
65911c125c
commit
ff5cb6f1ff
1 changed files with 2 additions and 2 deletions
|
@ -36,7 +36,7 @@
|
|||
export def main [
|
||||
condition: bool, # Condition, which should be true
|
||||
message?: string, # Optional error message
|
||||
--error-label: record # Label for `error make` if you want to create a custom assert
|
||||
--error-label: record<text: string, span: record<start: int, end: int>> # Label for `error make` if you want to create a custom assert
|
||||
] {
|
||||
if $condition { return }
|
||||
error make {
|
||||
|
@ -81,7 +81,7 @@ export def main [
|
|||
export def not [
|
||||
condition: bool, # Condition, which should be false
|
||||
message?: string, # Optional error message
|
||||
--error-label: record # Label for `error make` if you want to create a custom assert
|
||||
--error-label: record<text: string, span: record<start: int, end: int>> # Label for `error make` if you want to create a custom assert
|
||||
] {
|
||||
if $condition {
|
||||
let span = (metadata $condition).span
|
||||
|
|
Loading…
Reference in a new issue