Add exclude option also from .proto/.options
diff --git a/generator/nanopb_generator.py b/generator/nanopb_generator.py
index 83264d9..d227863 100755
--- a/generator/nanopb_generator.py
+++ b/generator/nanopb_generator.py
@@ -1860,7 +1860,7 @@
 
     # List of .proto files that should not be included in the C header file
     # even if they are mentioned in the source .proto.
-    excludes = ['nanopb.proto', 'google/protobuf/descriptor.proto'] + options.exclude
+    excludes = ['nanopb.proto', 'google/protobuf/descriptor.proto'] + options.exclude + list(f.file_options.exclude)
     includes = [d for d in f.fdesc.dependency if d not in excludes]
 
     headerdata = ''.join(f.generate_header(includes, headerbasename, options))
diff --git a/generator/proto/nanopb.proto b/generator/proto/nanopb.proto
index 2480913..f0f4a1a 100644
--- a/generator/proto/nanopb.proto
+++ b/generator/proto/nanopb.proto
@@ -132,6 +132,10 @@
   // Extra files to include in generated `.pb.h`
   repeated string include = 24;
 
+  // Automatic includes to exlude from generated `.pb.h`
+  // Same as nanopb_generator.py command line flag -x.
+  repeated string exclude = 26;
+
   // Package name that applies only for nanopb.
   optional string package = 25;
 }