Skip to content

Commit

Permalink
Added first command line command 'spec'
Browse files Browse the repository at this point in the history
  • Loading branch information
yrashk committed Jan 25, 2011
1 parent 42cdcbc commit a456125
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 2 deletions.
4 changes: 3 additions & 1 deletion rebar.config
Original file line number Original file line Diff line number Diff line change
@@ -1,5 +1,7 @@
{compile_post_script, "./scripts/escriptize"}. {compile_post_script, "./scripts/escriptize"}.
{escript_incl_apps,[getopt]}.
{deps, [ {deps, [
{typespecs, "0.1", {git, "git://github.com/spawngrid/typespecs.git", {typespecs, "0.1", {git, "git://github.com/spawngrid/typespecs.git",
"HEAD"}} "HEAD"}},
{getopt, "0.3.0", {git, "git://github.com/agner/getopt.git", "HEAD"}}
]}. ]}.
7 changes: 6 additions & 1 deletion src/agner.erl
Original file line number Original file line Diff line number Diff line change
Expand Up @@ -16,8 +16,13 @@ stop() ->
inets:stop(), inets:stop(),
ssl:stop(). ssl:stop().


main(_) -> main(["spec"|Args]) ->
OptSpec = [
{package, undefined, undefined, string, "Package name"}
],
start(), start(),
{ok, {Opts, _}} = getopt:parse(OptSpec, Args),
io:format("~p~n",[spec(proplists:get_value(package, Opts))]),
stop(). stop().


%%%=================================================================== %%%===================================================================
Expand Down

0 comments on commit a456125

Please sign in to comment.