mirror of
https://github.com/libguestfs/libguestfs.git
synced 2026-03-21 22:53:37 +00:00
generator: Make the 'this file is generated' warning clearer.
Also rename the ~extra_inputs parameter as plain ~inputs. We will use ~inputs more widely in following commit.
This commit is contained in:
@@ -67,8 +67,7 @@ type comment_style =
|
||||
| ErlangStyle | LuaStyle | PODStyle
|
||||
type license = GPLv2plus | LGPLv2plus
|
||||
|
||||
let generate_header ?(extra_inputs = []) ?emacs_mode comment license =
|
||||
let inputs = "generator/ *.ml" :: extra_inputs in
|
||||
let generate_header ?(inputs = []) ?emacs_mode comment license =
|
||||
let c = match comment with
|
||||
| CStyle -> pr "/* "; " *"
|
||||
| CPlusPlusStyle -> pr "// "; "//"
|
||||
@@ -84,8 +83,14 @@ let generate_header ?(extra_inputs = []) ?emacs_mode comment license =
|
||||
| Some mode -> pr " -*- %s -*-" mode
|
||||
);
|
||||
pr "\n";
|
||||
pr "%s WARNING: THIS FILE IS GENERATED FROM:\n" c;
|
||||
List.iter (pr "%s %s\n" c) inputs;
|
||||
if inputs <> [] then (
|
||||
pr "%s WARNING: THIS FILE IS GENERATED FROM THE FOLLOWING FILES:\n" c;
|
||||
List.iter (pr "%s %s\n" c) inputs;
|
||||
pr "%s and from the code in the generator/ subdirectory.\n" c
|
||||
) else (
|
||||
pr "%s WARNING: THIS FILE IS GENERATED\n" c;
|
||||
pr "%s from the code in the generator/ subdirectory.\n" c
|
||||
);
|
||||
pr "%s ANY CHANGES YOU MAKE TO THIS FILE WILL BE LOST.\n" c;
|
||||
pr "%s\n" c;
|
||||
pr "%s Copyright (C) %s Red Hat Inc.\n" c copyright_years;
|
||||
|
||||
@@ -31,4 +31,4 @@ val version_added : Types.action -> string option
|
||||
|
||||
val copyright_years : string
|
||||
|
||||
val generate_header : ?extra_inputs:string list -> ?emacs_mode:string -> comment_style -> license -> unit
|
||||
val generate_header : ?inputs:string list -> ?emacs_mode:string -> comment_style -> license -> unit
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
# libguestfs generated file
|
||||
# WARNING: THIS FILE IS GENERATED FROM:
|
||||
# generator/ *.ml
|
||||
# WARNING: THIS FILE IS GENERATED
|
||||
# from the code in the generator/ subdirectory.
|
||||
# ANY CHANGES YOU MAKE TO THIS FILE WILL BE LOST.
|
||||
#
|
||||
# Copyright (C) 2009-2016 Red Hat Inc.
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
# libguestfs generated file
|
||||
# WARNING: THIS FILE IS GENERATED FROM:
|
||||
# generator/ *.ml
|
||||
# WARNING: THIS FILE IS GENERATED
|
||||
# from the code in the generator/ subdirectory.
|
||||
# ANY CHANGES YOU MAKE TO THIS FILE WILL BE LOST.
|
||||
#
|
||||
# Copyright (C) 2009-2016 Red Hat Inc.
|
||||
|
||||
Reference in New Issue
Block a user