I would like to embed a long command like this in a bash script:
mycommand \\
--server myserver \\
--filename extremely/long/file/name/that/i/would/like/
Basically, there is nothing built into bash to do this.
A wrapper is typically more trouble than it's worth, but that said, you could try an alias or a funciton, eg. j
j(){sed -e ':a;$!N;s/ *\n *//g;ta' <<<"$1"}
echo "$(j "3 spaces
/hello
/world
/this
/is
/a
/long
/path
")"
# 3 spaces/hello/world/this/is/a/long/path