Skip to content

alternative var=true joining #189

@jdx

Description

@jdx

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.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions