Simulate input from stdin when running a scala program in intellij

前端 未结 2 849
青春惊慌失措
青春惊慌失措 2020-12-09 15:07

Is there any way to configure the command line args to intellij for stdin redirection?

Something along the lines of:

Run | Edit Run Configurations | Script P

2条回答
  •  半阙折子戏
    2020-12-09 15:21

    Unfortunately, no - at least not directly in run configurations.

    The best you can do, afaik, is either to:

    • modify your script / program to run either with no args (reads System.in) or with a filename argument (reads the file)

    • make a wrapper script / program which acts in the manner above.

    Hope this helps,

    vikingsteve

提交回复
热议问题