Skip to content

Commit 7441069

Browse files
committed
Merge #80: doc: Fix mpgen usage string
fcad5fb doc: Fix mpgen usage string (Ryan Ofsky) Pull request description: Also add comment to describe argument meanings. Problem with string was reported by hebasto in #9 (comment) Top commit has no ACKs. Tree-SHA512: e92c67f3856b175c52471eb2ab3f0d42a98cae843b48e353d2d2be83621bc23eca9e316133b72e7006f63bfe8b4df5e5801859d28863ef94f2c2131b08a8801c
2 parents ddd2cee + fcad5fb commit 7441069

File tree

1 file changed

+14
-1
lines changed

1 file changed

+14
-1
lines changed

src/mp/gen.cpp

Lines changed: 14 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -110,6 +110,19 @@ bool BoxedType(const ::capnp::Type& type)
110110
type.isFloat64() || type.isEnum());
111111
}
112112

113+
// src_file is path to .capnp file to generate stub code from.
114+
//
115+
// src_prefix can be used to generate outputs in a different directory than the
116+
// source directory. For example if src_file is "/a/b/c/d/file.canp", and
117+
// src_prefix is "/a/b", then output files will be "c/d/file.capnp.h"
118+
// "c/d/file.capnp.cxx" "c/d/file.capnp.proxy.h", etc. This is equivalent to
119+
// the capnp "--src-prefix" option (see "capnp help compile").
120+
//
121+
// include_prefix can be used to control relative include paths used in
122+
// generated files. For example if src_file is "/a/b/c/d/file.canp" and
123+
// include_prefix is "/a/b/c" include lines like
124+
// "#include <d/file.capnp.proxy.h>" "#include <d/file.capnp.proxy-types.h>"i
125+
// will be generated.
113126
void Generate(kj::StringPtr src_prefix,
114127
kj::StringPtr include_prefix,
115128
kj::StringPtr src_file,
@@ -594,7 +607,7 @@ void Generate(kj::StringPtr src_prefix,
594607
int main(int argc, char** argv)
595608
{
596609
if (argc < 3) {
597-
fprintf(stderr, "Usage: " PROXY_BIN " SRC_PREFIX SRC_FILE [IMPORT_PATH...]\n");
610+
fprintf(stderr, "Usage: " PROXY_BIN " SRC_PREFIX INCLUDE_PREFIX SRC_FILE [IMPORT_PATH...]\n");
598611
exit(1);
599612
}
600613
std::vector<kj::StringPtr> import_paths;

0 commit comments

Comments
 (0)