aboutsummaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
Diffstat (limited to 'src')
-rw-r--r--src/rcl_cmd_args.erl2
-rw-r--r--src/rcl_state.erl2
-rw-r--r--src/rcl_util.erl9
3 files changed, 9 insertions, 4 deletions
diff --git a/src/rcl_cmd_args.erl b/src/rcl_cmd_args.erl
index 973abe3..bfb63b7 100644
--- a/src/rcl_cmd_args.erl
+++ b/src/rcl_cmd_args.erl
@@ -121,7 +121,7 @@ validate_config("") ->
validate_config(Config) ->
case filelib:is_regular(Config) of
true ->
- filename:absname(Config);
+ {ok, filename:absname(Config)};
false ->
?RCL_ERROR({invalid_config_file, Config})
end.
diff --git a/src/rcl_state.erl b/src/rcl_state.erl
index 149b5ab..6fd5655 100644
--- a/src/rcl_state.erl
+++ b/src/rcl_state.erl
@@ -256,7 +256,7 @@ format(#state_t{log=LogState, output_dir=OutDir, lib_dirs=LibDirs,
[rcl_util:indent(Indent),
<<"state(">>, erlang:atom_to_list(Caller), <<"):\n">>,
rcl_util:indent(Indent + 1), <<"log: ">>, rcl_log:format(LogState), <<",\n">>,
- rcl_util:indent(Indent + 1), "config file: ", ConfigFile, "\n",
+ rcl_util:indent(Indent + 1), "config file: ", rcl_util:optional_to_string(ConfigFile), "\n",
rcl_util:indent(Indent + 1), "goals: \n",
[[rcl_util:indent(Indent + 2), rcl_depsolver:format_constraint(Goal), ",\n"] || Goal <- Goals],
rcl_util:indent(Indent + 1), "output_dir: ", OutDir, "\n",
diff --git a/src/rcl_util.erl b/src/rcl_util.erl
index 9cb20ac..61e1392 100644
--- a/src/rcl_util.erl
+++ b/src/rcl_util.erl
@@ -26,7 +26,8 @@
to_string/1,
is_error/1,
error_reason/1,
- indent/1]).
+ indent/1,
+ optional_to_string/1]).
-define(ONE_LEVEL_INDENT, " ").
%%============================================================================
@@ -73,7 +74,11 @@ is_error({error, _}) ->
is_error(_) ->
false.
-
+%% @doc convert optional argument to empty string if undefined
+optional_to_string(undefined) ->
+ "";
+optional_to_string(Value) when is_list(Value) ->
+ Value.
%%%===================================================================
%%% Test Functions