[tools] gen_settings: error if a handler but no module attribute is specified

previously it just silently ignored the handler, which is really really bad!
This commit is contained in:
Felix Ruess
2012-08-05 13:36:22 +02:00
parent ffd52c72a7
commit 090fb935c4
+8 -3
View File
@@ -81,9 +81,14 @@ let print_dl_settings = fun settings ->
let v = ExtXml.attrib s "var" in
begin
try
let h = ExtXml.attrib s "handler" and
m = ExtXml.attrib s "module" in
lprintf "case %d: %s_%s( _value ); _value = %s; break;\\\n" !idx (Filename.basename m) h v
let h = ExtXml.attrib s "handler" in
begin
try
let m = ExtXml.attrib s "module" in
lprintf "case %d: %s_%s( _value ); _value = %s; break;\\\n" !idx (Filename.basename m) h v
with
ExtXml.Error e -> prerr_endline (sprintf "Error: You need to specify the module attribute for setting %s to use the handler %s" v h); exit 1
end;
with
ExtXml.Error e -> lprintf "case %d: %s = _value; break;\\\n" !idx v
end;