@@ -39,6 +39,7 @@ int main(int argc, char* argv[])
3939 bool skipParentFilesList = false ;
4040 int verbosity = 2 ;
4141 int exitCode = 0 ; // 0: success, >0: failure
42+ int compression = 505 ;
4243
4344 int option_index = 0 ;
4445 static struct option long_options[] = {
@@ -47,8 +48,9 @@ int main(int argc, char* argv[])
4748 {" max-size" , required_argument, nullptr , 2 },
4849 {" skip-non-existing-files" , no_argument, nullptr , 3 },
4950 {" skip-parent-files-list" , no_argument, nullptr , 4 },
50- {" verbosity" , required_argument, nullptr , 5 },
51- {" help" , no_argument, nullptr , 6 },
51+ {" compression" , no_argument, nullptr , 5 },
52+ {" verbosity" , required_argument, nullptr , ' v' },
53+ {" help" , no_argument, nullptr , ' h' },
5254 {nullptr , 0 , nullptr , 0 }};
5355
5456 while (true ) {
@@ -66,14 +68,17 @@ int main(int argc, char* argv[])
6668 } else if (c == 4 ) {
6769 skipParentFilesList = true ;
6870 } else if (c == 5 ) {
71+ compression = atoi (optarg);
72+ } else if (c == ' v' ) {
6973 verbosity = atoi (optarg);
70- } else if (c == 6 ) {
74+ } else if (c == ' h ' ) {
7175 printf (" AO2D merging tool. Options: \n " );
7276 printf (" --input <inputfile.txt> Contains path to files to be merged. Default: %s\n " , inputCollection.c_str ());
7377 printf (" --output <outputfile.root> Target output ROOT file. Default: %s\n " , outputFileName.c_str ());
7478 printf (" --max-size <size in Bytes> Target directory size. Default: %ld. Set to 0 if file is not self-contained.\n " , maxDirSize);
7579 printf (" --skip-non-existing-files Flag to allow skipping of non-existing files in the input list.\n " );
7680 printf (" --skip-parent-files-list Flag to allow skipping the merging of the parent files list.\n " );
81+ printf (" --compression <root compression id> Compression algorithm / level to use (default: %d)\n " , compression);
7782 printf (" --verbosity <flag> Verbosity of output (default: %d).\n " , verbosity);
7883 return -1 ;
7984 } else {
@@ -95,7 +100,7 @@ int main(int argc, char* argv[])
95100 std::map<std::string, int > offsets;
96101 std::map<std::string, int > unassignedIndexOffset;
97102
98- auto outputFile = TFile::Open (outputFileName.c_str (), " RECREATE" , " " , 505 );
103+ auto outputFile = TFile::Open (outputFileName.c_str (), " RECREATE" , " " , compression );
99104 TDirectory* outputDir = nullptr ;
100105 long currentDirSize = 0 ;
101106
0 commit comments