-
Notifications
You must be signed in to change notification settings - Fork 1.9k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
builtins should not print entire usage summary on invalid use #3404
Comments
No. The error should be foremost (i.e. "front and center"). That |
Agreed with @krader on both counts. Outputting the full usage spec just obscures the error message. I'd be in favor of replacing the "output full usage on error behavior" with a pointer to how to access the usage, e.g. to run |
That works too. The main issue is when the usage spec pushes the actual error off screen. |
Shall we track that here then? |
What might be the issue is not where we output usage output at all, but how "full" our manpage-derived usage output can be unnecessarily. typical manpage-parsed output: fish_realpath ‐‐ Convert a path to an absolute path without symlinks
Synopsis
fish_realpath path
Description
This is an implementation of the external realpath command that
doesn’t support any options. It’s meant to be used only by scripts
which need to be portable. In general scripts shouldn’t invoke this
directly. They should just use realpath which will fallback to this
builtin if an external command cannot be found.
If the path is invalid no translated path will be written to stdout
and an error will be reported. This implementation behaves like the
GNU command being invoked with ‐‐canonicalize‐existing. should be more like 1-2 lines (and is where I did this by hand):
|
Yeah, I just removed the summary. It's fluff, people can use the man page or help. |
I sure wish we had a nice way to spit out a succinct usage line. |
I think we could have kept the man page thing and just more carefully cut up the output. |
Especially as, in this case, the documentation is quite massive. Caught by porting string's test to littlecheck. See #3404 - this was already supposed to be included.
Consider
This seems like it ought to be:
Further:
We should place the error after the usage information. Sometimes it can be long and the error, far away.
The text was updated successfully, but these errors were encountered: