-
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
Builtin wrapper functions produce a backtrace with invalid options #5434
Comments
Duplicate of #3404 |
I don't think he's complaining about seeing the synopsis, but that he's getting this part:
@meain is that correct? |
@floam yes |
That could be fixed, though it's low-impact. |
Okay, what should we change here? We could completely remove the complete backtrace and help, but that would just leave:
which seems alright if it's directly on the commandline like in that example, but what if it's inside a script somewhere? Then you can play hunt-the-bug. We could probably remove the help or just point to it with "see We should also shorten the backtrace, because this is ridiculous: How about removing the multiple "on standard input" lines and the multiple empty lines here, for one? So the backtrace looks more like
? Line information for all the functions would actually be nice, though. I'm relabelling this as an enhancement because this is currently how it is supposed to behave. |
This printed things like ``` in function 'f' called on standard input in function 'd' called on standard input in function 'b' called on standard input in function 'a' called on standard input ``` As a first step, it removes the empty lines so it's now ``` in function 'f' called on standard input in function 'd' called on standard input in function 'b' called on standard input in function 'a' called on standard input ``` See #5434.
Okay, I've removed the empty lines. What I'm working on now:
|
Now: ``` cd: Unknown option '-r' ~/dev/fish-shell/share/functions/cd.fish (line 40): builtin cd $argv ^ in function 'cd' with arguments '-r' in function 'f' in function 'd' in function 'b' with arguments '-1q --wurst' in function 'a' called on standard input ``` See fish-shell#5434.
This was printed basically everywhere. The user knows what they executed on standard input. A good example: ```fish set c (subme 513) ``` used to print ``` fish: Too much data emitted by command substitution so it was discarded set -l x (string repeat -n $argv x) ^ in function 'subme' called on standard input with parameter list '513' in command substitution called on standard input ``` and now it is ``` fish: Too much data emitted by command substitution so it was discarded set -l x (string repeat -n $argv x) ^ in function 'subme' with arguments '513' in command substitution ``` See fish-shell#5434.
Okay, here's what I've got:
from
(plus the docs in both - also the missing translation is down to me not yet installing the new version) Any more ideas? |
The example from the OP:
|
Okay, now after #3404, the example looks like
I'm gonna declare this done for now. |
fish version:
2.7.1
If I pass in an unknown argument to a builtin, it produces some unnecessary output and not just the
Unknown option
message.The text was updated successfully, but these errors were encountered: