Skip to content

Conversation

@Neved4
Copy link
Contributor

@Neved4 Neved4 commented Nov 16, 2024

Fixes #34 #35

Would love some guidance to create the tests.

Note: Currently doesn't support set -- x y "$@" to append. This is equivalent to fish's set -a argv x y

@Neved4 Neved4 changed the title Add initial support for set constructs Add initial set support Nov 16, 2024
@bouk
Copy link
Owner

bouk commented Nov 18, 2024

Nice, just some tests :)

@Neved4
Copy link
Contributor Author

Neved4 commented Nov 18, 2024

Done! 🤍

@Neved4
Copy link
Contributor Author

Neved4 commented Nov 19, 2024

I'm yet to support set - x as opposed to set -- x.

set -- x "$@" into set -a argv x looks more challenging, but I'll still give it a try.

Makes sense to add those two translations to this PR.

Checklist:

  • set - x -> set argv x
  • set -- x -> set argv x
  • set -- x "$@" -> set -a argv x
  • set -Cefu -> (empty str)

@Neved4
Copy link
Contributor Author

Neved4 commented Nov 19, 2024

Supported set -x, but stuck on this last one.

Since $@ is globally transformed into argv in the parser, it'll still return set argv x $argv.

Tried adding more logic to parseSetExpr(), but unsure how to skip the $@ -> argv translation for specific lines.

If we skip it for lines akin to set -- x "$@", we can translate it to the correct fish output set -a argv x.

@Neved4
Copy link
Contributor Author

Neved4 commented Jan 14, 2025

@bouk Still not sure how to go about this one.

Would you prefer dropping support for:

  • set -- x "$@" -> set -a argv x

And merge or would u rather give it a try?

The rest is ready and with passing tests.

Cheers ✌🏻

@Neved4
Copy link
Contributor Author

Neved4 commented Nov 17, 2025

  • set -- x "$@" -> set -a argv x

Should be completed now 🎉

Would love ur feedback.

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.

Filter out shell set -$flag calls

2 participants