[glib] glib-mkenums: Add default comment template if none is provided
- From: Philip Withnall <pwithnall src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [glib] glib-mkenums: Add default comment template if none is provided
- Date: Thu, 19 Oct 2017 10:29:21 +0000 (UTC)
commit fcfbaf8566911a70434f876a9e76912f7db19dcd
Author: Philip Withnall <withnall endlessm com>
Date: Thu Oct 19 10:15:49 2017 +0100
glib-mkenums: Add default comment template if none is provided
The fallback code for providing a default comment template only worked
if a template file was provided. It didn’t work if individual templates
were provided on the command line (and --comment wasn’t).
Signed-off-by: Philip Withnall <withnall endlessm com>
https://bugzilla.gnome.org/show_bug.cgi?id=788990
gobject/glib-mkenums.in | 7 +++----
1 files changed, 3 insertions(+), 4 deletions(-)
---
diff --git a/gobject/glib-mkenums.in b/gobject/glib-mkenums.in
index 6f365c2..7cc5505 100755
--- a/gobject/glib-mkenums.in
+++ b/gobject/glib-mkenums.in
@@ -281,10 +281,6 @@ def read_template_file(file):
vtail = tmpl['value-tail']
comment_tmpl = tmpl['comment']
- # default to C-style comments
- if comment_tmpl == "":
- comment_tmpl = "/* \u0040comment\u0040 */"
-
parser = argparse.ArgumentParser(epilog=help_epilog,
formatter_class=argparse.RawDescriptionHelpFormatter)
@@ -366,6 +362,9 @@ vtail = vtail + ''.join([unescape_cmdline_args(x) for x in options.vtail])
if options.comment_tmpl != '':
comment_tmpl = unescape_cmdline_args(options.comment_tmpl)
+elif comment_tmpl == "":
+ # default to C-style comments
+ comment_tmpl = "/* \u0040comment\u0040 */"
output = options.output
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]