X-Git-Url: http://git.annexia.org/?p=libguestfs.git;a=blobdiff_plain;f=generator%2Fgenerator_checks.ml;h=8ee06b59497e0315ef3e9c4783165c806e9e357f;hp=347404703b4eaa2371551a6dbc22346448861b93;hb=527079aa0db9b608ee4c25e7b3eccc4058685608;hpb=14490c3e1aac61c6ac90f28828896683f64f0dc9 diff --git a/generator/generator_checks.ml b/generator/generator_checks.ml index 3474047..8ee06b5 100644 --- a/generator/generator_checks.ml +++ b/generator/generator_checks.ml @@ -129,6 +129,19 @@ let () = ) optargs ) all_functions; + (* Some parameter types not supported for daemon functions. *) + List.iter ( + fun (name, (_, args, optargs), _, _, _, _, _) -> + let check_arg_type = function + | Pointer _ -> + failwithf "Pointer is not supported for daemon function %s." + name + | _ -> () + in + List.iter check_arg_type args; + List.iter check_arg_type optargs; + ) daemon_functions; + (* Check short descriptions. *) List.iter ( fun (name, _, _, _, _, shortdesc, _) -> @@ -175,6 +188,38 @@ let () = in loop proc_nrs; + (* Check flags. *) + List.iter ( + fun (name, _, _, flags, _, _, _) -> + List.iter ( + function + | ProtocolLimitWarning + | DangerWillRobinson + | FishOutput _ + | NotInFish + | NotInDocs + | Progress -> () + | FishAlias n -> + if contains_uppercase n then + failwithf "%s: guestfish alias %s should not contain uppercase chars" name n; + if String.contains n '_' then + failwithf "%s: guestfish alias %s should not contain '_'" name n + | DeprecatedBy n -> + (* 'n' must be a cross-ref to the name of another action. *) + if not (List.exists ( + function + | (n', _, _, _, _, _, _) when n = n' -> true + | _ -> false + ) all_functions) then + failwithf "%s: DeprecatedBy flag must be cross-reference to another action" name + | Optional n -> + if contains_uppercase n then + failwithf "%s: Optional group name %s should not contain uppercase chars" name n; + if String.contains n '-' || String.contains n '_' then + failwithf "%s: Optional group name %s should not contain '-' or '_'" name n + ) flags + ) (all_functions @ fish_commands); + (* Check tests. *) List.iter ( function