You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Users expect to be able to quote an argument with spaces in it (or escape the spaces with \) so that it will be treated as a single argument.
This, however, is out of the scope of this tool, and better handled by the user's shell.
I propose that we deprecate command, and add the following three settings to a formatter:
file: string - execute a single file
args: string[] - arguments to be passed to file when executing it
sh: string - a shorthand for setting file to the user's default shell and args to the platform equivalent of ['-c', '...']. The behavior would be similar to the way that Dtils' sh function gets it's arguments.
It would be illegal to provide both sh and file/args.
Additionally, I propose we change $FILE from a fancy string replacement to an environment variable.
The text was updated successfully, but these errors were encountered:
I went ahead and decided to treat command like the above specifies that sh should be implemented. I didn't think about it before, but that is a non-breaking solution that doesn't require the addition of extra configuration options.
I labeled it as "fixed" because the command is now being split up into arguments correctly, but I realize now that I neglected to here note my deviation from the stated plan. I'm sorry for the inconvenience and confusion that this probably caused you.
That said, I'm assuming that you got to this GitHub issue because you were having some trouble. Are arguments being split incorrectly for you?
Pardon me, dear users of this extension... 3 years ago myself was a bit of a noob.
This is bad:
https://github.com/Vehmloewff/custom-format/blob/master/src/run-command.ts#L6
Users expect to be able to quote an argument with spaces in it (or escape the spaces with
\
) so that it will be treated as a single argument.This, however, is out of the scope of this tool, and better handled by the user's shell.
I propose that we deprecate
command
, and add the following three settings to a formatter:file: string
- execute a single fileargs: string[]
- arguments to be passed tofile
when executing itsh: string
- a shorthand for settingfile
to the user's default shell andargs
to the platform equivalent of['-c', '...']
. The behavior would be similar to the way that Dtils'sh
function gets it's arguments.It would be illegal to provide both
sh
andfile
/args
.Additionally, I propose we change
$FILE
from a fancy string replacement to an environment variable.The text was updated successfully, but these errors were encountered: