Support line continuation characters on Unix
- Dominant language
- C#
- Stars
- 5.5k
- Forks
- 1.5k
- Avg merge
- 1d 13h
- Merged PRs (30d)
- 133
Description
In some recent work I've had need to execute an external program, so the `` task comes in handy:
```
```
The problem, though, is that the command I _really_ need to execute is _long_ -- resulting in a line which is nearly 596 characters long:
```
```
I want shorter lines, both to make it easier to read, and to simplify version control review and validation (long lines make for terrible diffs).
There are (at least?) two ways to make for shorter lines:
1. Use more variables
```
LD="@(Runtimes->'%(Ld)')"
```
2. Use line continuations:
```
```
Truth be told, I tried (1) first, but that doesn't work with xbuild on OS X (doh!).
So I try the Unix variant on (2):
```
```
...which promptly fails because `\` is replaced with `/` at all instances in _both_ xbuild and msbuild (which is why I'm bringing it up here... ;-).
What would be useful is some way of using line-continuation characters in a portable fashion. I can think of two ways to support this:
1. On Unix, replace `^` with `\`. This would allow us to use the Windows line-continuation character of `^` in a portable fashion.
The problem with this is if there are any shells or commands for which a trailing `^` is appropriate, though I can't think of any programs which use `^` in this manner offhand.
2. Fix the `s#\#/#g` replacement that MSBuild performs so that `\` can be used within the `//Exec/@Command` attribute. Then, we could use `Conditional` to have one command for Windows and a different command for Unix:
```
```
Contributor guide
No contributing guide indexed for this repository
Assessment
This issue has not been assessed yet.