Skip to content

nu::parser::unknown_flag errors could just list the flags instead of saying "use <command> --help for a list of flags" #6773

@webbedspace

Description

@webbedspace

Related problem

No response

Describe the solution you'd like

Here's an example of one such error:

〉ls -r js
Error: nu::parser::unknown_flag (link)

  × The `ls` command doesn't have flag `-r`.
   ╭─[entry #179:1:1]
 1 │ ls -r js
   ·     ┬
   ·     ╰── unknown flag
   ╰────
  help: use ls --help for a list of flags

I'm pretty sure Nu's commands do not have more than 8 flags, and as such, I feel like simply listing the flags for the attempted command after this error (taken directly from help) wouldn't be too major an imposition.

Describe alternatives you've considered

No response

Additional context and details

No response

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions