From fcad5fbe5359f887e18624972694487a505e35d9 Mon Sep 17 00:00:00 2001 From: Ryan Ofsky Date: Mon, 19 Sep 2022 14:41:35 -0400 Subject: [PATCH] doc: Fix mpgen usage string Also add comment to describe argument meanings. Problem with string was reported by Hennadii Stepanov <32963518+hebasto@users.noreply.github.com> https://github.com/chaincodelabs/libmultiprocess/pull/9#discussion_r973146130 --- src/mp/gen.cpp | 15 ++++++++++++++- 1 file changed, 14 insertions(+), 1 deletion(-) diff --git a/src/mp/gen.cpp b/src/mp/gen.cpp index 6c31310d..7c13ae00 100644 --- a/src/mp/gen.cpp +++ b/src/mp/gen.cpp @@ -110,6 +110,19 @@ bool BoxedType(const ::capnp::Type& type) type.isFloat64() || type.isEnum()); } +// src_file is path to .capnp file to generate stub code from. +// +// src_prefix can be used to generate outputs in a different directory than the +// source directory. For example if src_file is "/a/b/c/d/file.canp", and +// src_prefix is "/a/b", then output files will be "c/d/file.capnp.h" +// "c/d/file.capnp.cxx" "c/d/file.capnp.proxy.h", etc. This is equivalent to +// the capnp "--src-prefix" option (see "capnp help compile"). +// +// include_prefix can be used to control relative include paths used in +// generated files. For example if src_file is "/a/b/c/d/file.canp" and +// include_prefix is "/a/b/c" include lines like +// "#include " "#include "i +// will be generated. void Generate(kj::StringPtr src_prefix, kj::StringPtr include_prefix, kj::StringPtr src_file, @@ -594,7 +607,7 @@ void Generate(kj::StringPtr src_prefix, int main(int argc, char** argv) { if (argc < 3) { - fprintf(stderr, "Usage: " PROXY_BIN " SRC_PREFIX SRC_FILE [IMPORT_PATH...]\n"); + fprintf(stderr, "Usage: " PROXY_BIN " SRC_PREFIX INCLUDE_PREFIX SRC_FILE [IMPORT_PATH...]\n"); exit(1); } std::vector import_paths;