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

alternative var=true joining #189

Open
jdx opened this issue Dec 10, 2024 · 0 comments
Open

alternative var=true joining #189

jdx opened this issue Dec 10, 2024 · 0 comments

Comments

@jdx
Copy link
Owner

jdx commented Dec 10, 2024

right now we just use shell_words::join() to deal with the problem of using var=true which populates $usage_foo as a space-delimited string where each arg may itself contain spaces.

I believe this logic just puts ' around each element if it has spaces. This is very bash-specific though, so it might not be desirable when using a different language. I'm open to alternatives here like customizing the escape behavior, or potentially having multiple env vars for this purpose like this:

usage_foo = "1 '2 3' 4"
usage_foo_n = "3"
usage_foo_0 = "1"
usage_foo_1 = "2 3"
usage_foo_2 = "4"

I didn't go with that initially because I think it would be a huge pain in bash, but the nice thing about it is it's much more formal about this and doesn't require any escaping.

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

No branches or pull requests

1 participant