Skip to content

improve the errors in ansi -e #8704

@amtoine

Description

@amtoine

Related problem

as i did with error make in #8511, i think we could have slightly better error message for the ANSI format record given to ansi -e 😋

for now we have things like

>_ ansi -e
Error: nu::shell::missing_parameter

  × Missing parameter: code.
   ╭─[entry #19:1:1]
 1 │ ansi -e
   · ──┬─
   ·   ╰── missing parameter: code
   ╰────
>_ ansi -e {}
>_ ansi -e {foo: "foo"}
Error: nu::shell::incompatible_parameters

  × Incompatible parameters.
   ╭─[entry #21:1:1]
 1 │ ansi -e {foo: "foo"}
   ·         ──────┬─────
   ·               ╰── problem with key: foo
   ╰────

Describe the solution you'd like

i think it would be a bit better to explain

  • what should be expected when one gives nothing to ansi -e
  • what is the "problem" with the "foo" key

and to add a complete example to the help of ansi 👍

Describe alternatives you've considered

No response

Additional context and details

No response

Metadata

Metadata

Assignees

Labels

A:error-unhelpfulThe error message you observe is not helpful to identify the problemcategory:enhancementNew feature or request

Type

No type

Projects

No projects

Milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions