-
Notifications
You must be signed in to change notification settings - Fork 145
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
template: allow & in arg string #809
base: master
Are you sure you want to change the base?
Conversation
As long as the "&" is escaped like \& it will treat it literally now. But if it is on its own like "&" then it will treat it like a special character. This is the Bastille file I'm using. ARG NAME CMD echo "My name is ${NAME}" > /root/my-name With --arg NAME="me \& you" |
The question is how to properly document that for the user since it is not obvious that you have to pass |
Good point. I think personally it should be a general point that if we are using special characters (anywhere) we need to try to escape them. This keeps things lined up with the rest of the BSD world/code for the most part. The other question is, Is there ever a time when the user will want to use the "specialness" of that character? And if they do, we definitely need to have a way to do both, and escaping it is the best option. IMO. |
How so? All it does is add one additional clans to the "parse_arg_value" function. And that is, if it finds \&, it will make sure it stays. |
ok I am good with it. |
I've added docs saying that it needs to be escaped if it is to be treated literally. The question is, does it work for you? |
I have now tried the following:
It does not work:
I also need to note that
and
|
You are escaping it twice there. It should only be escaped once, and without the single quotes. |
#412
The PR will make sure an escape character \ is added in front of the & character in 'arg' string ONLY if it is escaped like "\&".
It fixes #412, but I'm not sure if it will break something else down the road. It shouldn't as it only looks for \& and makes sure it stays that way.
@michael-o
@tobiastom