I am testing my erlang escript, the content of escriptis this:
#!/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").
But when I try to run the escript, I got this problem:
./escript start
escript: exception error: no case clause matching "start"
What caused this problem? Is the format of argument wrong?