-
Notifications
You must be signed in to change notification settings - Fork 3
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
pb: Preload well-known types, remove -D flag
Pre-load all the well-known types in `google.golang.org/protobuf/types` so they do not need to be present in a protoset. This allows us to remove the `-D` flag that decodes the input as a `FileDescriptorSet` replacing it with requiring that the message type `FileDescriptorSet` be present on the command line. e.g. protoc -o/dev/stdout foo.proto | pb -Ip FileDescriptorSet This makes pb a little more flexible in that any of the well-known types can be decoded without needing them described in a protoset, rather than just `FileDescriptorSet`. A planned later change to allow message name aliases should make this simpler by allowing `fds` to be used as the message type instead of the more verbose `FileDescriptorSet`. Another planned change to detect binary input data as the binary protobuf format means soon the above command could be expressed as: protoc -o/dev/stdout foo.proto | pb fds
- Loading branch information
Showing
2 changed files
with
87 additions
and
110 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters