diff options
author | Piotr Dorobisz <[email protected]> | 2011-03-09 12:46:42 +0100 |
---|---|---|
committer | Henrik Nord <[email protected]> | 2011-08-30 15:22:16 +0200 |
commit | 7611776d25dc13d8df13660e21c5b3c093e2b8c6 (patch) | |
tree | d13d0ce27874733d8d9f0ec5a2f1367bf3882240 | |
parent | 9810a1c6210c9c1319a15a5cc1d16713c9e18ab8 (diff) | |
download | otp-7611776d25dc13d8df13660e21c5b3c093e2b8c6.tar.gz otp-7611776d25dc13d8df13660e21c5b3c093e2b8c6.tar.bz2 otp-7611776d25dc13d8df13660e21c5b3c093e2b8c6.zip |
Allow single option when list is required
-rw-r--r-- | lib/observer/src/ttb.erl | 16 |
1 files changed, 11 insertions, 5 deletions
diff --git a/lib/observer/src/ttb.erl b/lib/observer/src/ttb.erl index 4764098e29..45cca218c4 100644 --- a/lib/observer/src/ttb.erl +++ b/lib/observer/src/ttb.erl @@ -98,8 +98,10 @@ do_tracer(Clients,PI,Traci) -> {ok,Succ} end. +opt(Opt) when is_list(Opt) -> + opt(Opt,{true,?MODULE,[]}); opt(Opt) -> - opt(Opt,{true,?MODULE,[]}). + opt([Opt]). opt([{process_info,PI}|O],{_,Client,Traci}) -> opt(O,{PI,Client,Traci}); @@ -494,7 +496,7 @@ no_store_write_trace_info(Key,What) -> %%% Stop tracing on all nodes stop() -> stop([]). -stop(Opts) -> +stop(Opts) when is_list(Opts) -> Fetch = stop_opts(Opts), Result = case whereis(?MODULE) of @@ -503,7 +505,9 @@ stop(Opts) -> ?MODULE ! {stop,Fetch,self()}, receive {?MODULE,R} -> R end end, - stop_return(Result,Opts). + stop_return(Result,Opts); +stop(Opts) -> + stop([Opts]). stop_opts(Opts) -> case {lists:member(format,Opts), lists:member(return, Opts)} of @@ -778,7 +782,7 @@ prepare(File,Handler) -> Handler1 = get_handler(Handler,Traci), {FileOrWrap,Traci,Handler1}. -format_opt(Opt) -> +format_opt(Opt) when is_list(Opt) -> Out = case lists:keysearch(out,1,Opt) of {value,{out,O}} -> O; _ -> standard_io @@ -787,7 +791,9 @@ format_opt(Opt) -> {value,{handler,H}} -> H; _ -> undefined end, - {Out,Handler}. + {Out,Handler}; +format_opt(Opt) -> + format_opt([Opt]). read_traci(File) -> |