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
This commit is contained in:
Philip Withnall 2017-10-19 10:15:49 +01:00
parent 37c0610b4d
commit fcfbaf8566

View File

@ -281,10 +281,6 @@ def read_template_file(file):
vtail = tmpl['value-tail'] vtail = tmpl['value-tail']
comment_tmpl = tmpl['comment'] comment_tmpl = tmpl['comment']
# default to C-style comments
if comment_tmpl == "":
comment_tmpl = "/* \u0040comment\u0040 */"
parser = argparse.ArgumentParser(epilog=help_epilog, parser = argparse.ArgumentParser(epilog=help_epilog,
formatter_class=argparse.RawDescriptionHelpFormatter) formatter_class=argparse.RawDescriptionHelpFormatter)
@ -366,6 +362,9 @@ vtail = vtail + ''.join([unescape_cmdline_args(x) for x in options.vtail])
if options.comment_tmpl != '': if options.comment_tmpl != '':
comment_tmpl = unescape_cmdline_args(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 output = options.output