From 39fd3b3a6f5898a80a4b8db13ea0a56c1dc5cbf5 Mon Sep 17 00:00:00 2001 From: Bartosz Taudul Date: Sun, 26 Aug 2018 16:28:46 +0200 Subject: [PATCH] Add optional high compression mode to update utility. --- update/src/update.cpp | 15 ++++++++++++--- 1 file changed, 12 insertions(+), 3 deletions(-) diff --git a/update/src/update.cpp b/update/src/update.cpp index cf64c4fe..51b8fe05 100644 --- a/update/src/update.cpp +++ b/update/src/update.cpp @@ -13,7 +13,8 @@ void Usage() { - printf( "Usage: update input.tracy output.tracy\n" ); + printf( "Usage: update [--hc] input.tracy output.tracy\n\n" ); + printf( " --hc: enable LZ4HC compression\n" ); exit( 1 ); } @@ -27,7 +28,15 @@ int main( int argc, char** argv ) } #endif - if( argc != 3 ) Usage(); + bool hc = false; + + if( argc != 3 && argc != 4 ) Usage(); + if( argc == 4 ) + { + if( strcmp( argv[1], "--hc" ) != 0 ) Usage(); + hc = true; + argv++; + } const char* input = argv[1]; const char* output = argv[2]; @@ -43,7 +52,7 @@ int main( int argc, char** argv ) { tracy::Worker worker( *f ); - auto w = std::unique_ptr( tracy::FileWrite::Open( output ) ); + auto w = std::unique_ptr( tracy::FileWrite::Open( output, hc ) ); if( !w ) { fprintf( stderr, "Cannot open output file!\n" );