diff options
author | Anders Svensson <[email protected]> | 2011-10-14 10:01:22 +0200 |
---|---|---|
committer | Anders Svensson <[email protected]> | 2011-10-17 12:26:47 +0200 |
commit | 1327c7c7d098a7593e5458bc5c06fd9459e73de3 (patch) | |
tree | af9bd2595a5dd59193869740e0cdd9d4a3b01c80 /lib/diameter/bin | |
parent | d8ec8f4f35707581fa55f4e97fc8264b7adf0cab (diff) | |
download | otp-1327c7c7d098a7593e5458bc5c06fd9459e73de3.tar.gz otp-1327c7c7d098a7593e5458bc5c06fd9459e73de3.tar.bz2 otp-1327c7c7d098a7593e5458bc5c06fd9459e73de3.zip |
Allow @name/@prefix to be set with diameterc
Diffstat (limited to 'lib/diameter/bin')
-rwxr-xr-x | lib/diameter/bin/diameterc | 28 |
1 files changed, 19 insertions, 9 deletions
diff --git a/lib/diameter/bin/diameterc b/lib/diameter/bin/diameterc index e232cdb120..c4dbd0060f 100755 --- a/lib/diameter/bin/diameterc +++ b/lib/diameter/bin/diameterc @@ -33,19 +33,23 @@ usage() -> io:format( - "~w [options] file~n" + "~w [options] dict~n" "~n" " Compile a diameter dictionary file (.dia) to Erlang source (.erl)~n" " and/or header (.hrl) files.~n" "~n" " options:~n" - " -h = print this message~n" - " -v = verbose output~n" - " -o dir = set the output directory (default .)~n" - " -i dir = set an include directory for inherited beams~n" - " -E = no .erl output~n" - " -H = no .hrl output~n" - " -d = write intermediate files (.spec and .forms)~n", + "~n" + " --name name = set @name~n" + " --prefix prefix = set @prefix~n" + "~n" + " -h = print this message~n" + " -v = verbose output~n" + " -o dir = set the output directory (default .)~n" + " -i dir = set an include directory for inherited beams~n" + " -E = no .erl output~n" + " -H = no .hrl output~n" + " -d = write intermediate files (.spec and .forms)~n", [?MODULE]). main(Args) -> @@ -112,6 +116,12 @@ arg(["-i", Dir | Args], #argv{options = Opts} = A) -> true = dir_exists(Dir), arg(Args, A#argv{options = Opts ++ [{include, Dir}]}); +arg(["--name", Name | Args], #argv{options = Opts} = A) -> + arg(Args, A#argv{options = [{name, Name} | Opts]}); + +arg(["--prefix", Name | Args], #argv{options = Opts} = A) -> + arg(Args, A#argv{options = [{prefix, Name} | Opts]}); + arg(["-E" | Args], #argv{output = Output} = A) -> arg(Args, A#argv{output = lists:delete(erl, Output)}); @@ -123,7 +133,7 @@ arg(["-d" | Args], #argv{options = Opts, output = Output} = A) -> output = [spec | Output]}); arg([[$- = M, C, H | T] | Args], A) %% clustered options - when C /= $i, C /= $o -> + when C /= $i, C /= $o, C /= $- -> arg([[M,C], [M,H|T] | Args], A); arg([File], A) -> |