Add option to not add timestamps to .pb.h and .pb.c preambles.
Patch by rusnakp. Update issue 115 Status: FixedInGit
This commit is contained in:
@@ -707,7 +707,10 @@ def generate_header(dependencies, headername, enums, messages, extensions, optio
|
|||||||
'''
|
'''
|
||||||
|
|
||||||
yield '/* Automatically generated nanopb header */\n'
|
yield '/* Automatically generated nanopb header */\n'
|
||||||
yield '/* Generated by %s at %s. */\n\n' % (nanopb_version, time.asctime())
|
if options.notimestamp:
|
||||||
|
yield '/* Generated by %s */\n\n' % (nanopb_version)
|
||||||
|
else:
|
||||||
|
yield '/* Generated by %s at %s. */\n\n' % (nanopb_version, time.asctime())
|
||||||
|
|
||||||
symbol = make_identifier(headername)
|
symbol = make_identifier(headername)
|
||||||
yield '#ifndef _PB_%s_\n' % symbol
|
yield '#ifndef _PB_%s_\n' % symbol
|
||||||
@@ -780,7 +783,10 @@ def generate_source(headername, enums, messages, extensions, options):
|
|||||||
'''Generate content for a source file.'''
|
'''Generate content for a source file.'''
|
||||||
|
|
||||||
yield '/* Automatically generated nanopb constant definitions */\n'
|
yield '/* Automatically generated nanopb constant definitions */\n'
|
||||||
yield '/* Generated by %s at %s. */\n\n' % (nanopb_version, time.asctime())
|
if options.notimestamp:
|
||||||
|
yield '/* Generated by %s */\n\n' % (nanopb_version)
|
||||||
|
else:
|
||||||
|
yield '/* Generated by %s at %s. */\n\n' % (nanopb_version, time.asctime())
|
||||||
yield options.genformat % (headername)
|
yield options.genformat % (headername)
|
||||||
yield '\n'
|
yield '\n'
|
||||||
|
|
||||||
@@ -963,6 +969,8 @@ optparser.add_option("-Q", "--generated-include-format", dest="genformat",
|
|||||||
optparser.add_option("-L", "--library-include-format", dest="libformat",
|
optparser.add_option("-L", "--library-include-format", dest="libformat",
|
||||||
metavar="FORMAT", default='#include <%s>\n',
|
metavar="FORMAT", default='#include <%s>\n',
|
||||||
help="Set format string to use for including the nanopb pb.h header. [default: %default]")
|
help="Set format string to use for including the nanopb pb.h header. [default: %default]")
|
||||||
|
optparser.add_option("-T", "--no-timestamp", dest="notimestamp", action="store_true", default=False,
|
||||||
|
help="Don't add timestamp to .pb.h and .pb.c preambles")
|
||||||
optparser.add_option("-q", "--quiet", dest="quiet", action="store_true", default=False,
|
optparser.add_option("-q", "--quiet", dest="quiet", action="store_true", default=False,
|
||||||
help="Don't print anything except errors.")
|
help="Don't print anything except errors.")
|
||||||
optparser.add_option("-v", "--verbose", dest="verbose", action="store_true", default=False,
|
optparser.add_option("-v", "--verbose", dest="verbose", action="store_true", default=False,
|
||||||
|
|||||||
Reference in New Issue
Block a user