diff options
author | Petteri Aimonen <jpa@git.mail.kapsi.fi> | 2014-07-20 14:56:12 +0300 |
---|---|---|
committer | Petteri Aimonen <jpa@git.mail.kapsi.fi> | 2014-07-20 14:56:12 +0300 |
commit | 1d7f60fec30678ec7403786808026444a4b901e6 (patch) | |
tree | da0708de343e04dcf4d5644cc60c44b1b27220c1 /generator | |
parent | 5749606f5d2f0a0c64cb6e021b7bd40b74ce45ee (diff) |
Add skip_message option to generator.
Update issue 121
Status: FixedInGit
Diffstat (limited to 'generator')
-rwxr-xr-x | generator/nanopb_generator.py | 4 | ||||
-rw-r--r-- | generator/proto/nanopb.proto | 3 |
2 files changed, 7 insertions, 0 deletions
diff --git a/generator/nanopb_generator.py b/generator/nanopb_generator.py index 8ef4f187..2d2071e1 100755 --- a/generator/nanopb_generator.py +++ b/generator/nanopb_generator.py @@ -639,6 +639,10 @@ def parse_file(fdesc, file_options): for names, message in iterate_messages(fdesc, base_name): message_options = get_nanopb_suboptions(message, file_options, names) + + if message_options.skip_message: + continue + messages.append(Message(names, message, message_options)) for enum in message.enum_type: enum_options = get_nanopb_suboptions(enum, message_options, names + enum.name) diff --git a/generator/proto/nanopb.proto b/generator/proto/nanopb.proto index 2be2f803..9a4d6578 100644 --- a/generator/proto/nanopb.proto +++ b/generator/proto/nanopb.proto @@ -37,6 +37,9 @@ message NanoPBOptions { // Note: this cannot be used on CPUs that break on unaligned // accesses to variables. optional bool packed_struct = 5 [default = false]; + + // Skip this message + optional bool skip_message = 6 [default = false]; } // Extensions to protoc 'Descriptor' type in order to define options |