Skip to content

Commit

Permalink
update main
Browse files Browse the repository at this point in the history
  • Loading branch information
gabrielegenovese committed Jan 29, 2025
1 parent 4e96612 commit 08ae1c5
Showing 1 changed file with 17 additions and 4 deletions.
21 changes: 17 additions & 4 deletions src/chorer.erl
Original file line number Diff line number Diff line change
Expand Up @@ -9,8 +9,12 @@
-module(chorer).
-include("share/common_data.hrl").

-define(DEFOUTPUT, ".").
-define(DEFMINL, true).
-define(DEFMING, false).

%%% API
-export([main/1, generate/5]).
-export([main/1, generate/2, generate/5]).

%%%===================================================================
%%% API
Expand All @@ -26,9 +30,9 @@ cli() ->
arguments => [
#{name => input, type => string, help => "Erlang soure file"},
#{name => entrypoint, type => {atom, unsafe}, help => "Entrypoint of the program"},
#{name => output, type => string, default => ".", help => "Output directory for the generated dot files"},
#{name => minl, type => boolean, default => true, help => "Minimize the localviews"},
#{name => ming, type => boolean, default => false, help => "Minimize the globalviews"}
#{name => output, type => string, default => ?DEFOUTPUT, help => "Output directory for the generated dot files"},
#{name => minl, type => boolean, default => ?DEFMINL, help => "Minimize the localviews"},
#{name => ming, type => boolean, default => ?DEFMING, help => "Minimize the globalviews"}
],
help=> """
Extract a choreography automata of an Erlang program.
Expand All @@ -47,6 +51,15 @@ cli() ->
end
}.


%%% @doc
%%% Used within the Erlang shell (call generate/5).
-spec generate(InputFile, EntryPoint) -> atom() when
InputFile :: string(),
EntryPoint :: atom().
generate(InputFile, EntryPoint) ->
generate(InputFile, EntryPoint, ?DEFOUTPUT, ?DEFMINL, ?DEFMINL).

%%% @doc
%%% Generate the localviews and the globalview specifing the output directory.
%%% It initialize the ets tables and generates the localviews and globalview.
Expand Down

0 comments on commit 08ae1c5

Please sign in to comment.