From dcc0743969fcc65db56243cf11e607ab03d3844e Mon Sep 17 00:00:00 2001 From: Matthias Koefferlein Date: Sun, 23 Aug 2020 21:13:02 +0200 Subject: [PATCH] Buddies: added option to concatenate files with '+' --- src/buddies/src/bd/bdConverterMain.cc | 14 ++++++++++---- 1 file changed, 10 insertions(+), 4 deletions(-) diff --git a/src/buddies/src/bd/bdConverterMain.cc b/src/buddies/src/bd/bdConverterMain.cc index 5628a14d6..4b8da9a34 100644 --- a/src/buddies/src/bd/bdConverterMain.cc +++ b/src/buddies/src/bd/bdConverterMain.cc @@ -41,7 +41,9 @@ int converter_main (int argc, char *argv[], const std::string &format) generic_writer_options.add_options (cmd, format); generic_reader_options.add_options (cmd); - cmd << tl::arg ("input", &infile, "The input file (any format, may be gzip compressed)") + cmd << tl::arg ("input", &infile, "The input file (any format, may be gzip compressed)", + "You can use '+' to supply multiple files which will be read after each other into the same layout. " + "This provides some cheap, but risky way of merging files. Beware of cell name conflicts.") << tl::arg ("output", &outfile, tl::sprintf ("The output file (%s format)", format)) ; @@ -55,9 +57,13 @@ int converter_main (int argc, char *argv[], const std::string &format) db::LoadLayoutOptions load_options; generic_reader_options.configure (load_options); - tl::InputStream stream (infile); - db::Reader reader (stream); - reader.read (layout, load_options); + std::vector files = tl::split (infile, "+"); + + for (std::vector::const_iterator f = files.begin (); f != files.end (); ++f) { + tl::InputStream stream (*f); + db::Reader reader (stream); + reader.read (layout, load_options); + } } {