【发布时间】:2017-05-30 07:42:18
【问题描述】:
我正在测试我的erlang escript,escript的内容是这样的:
#!/usr/bin/env escript
main([Action]) ->
case Action of
start -> start();
stop -> stop()
end;
main(_) ->
usage().
usage() ->
io:format("usage: factorial integer\n"),
halt(1).
start() -> io:format("Start.~n").
stop() -> io:format("Stop.~n").
但是当我尝试运行 escript 时,我遇到了这个问题:
./escript start
escript: exception error: no case clause matching "start"
是什么导致了这个问题?参数格式不对吗?
【问题讨论】: