Permalink
Browse files

Added first command line command 'spec'

  • Loading branch information...
1 parent 42cdcbc commit a4561259113c186df3d84ccc59e0ad5a8a941c04 @yrashk yrashk committed Jan 25, 2011
Showing with 9 additions and 2 deletions.
  1. +3 −1 rebar.config
  2. +6 −1 src/agner.erl
View
@@ -1,5 +1,7 @@
{compile_post_script, "./scripts/escriptize"}.
+{escript_incl_apps,[getopt]}.
{deps, [
{typespecs, "0.1", {git, "git://github.com/spawngrid/typespecs.git",
- "HEAD"}}
+ "HEAD"}},
+ {getopt, "0.3.0", {git, "git://github.com/agner/getopt.git", "HEAD"}}
]}.
View
@@ -16,8 +16,13 @@ stop() ->
inets:stop(),
ssl:stop().
-main(_) ->
+main(["spec"|Args]) ->
+ OptSpec = [
+ {package, undefined, undefined, string, "Package name"}
+ ],
start(),
+ {ok, {Opts, _}} = getopt:parse(OptSpec, Args),
+ io:format("~p~n",[spec(proplists:get_value(package, Opts))]),
stop().
%%%===================================================================

0 comments on commit a456125

Please sign in to comment.