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

list.sh: fix arg parsing always failing #18223

Merged
merged 1 commit into from
Sep 2, 2024
Merged

list.sh: fix arg parsing always failing #18223

merged 1 commit into from
Sep 2, 2024

Conversation

Bo98
Copy link
Member

@Bo98 Bo98 commented Sep 2, 2024

Turns out this script has never worked.

@ZhongRuoyu
Copy link
Member

Thanks! Completion is now indeed much faster. Could this work for brew ls too? That's an internal alias but it's still routed to cmd/list.rb.

Copy link
Member

@carlocab carlocab left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Why not just do shift in the case block above?

@Bo98
Copy link
Member Author

Bo98 commented Sep 2, 2024

Could this work for brew ls too?

Yeah, will do this later today (separate PR probably).

Why not just do shift in the case block above?

This logic is borrowed from other files like command_path.sh.

I guess the initial idea was to avoid tampering the args as we conditionally fallback to *.rb but that probably doesn't happen since this is in a function. Could look into refactoring them all.

Copy link
Member

@MikeMcQuaid MikeMcQuaid left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks @Bo98!

@MikeMcQuaid MikeMcQuaid merged commit cbc39e3 into master Sep 2, 2024
27 checks passed
@MikeMcQuaid MikeMcQuaid deleted the list.sh-fix branch September 2, 2024 07:50
@MikeMcQuaid
Copy link
Member

Turns out this script has never worked.

@Bo98 Could you elaborate a bit more here (and on future PRs): what specifically has never worked and why? This pull request message does not reveal this information 😁

@Bo98
Copy link
Member Author

Bo98 commented Sep 2, 2024

what specifically has never worked and why?

The whole thing. Because $1 == list it will always hit the return 1 case of the argument parsing loop and fallback to list.rb.

So all the code below never ran, and had errors anyway like undefined ohai which the source line also fixes.

@MikeMcQuaid
Copy link
Member

@Bo98 Thanks for clarifying!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants