Protobuf:如何在控制台上使用 --encode 命令

Protobuf: How to use the --encode command on console

当我使用 protoc 编译器的 --encode 命令时,我可以通过标准输入 (key:value) 输入我的输入,但它停留在输入模式。我从来没有得到任何结果。我如何获得它?

您必须按 Ctrl + D 才能发送传输结束字符。