Hi Seth,
I think you're right, $VERSION is something we should allow to be
specified in a custom option.
We have a couple of other things for which custom options might be
useful - for example, in
http://code.google.com/p/protobuf-perlxs/source/browse/trunk/examples/package/messages.proto
it would be nice if we could suppress generation of the .pm files for
each of the message types (One, Two, and Three), since they are not
needed. These both seem to be message-level options, but I'm sure we
can come up with many other options to provide users with better
control over the generated code.
We (protobuf-perlxs) have been allocated field number 1001 for custom
options in Protocol Buffers, so we have the ability to define these
options at the file, message, field, and other levels. I haven't
tried it yet, but Kenton Varda described to me how we could do this:
=====================================
OK, take field number 1001 for all options types. If you have
multiple options that apply to the same type you can group them
together into a message, e.g.:
package perlxs;
message FieldOptions {
optional int32 foo = 1;
optional string bar = 2;
}
extend google.protobuf.FieldOptions {
optional FieldOptions field_options = 1001;
}
// Elsewhere...
message Foo {
optional int32 a = 1 [perlxs.field_options.foo = 1,
perlxs.field_options.bar = "blah"];
}
==========================================
-dave