From 0adfa70abbd4823ecc23cbbec8d1b45857c70f20 Mon Sep 17 00:00:00 2001 From: Vyacheslav Vorobyov Date: Fri, 18 Sep 2015 14:19:13 +0300 Subject: [PATCH 1/2] Atom to_string clause. Required for 'true', 'false' in particular. --- src/cuttlefish_datatypes.erl | 1 + 1 file changed, 1 insertion(+) diff --git a/src/cuttlefish_datatypes.erl b/src/cuttlefish_datatypes.erl index f79779ea..2bf70860 100644 --- a/src/cuttlefish_datatypes.erl +++ b/src/cuttlefish_datatypes.erl @@ -160,6 +160,7 @@ to_string(Bytesize, bytesize) when is_list(Bytesize) -> Bytesize; to_string(Bytesize, bytesize) when is_integer(Bytesize) -> cuttlefish_bytesize:to_string(Bytesize); to_string(String, string) when is_list(String) -> String; +to_string(Atom, string) when is_atom(Atom) -> atom_to_list(Atom); to_string(File, file) when is_list(File) -> File; From d6a6188daa9bf608051c4e31125021dc8197fc91 Mon Sep 17 00:00:00 2001 From: Vyacheslav Vorobyov Date: Fri, 18 Sep 2015 14:20:46 +0300 Subject: [PATCH 2/2] Use ~p when formatting comment to see an error in comments. --- src/cuttlefish_conf.erl | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/cuttlefish_conf.erl b/src/cuttlefish_conf.erl index f22121df..79ef12dd 100644 --- a/src/cuttlefish_conf.erl +++ b/src/cuttlefish_conf.erl @@ -146,7 +146,7 @@ generate_comments(M) -> Default = case cuttlefish_mapping:default(M) of undefined -> []; Other -> - [ "", ?FMT("Default: ~s", [cuttlefish_datatypes:to_string(Other, DefaultDT)]) ] + [ "", ?FMT("Default: ~p", [cuttlefish_datatypes:to_string(Other, DefaultDT)]) ] end, Datatypes = ["", "Acceptable values:" |