From 0fce2f1ffcf34643dcd374f790eac41fcc9e324b Mon Sep 17 00:00:00 2001 From: "Benjamin A. Beasley" Date: Tue, 6 Dec 2022 09:31:01 -0500 Subject: [PATCH] Add a man page for protoc --- protobuf.spec | 9 +++ protoc.1 | 193 ++++++++++++++++++++++++++++++++++++++++++++++++++ 2 files changed, 202 insertions(+) create mode 100644 protoc.1 diff --git a/protobuf.spec b/protobuf.spec index c001428..b0c58a2 100644 --- a/protobuf.spec +++ b/protobuf.spec @@ -61,6 +61,10 @@ Source2: protobuf-init.el # For tests (using exactly the same version as the release) Source3: %{gtest_url}/archive/%{gtest_commit}/%{gtest_dir}.tar.gz +# Man page hand-written for Fedora in groff_man(7) format based on “protoc +# --help” output. +Source4: protoc.1 + # https://github.com/protocolbuffers/protobuf/issues/8082 Patch1: protobuf-3.14-disable-IoTest.LargeOutput.patch # Disable tests that are failing on 32bit systems @@ -378,6 +382,9 @@ fail=1 %make_install %{?_smp_mflags} STRIPBINARIES=no INSTALL="%{__install} -p" CPPROG="cp -p" find %{buildroot} -type f -name "*.la" -exec rm -f {} + +# protoc.1 man page +install -p -m 0644 -D -t '%{buildroot}%{_mandir}/man1' '%{SOURCE4}' + %if %{with python} pushd python %py3_install %{?with_python_cpp:-- --cpp_implementation} @@ -408,6 +415,7 @@ install -p -m 0644 %{SOURCE2} %{buildroot}%{_emacs_sitestartdir} %doc README.md %license LICENSE %{_bindir}/protoc +%{_mandir}/man1/protoc.1* %{_libdir}/libprotoc.so.30* %files devel @@ -498,6 +506,7 @@ install -p -m 0644 %{SOURCE2} %{buildroot}%{_emacs_sitestartdir} - Ensure all subpackages always have LICENSE, or depend on something that does - Remove obsolete ldconfig_scriptlets macros - The -vim subpackage now depends on vim-filesystem, no longer on vim-enhanced +- Add a man page for protoc * Sun Aug 14 2022 Orion Poplawski - 3.19.4-6 - Build python support with C++ (bz#2107921) diff --git a/protoc.1 b/protoc.1 new file mode 100644 index 0000000..71e0bd5 --- /dev/null +++ b/protoc.1 @@ -0,0 +1,193 @@ +.TH protoc "1" "December 2022" protoc "User Commands" +.SH NAME +protoc \- Protobuf compiler +.SH SYNOPSIS +protoc +.RI [ OPTION ] +.I PROTO_FILES +.SH DESCRIPTION +.PP +Parse +.I PROTO_FILES +and generate output based on the options given. +.SH OPTIONS +.TP +.B \-I\fIPATH\fR, \fB\-\-proto_path=\fIPATH +Specify the directory in which to search for imports. +May be specified multiple times; directories will be searched in order. +If not given, the current working directory is used. +If not found in any of the these directories, the +.B \-\-descriptor_set_in +descriptors will be checked for required proto file. +.TP +.B \-\-version +Show version info and exit. +.TP +.B \-h\fR, \fB\-\-help +Show a help message and exit. +.TP +.BI \-\-encode= MESSAGE_TYPE +Read a text-format message of the given type +from standard input and write it in binary +to standard output. +The message type must be defined in +.I PROTO_FILES +or their imports. +.TP +.B \-\-deterministic_output +When using +.BR \-\-encode , +ensure map fields are deterministically ordered. +Note that this order is not canonical, +and changes across builds or releases of +.BR protoc (1). +.TP +.BI \-\-decode= MESSAGE_TYPE +Read a binary message of the given type +from standard input and write it in text format +to standard output. +The message type must be defined in +.I PROTO_FILES +or their imports. +.TP +.B \-\-decode_raw +Read an arbitrary protocol message +from standard input and write the raw tag/value pairs in text format +to standard output. +No +.I PROTO_FILES +should be given when using this flag. +.TP +.BI \-\-descriptor_set_in= FILES +Specifies a delimited list of +.I FILES +each containing a +.B FileDescriptorSet +(a protocol buffer defined in +.BR descriptor.proto ). +The +.B FileDescriptor +for each of the +.I PROTO_FILES +provided will be loaded from these +.BR FileDescriptorSets . +If a +.B FileDescriptor +appears multiple times, the first occurrence will be used. +.TP +.B \-o\fIFILE\fR, \fB\-\-descriptor_set_out=\fIFILE +Writes a +.B FileDescriptorSet +(a protocol buffer, defined in +.BR descriptor.proto ) +containing all of the input files to +.IR FILE . +.TP +.B \-\-include_imports +When using +.BR \-\-descriptor_set_out , +also include all dependencies of the input files in the set, +so that the set is self-contained. +.TP +.B \-\-include_source_info +When using +.BR \-\-descriptor_set_out , +do not strip +.B SourceCodeInfo +from the +.BR FileDescriptorProto . +This results in vastly larger descriptors +that include information about the original location +of each decl in the source file +as well as surrounding comments. +.TP +.BI \-\-dependency_out= FILE +Write a dependency output file in the format expected by +.BR make (1). +This writes the transitive set of input file paths to +.I FILE +.TP +.BI \-\-error_format= FORMAT +Set the format in which to print errors. +.I FORMAT +may be +.RB \(oq gcc \(cq +(the default) or +.RP \(oq msvs \(cq +(Microsoft Visual Studio format). +.TP +.B \-\-fatal_warnings +Make warnings be fatal (similar to +.B \-Werr +in +.BR gcc (1)). +This flag will make +.BR protoc (1) + return with a non-zero exit code +if any warnings are generated. +.TP +.B \-\-print_free_field_numbers +Print the free field numbers of the messages +defined in the given proto files. +Groups share the same field number space with the parent message. +Extension ranges are counted as occupied fields numbers. +.TP +.BI \-\-plugin= EXECUTABLE +Specifies a plugin executable to use. +Normally, +.BR protoc (1) +searches the +.B PATH +for plugins, but you may specify additional executables +not in the path using this flag. +Additionally, +.I EXECUTABLE +may be of the form +.BR NAME=\fIPATH , +in which case the given plugin name +is mapped to the given executable +even if the executable\(cqs own name differs. +.TP +.BI \-\-cpp_out= OUT_DIR +Generate C++ header and source. +.TP +.BI \-\-csharp_out= OUT_DIR +Generate C# source file. +.TP +.BI \-\-java_out= OUT_DIR +Generate Java source file. +.TP +.BI \-\-js_out= OUT_DIR +Generate JavaScript source. +.TP +.BI \-\-kotlin_out= OUT_DIR +Generate Kotlin file. +.TP +.BI \-\-objc_out= OUT_DIR +Generate Objective-C header and source. +.TP +.BI \-\-php_out= OUT_DIR +Generate PHP source file. +.TP +.BI \-\-python_out= OUT_DIR +Generate Python source file. +.TP +.BI \-\-ruby_out= OUT_DIR +Generate Ruby source file. +.TP +.BI @ +Read options and filenames from file. +If a relative file path is specified, +the file will be searched in the working directory. +The +.B \-\-proto_path +option will not affect how this argument file is searched. +Content of the file will be expanded in the position of +.BI @ +as in the argument list. +Note that shell expansion is not applied to the content of the file +(i.e., you cannot use quotes, wildcards, escapes, commands, etc.). +Each line corresponds to a single argument, even if it contains spaces. +.SH "SEE ALSO" +.BR make (1), +.BR gcc (1)