From ad9a885644d0c3e61eecd796ea227edded96a2b5 Mon Sep 17 00:00:00 2001 From: Petteri Aimonen Date: Mon, 29 Oct 2012 19:33:33 +0200 Subject: Document new generator options --- docs/concepts.rst | 14 ++++++++++++++ 1 file changed, 14 insertions(+) (limited to 'docs/concepts.rst') diff --git a/docs/concepts.rst b/docs/concepts.rst index 355af25e..b18c5057 100644 --- a/docs/concepts.rst +++ b/docs/concepts.rst @@ -38,6 +38,20 @@ This file, in turn, requires the file *google/protobuf/descriptor.proto*. This i protoc -I/usr/include -Inanopb/generator -I. -omessage.pb message.proto +The options can be defined in file, message and field scopes:: + + option (nanopb_fileopt).max_size = 20; // File scope + message Message + { + option (nanopb_msgopt).max_size = 30; // Message scope + required string fieldsize = 1 [(nanopb).max_size = 40]; // Field scope + } + +It is also possible to give the options on command line, but then they will affect the whole file. For example:: + + user@host:~$ python ../generator/nanopb_generator.py -s 'max_size: 20' message.pb + + Streams ======= -- cgit 1.2.3-korg