-
Notifications
You must be signed in to change notification settings - Fork 2.1k
formatted_flags always prints all flags #16418
Copy link
Copy link
Closed
Labels
A:error-unhelpfulThe error message you observe is not helpful to identify the problemThe error message you observe is not helpful to identify the problemA:parserIssues related to parsingIssues related to parsingcategory:enhancementNew feature or requestNew feature or requestpolishthis problem makes nu feel unpolishedthis problem makes nu feel unpolished
Milestone
Description
The logic in Signature::formatted_flags make it seem that the intent was to truncate more than 10 flags, but it always prints all of them.
https://github.com/nushell/nushell/blob/main/crates/nu-protocol/src/signature.rs#L628-L658
Example:
~> ulimit --doesnt-exist
Error: nu::parser::unknown_flag
× The `ulimit` command doesn't have flag `doesnt-exist`.
╭─[entry #12:1:8]
1 │ ulimit --doesnt-exist
· ───────┬──────
· ╰── unknown flag
╰────
help: Some available flags: --help(-h), --soft(-S), --hard(-H), --all(-a), --core-size(-c), --data-size(-d), --nice(-e), --file-size(-f), --pending-signals(-i),
--lock-size(-l), --resident-set-size(-m), --file-descriptor-count(-n), --queue-size(-q), --realtime-priority(-r), --stack-size(-s), --cpu-time(-t), --process-
count(-u), --virtual-memory-size(-v), --file-locks(-x), --realtime-maxtime(-y)... Use `--help` for a full list of flags and more information.Currently this method is only used by the parser. I wonder if it would be a good idea to use did_you_mean instead?
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
A:error-unhelpfulThe error message you observe is not helpful to identify the problemThe error message you observe is not helpful to identify the problemA:parserIssues related to parsingIssues related to parsingcategory:enhancementNew feature or requestNew feature or requestpolishthis problem makes nu feel unpolishedthis problem makes nu feel unpolished