【发布时间】:2020-01-09 23:38:31
【问题描述】:
所以我有一个遵循这个布局的应用程序模块:
defmodule Project.Application do
use Application
def start(_type, _args) do
children = [
randomchild1,
randomchild2,
{Project.runapp, "argument" }
]
opts = [strategy: :one_for_all, name: Project.Supervisor]
Supervisor.start_link(children, opts)
end
end
现在当我运行它时,我使用mix run --no-halt,它运行完美。
我想用我在命令行中传递的值替换“参数”?我不知道如何向mix run --no-halt 添加参数。
我要做的就是将一个值传递给 start 方法并使用它来定义子进程。
【问题讨论】:
-
@ChristopheDeTroyer 您链接的答案都不适用于
--no-halt。
标签: elixir elixir-mix erlang-supervisor elixir-iex