Skip to content
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

The builtin returns true with garbage arguments #9942

Closed
faho opened this issue Aug 9, 2023 · 2 comments
Closed

The builtin returns true with garbage arguments #9942

faho opened this issue Aug 9, 2023 · 2 comments
Labels
bug Something that's not working as intended
Milestone

Comments

@faho
Copy link
Member

faho commented Aug 9, 2023

builtin -- whatever

will always just return true without doing anything because it hasn't been told to query (-q) or to list the names (-n) and so just does nothing.

This is not a regression in the rust version, this is how it worked in 3.6.1 as well.

Of course builtin whatever is the decorator version, and will try to run a builtin called "whatever", but as soon as you add the -- it'll call the builtin.

The command and time builtins open their help if called like that - which also isn't great, tbh, because it opens a pager and I find it unexpected. I'd expect just a regular error.

In the interest of consistency, I'll make it open the help first.

(@zanchey This could be backported to 3.7.0, I'll fix it in the rust version first because it's not a big deal)

@faho faho added the bug Something that's not working as intended label Aug 9, 2023
@faho faho added this to the fish next-3.x milestone Aug 9, 2023
@faho faho closed this as completed in 27a11ef Aug 9, 2023
@faho faho modified the milestones: fish next-3.x, fish 3.7.0 Oct 9, 2023
@zanchey
Copy link
Member

zanchey commented Dec 27, 2023

@faho let me know if you still want to fix this for 3.7.0

@faho
Copy link
Member Author

faho commented Dec 27, 2023

It's fine to skip it - it's a weird reaction to already buggy code in a small edge case, and nobody stumbled over it in practice (I found it by snooping around for builtin -- $foo).

@faho faho modified the milestones: fish 3.7.0, fish next-3.x Dec 27, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something that's not working as intended
Projects
None yet
Development

No branches or pull requests

2 participants