Calling a function from command line

Richard Carlsson richardc@REDACTED
Sat Mar 4 11:46:15 CET 2006


Pupeno wrote:
> Hello,
> I am making a kind of script that generates documentation using edoc.
> I need to call edoc:files(["my", "list", "of", "files"], [{so, "me"}, {opt, 
> "ions"}]) but that can't be called from the shell itself, so, is there a 
> better way to do it than:
> 
> echo "edoc:files([\"my\", \"list\", \"of\", \"files\"], [{so, \"me\"}, {opt, 
> \"ions\"}])" | erl

Try this:

    erl -noshell -run edoc_run files '["my","list","of","files"]' \
      '[{opt, "ions"}]' -s init stop

But if you have organized your files as an application, i suggest:

    erl -noshell -run edoc_run application $APP '[{opt, "ions"}]' \
      -s init stop

Check the Makefile for edoc itself for a concrete usage example.

	/Richard



More information about the erlang-questions mailing list