For proto_path, is this starting from the top level of the program folder
--proto_path
is where the proto files exist that you want converted to cs files. This is relative to the protoc executable but may also be set to a specific location, e.g. --proto_path="C:/myprotofiles/"
What is the 'bar' option, is it always 'src'?
"bar" isn't an option. "foo" and "bar" are commonly used as placeholders when giving generic instructions (https://en.wikipedia.org/wiki/Foobar)
What is the 'src' option, is it always 'build/gen'?
src is not an option. src is a placeholder for a directory. You will replace "src" with the directory containing your proto files.
--csharp_out is where you want the output C# files to go. This is also relative to the protoc executable but may also be set to a specific location, e.g. --csharp_out="C:/mycsfiles/"
Is this copiable? '--csharp_opt=file_extension=.g.cs,base_namespace=MyProgram src/MyProtoFile.proto'
I'm not quite sure of your question here. This is two parts.
--csharp_opt sets options. This example is setting a file_extension to .g.cs (so output files will be somecsfile.g.cs) and also setting a base_namespace to "MyProgram" so all classes generated will be in a namespace called MyProgram.
"src/MyProtoFile.proto," or "src/foo.proto" in Google's example, is a proto file in the /src directory. In our example we would replace this with "c:/myprotofiles/myprotofile.proto"
So, we'd have:
protoc --proto_path="C:/myprotofiles/" --csharp_out="C:/mycsfiles/" --csharp_opt=file_extension=.g.cs,base_namespace=MyProtoFileNamespace "c:/myprotofiles/myprotofile.proto"
Setting explicit paths isn't necessary but hopefully clarifies things (at least for Windows users!)