summaryrefslogtreecommitdiffstats
path: root/docs/concepts.rst
diff options
context:
space:
mode:
authorPetteri Aimonen <jpa@git.mail.kapsi.fi>2012-10-29 19:33:33 +0200
committerPetteri Aimonen <jpa@git.mail.kapsi.fi>2012-10-29 19:33:33 +0200
commitad9a885644d0c3e61eecd796ea227edded96a2b5 (patch)
treea1cb60ca573f7ab34919c8ecec94cb3eeb62d1e8 /docs/concepts.rst
parent08391f35eeeac9583c9ae5010e5e37ca2a5bc0a4 (diff)
Document new generator options
Diffstat (limited to 'docs/concepts.rst')
-rw-r--r--docs/concepts.rst14
1 files changed, 14 insertions, 0 deletions
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
=======