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

Use a lazy-quoting @sh encoder #1548

Merged
merged 3 commits into from
Feb 9, 2023
Merged

Use a lazy-quoting @sh encoder #1548

merged 3 commits into from
Feb 9, 2023

Conversation

vit-zikmund
Copy link
Contributor

I eventually took a hit at the second alternative from #1526 (comment), which is generally ouptut-size optimal and behaves nice for strings with a lot of safe characters.

@vit-zikmund vit-zikmund mentioned this pull request Feb 6, 2023
@vit-zikmund
Copy link
Contributor Author

I also tried to figure out how to code in a quoting style switch the user could use, but I see this is not really supported for @encoder style calls. So for now I added an internal switch.

@mikefarah
Copy link
Owner

Looks great, thanks for the contribution :)

@mikefarah
Copy link
Owner

It would be good to add tests for the empty quote cases you mentioned. Happy to do that myself if you don't have the time

@vit-zikmund
Copy link
Contributor Author

I'll do it in a couple minutes ;)

@vit-zikmund
Copy link
Contributor Author

vit-zikmund commented Feb 7, 2023

Huh, it took a little more 😮‍💨 Crafting a yaml string starting with a single quote that's in a go string literal... It's good that I like the movie Inception 😄

@mikefarah mikefarah merged commit 93b7c99 into mikefarah:master Feb 9, 2023
@vit-zikmund vit-zikmund deleted the shell-encode branch February 9, 2023 07:49
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.

None yet

2 participants