在Visual Studio Code中,如何在launch.json中传递参数 [英] In Visual Studio Code, how to pass arguments in launch.json

查看:226
本文介绍了在Visual Studio Code中,如何在launch.json中传递参数的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

在Visual Studio Code中,启动我正在编写的应用程序的 launch.json 文件中,如何添加命令行参数?

In Visual Studio Code, in the launch.json file that launches the app I'm writing, how do I add command line arguments?

推荐答案

As described in the documentation, you need to use the args attribute. E.g.

{
    "type": "node",
    "request": "launch",
    "name": "Debug App",
    "program": "${workspaceFolder}/main.js",
    "args": ["arg1", "arg2", "arg3"]
}

这篇关于在Visual Studio Code中,如何在launch.json中传递参数的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆