Added --keep-prefix to not strip schema include path in C++ includes.

Change-Id: I3c6356fc6664072796f273096df64829108b4a34
Tested: on Linux.
This commit is contained in:
Wouter van Oortmerssen
2017-05-10 13:21:20 -07:00
parent 04d734d6d2
commit 93c0960c3a
4 changed files with 10 additions and 2 deletions

View File

@@ -103,6 +103,7 @@ std::string FlatCompiler::GetUsageString(const char* program_name) const {
" PATH \n"
" --include-prefix Prefix this path to any generated include statements.\n"
" PATH\n"
" --keep-prefix Keep original prefix of schema include statement.\n"
" --no-fb-import Don't include flatbuffers import statement for TypeScript.\n"
" --no-ts-reexport Don't re-export imported dependencies for TypeScript.\n"
"FILEs may be schemas, or JSON files (conforming to preceding schema)\n"
@@ -155,6 +156,8 @@ int FlatCompiler::Compile(int argc, const char** argv) {
opts.include_prefix = argv[argi];
if (opts.include_prefix.back() != '/' &&
opts.include_prefix.back() != '\\') opts.include_prefix += "/";
} else if(arg == "--keep-prefix") {
opts.keep_include_path = true;
} else if(arg == "--strict-json") {
opts.strict_json = true;
} else if(arg == "--allow-non-utf8") {