[Libguestfs] [PATCH 2/2] builder: output translated notes also in --notes
Richard W.M. Jones
rjones at redhat.com
Tue Mar 11 13:40:48 UTC 2014
On Tue, Mar 11, 2014 at 02:27:09PM +0100, Pino Toscano wrote:
> ---
> builder/builder.ml | 11 ++++++-----
> 1 file changed, 6 insertions(+), 5 deletions(-)
>
> diff --git a/builder/builder.ml b/builder/builder.ml
> index 1800f2d..274edfe 100644
> --- a/builder/builder.ml
> +++ b/builder/builder.ml
> @@ -215,11 +215,12 @@ let main () =
>
> (match mode with
> | `Notes -> (* --notes *)
> - (match entry with
> - | { Index_parser.notes = ("", notes) :: _ } ->
> - print_endline notes;
> - | { Index_parser.notes = _ :: _ }
> - | { Index_parser.notes = [] } ->
> + let notes =
> + Languages.find_notes (Languages.languages ()) entry.Index_parser.notes in
As a matter of style you can write these two lines as:
let notes =
let langs = Languages.languages () in
Languages.find_notes langs entry.Index_parser.notes in
> + (match notes with
> + | notes :: _ ->
> + print_endline notes
> + | [] ->
> printf (f_"There are no notes for %s\n") arg
> );
> exit 0
> --
ACK.
Rich.
--
Richard Jones, Virtualization Group, Red Hat http://people.redhat.com/~rjones
Read my programming blog: http://rwmj.wordpress.com
Fedora now supports 80 OCaml packages (the OPEN alternative to F#)
More information about the Libguestfs
mailing list