diff options
author | Richard Jones <rjones@redhat.com> | 2009-04-13 10:33:44 +0100 |
---|---|---|
committer | Richard Jones <rjones@redhat.com> | 2009-04-13 10:33:44 +0100 |
commit | f968f6c36fda3bb66cd37cd56de250c29afa7698 (patch) | |
tree | 221cef644c2987862378efaaa0a9536483bb80aa /src | |
parent | b6722e6313e955ad0c1e4e4ec594c8e74cdd27af (diff) | |
download | libguestfs-f968f6c36fda3bb66cd37cd56de250c29afa7698.tar.gz libguestfs-f968f6c36fda3bb66cd37cd56de250c29afa7698.tar.xz libguestfs-f968f6c36fda3bb66cd37cd56de250c29afa7698.zip |
Stricter checks on short descriptions.
Diffstat (limited to 'src')
-rwxr-xr-x | src/generator.ml | 12 |
1 files changed, 11 insertions, 1 deletions
diff --git a/src/generator.ml b/src/generator.ml index 6792e07a..28e1cb62 100755 --- a/src/generator.ml +++ b/src/generator.ml @@ -890,7 +890,7 @@ the string C<,> (comma)."); ["mount"; "/dev/sda1"; "/"]; ["write_file"; "/new"; "new file contents"; "0"]; ["cat"; "/new"]], "new file contents")], - "Create a file", + "create a file", "\ This call creates a file called C<path>. The contents of the file is the string C<content> (which can contain any 8 bit data), @@ -1154,6 +1154,16 @@ let check_functions () = List.iter (fun arg -> check_arg_ret_name (name_of_argt arg)) (snd style) ) all_functions; + (* Check short descriptions. *) + List.iter ( + fun (name, _, _, _, _, shortdesc, _) -> + if shortdesc.[0] <> Char.lowercase shortdesc.[0] then + failwithf "short description of %s should begin with lowercase." name; + let c = shortdesc.[String.length shortdesc-1] in + if c = '\n' || c = '.' then + failwithf "short description of %s should not end with . or \\n." name + ) all_functions; + (* Check long dscriptions. *) List.iter ( fun (name, _, _, _, _, _, longdesc) -> |