protoc_plugin README fixes and tweaks: (#617)
- Fix proto syntax
- Add `syntax = "proto3"` in proto examples. proto3 is used instead of
proto3 is newer. Removed `optional`s.
- Minor rewording
Fixes #208
diff --git a/protoc_plugin/README.md b/protoc_plugin/README.md
index 041732b..40996fd 100644
--- a/protoc_plugin/README.md
+++ b/protoc_plugin/README.md
@@ -64,7 +64,7 @@
## How to use
Once you have `protoc-gen-dart` in the `PATH` the protocol buffer compiler can
-be invoked like this:
+be invoked like this to generate Dart for the proto file `test.proto`:
$ protoc --dart_out=. test.proto
@@ -106,21 +106,25 @@
Say we have the file `m1.proto` with the following content
```proto
+syntax = "proto3";
+
message M1 {
- optional string a;
+ string a = 1;
}
```
and `m2.proto` containing
```proto
+syntax = "proto3";
+
message M2 {
- optional string b;
+ string b = 1;
}
```
Compiling these to Dart will produce two libraries in `m1.pb.dart` and
-`m2.pb.dart`. The following code shows a library M which combines
+`m2.pb.dart`. The following code shows a library `M` which combines
these two protocol buffer libraries, exposes the classes `M1` and `M2` and
adds some additional methods.