是否可以在变量中运行命令并传递参数?鉴于此命令需要输入参数。
示例:
// in launch.json
{
"program": "${command:somecommand(foo=${someargument})}"
}
答案 0 :(得分:0)
在launch.json
中创建一个调用命令的输入,您可以在其中传递参数。然后,您可以在附加/启动配置中引用输入。
// launch.json
{
"version": "0.2.0",
"inputs": [
{
"id": "commandInput",
"type": "command",
"command": "somecommand",
"args": {
"foo": "${someargument}"
}
}
],
"configurations": [
{
"name": "Launch",
"type": "node",
"request": "launch",
"program": "${input:commandInput}"
}
]
}