diff --git a/Makefile b/Makefile index f2b650b..8dabb02 100644 --- a/Makefile +++ b/Makefile @@ -3,25 +3,31 @@ ERL=erl ERLC=erlc -I include -v -o ebin SOURCES=src/*.erl EPATH=-pa ebin -DOC_OPTS={dir, \"doc\"}, {source_path, [\"include\", \"src\"]} +DOC_OPTS={dir, \"doc\"}, {includes, [\"include\"]}, {source_path, [\"include\", \"src\"]} all: @mkdir -p ebin $(ERL) $(EPATH) -make -run: +run: all $(ERL) -sname "$(PROJECT)" $(EPATH) test: all $(ERL) -noshell $(EPATH) -s $(PROJECT)_test test -s init stop -edoc: all +doc: all $(ERL) -noshell $(EPATH) \ - -eval "edoc:files([string:tokens(\"src/getopt.erl\", \" \")], [$(DOC_OPTS)])" \ + -eval "edoc:files(filelib:wildcard(\"$(SOURCES)\"), [$(DOC_OPTS)])" \ -s init stop - clean: + rm -fv ebin/*.beam + rm -fv erl_crash.dump ebin/erl_crash.dump + +distclean: rm -fv ebin/*.beam rm -fv doc/* rm -fv erl_crash.dump ebin/erl_crash.dump + +docclean: + rm -fv doc/* diff --git a/include/getopt.hrl b/include/getopt.hrl index bd43133..ebde3ce 100644 --- a/include/getopt.hrl +++ b/include/getopt.hrl @@ -1,16 +1,14 @@ -%%%------------------------------------------------------------------- -%%% @author Juan Jose Comellas -%%% @copyright (C) 2009, Novamens SA (http://www.novamens.com) -%%% @doc Records used by the getopt module. -%%%------------------------------------------------------------------- - -%% @doc Atom indicating the data type that an argument can be converted to. +%% @type getopt_arg_type() = 'atom' | 'binary' | 'bool' | 'float' | 'integer' | 'string'. +%% Atom indicating the data type that an argument can be converted to. -type getopt_arg_type() :: 'atom' | 'binary' | 'boolean' | 'float' | 'integer' | 'string'. -%% @doc Data type that an argument can be converted to. +%% @type getopt_arg() = atom() | binary() | bool() | float() | integer() | string(). +%% Data type that an argument can be converted to. -type getopt_arg() :: atom() | binary() | boolean() | float() | integer() | string(). -%% @@doc Argument specification. +%% @type getopt_arg_spec() = getopt_arg_type() | {getopt_arg_type(), getopt_arg()} | help | undefined. +%% Argument specification. -type getopt_arg_spec() :: getopt_arg_type() | {getopt_arg_type(), getopt_arg()} | help | undefined. +%% @doc Record that defines the option specifications. -record(option, { %% @doc Name of the option name :: atom(), diff --git a/src/getopt.erl b/src/getopt.erl index 0107c82..feed7f9 100644 --- a/src/getopt.erl +++ b/src/getopt.erl @@ -6,8 +6,8 @@ %%%------------------------------------------------------------------- -module(getopt). -%% @headerfile getopt.hrl -include("getopt.hrl"). +%% @headerfile "getopt.hrl" -define(TAB_LENGTH, 8). -define(HELP_INDENTATION, 4 * ?TAB_LENGTH).