mirror of
https://github.com/tldr-pages/tldr.git
synced 2025-04-22 08:02:08 +02:00
protoc: add page for Google Protobuf (#1698)
This commit is contained in:
parent
c9b73510db
commit
43faabe027
1 changed files with 15 additions and 0 deletions
15
pages/common/protoc.md
Normal file
15
pages/common/protoc.md
Normal file
|
@ -0,0 +1,15 @@
|
||||||
|
# protoc
|
||||||
|
|
||||||
|
> Parse Google Protobuf `.proto` files and generate output in the specified language.
|
||||||
|
|
||||||
|
- Generate Python code from a `.proto` file:
|
||||||
|
|
||||||
|
`protoc --python_out={{path/to/output_directory}} {{input_file.proto}}`
|
||||||
|
|
||||||
|
- Generate Java code from a `.proto` file that imports other `.proto` files:
|
||||||
|
|
||||||
|
`protoc --java_out={{path/to/output_directory}} --proto_path={{path/to/import_search_path}} {{input_file.proto}}`
|
||||||
|
|
||||||
|
- Generate code for multiple languages:
|
||||||
|
|
||||||
|
`protoc --csharp_out={{path/to/c#_output_directory}} --js_out={{path/to/js_output_directory}} {{input_file.proto}}`
|
Loading…
Add table
Reference in a new issue