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

Add support for implicit $@ #30

Merged
merged 3 commits into from
Nov 18, 2024
Merged

Add support for implicit $@ #30

merged 3 commits into from
Nov 18, 2024

Conversation

Neved4
Copy link
Contributor

@Neved4 Neved4 commented Nov 15, 2024

Fixes #29

You might want to add tests for this one 🚀

@JoaoCostaIFG
Copy link
Contributor

JoaoCostaIFG commented Nov 15, 2024

Hi @Neved4!
I believe we don't want to quote $argv in the resulting fish code. For example, when executing the following script with the arguments 1 2 3 we get a number per line.

for cmd; do
  echo "${cmd}"
done

The fish snippet:

for cmd in "$argv"
  echo "$cmd"
end

Will put all numbers in a single line because it only runs once (it converts the argument list into a single string).

@Neved4
Copy link
Contributor Author

Neved4 commented Nov 15, 2024

Thx a lot @JoaoCostaIFG, you're 100% right!

Just pushed another commit, cheers.

@Neved4
Copy link
Contributor Author

Neved4 commented Nov 16, 2024

Would also appreciate any guidance for tests on this one!

@bouk
Copy link
Owner

bouk commented Nov 18, 2024

Cool, please add some tests indeed. Adding a test that has the examples in your issue would be a good start

@Neved4
Copy link
Contributor Author

Neved4 commented Nov 18, 2024

Added!

@bouk bouk merged commit 2c9cb5a into bouk:master Nov 18, 2024
1 check passed
@bouk
Copy link
Owner

bouk commented Nov 18, 2024

Nice, thanks!

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.

Support implicit "$@" in for loops
3 participants