Rename the variable 'quality' to 'brotli_quality'
Right now the quality is only used in the brotli compressor. And it
would be ambiguous if we add another compressor in the future; since the
compressors may have different interpretion on the quality value.
Test: unit tests pass; run bsdiff
Change-Id: I23af06a135b2b47df5209171f7db0773ac02a326
diff --git a/bsdiff_main.cc b/bsdiff_main.cc
index bed38b6..c4753c7 100644
--- a/bsdiff_main.cc
+++ b/bsdiff_main.cc
@@ -79,13 +79,12 @@
if (arguments.format() == bsdiff::BsdiffFormat::kLegacy) {
patch_writer = bsdiff::CreateBsdiffPatchWriter(patch_filename);
} else if (arguments.format() == bsdiff::BsdiffFormat::kBsdf2) {
- patch_writer = bsdiff::CreateBSDF2PatchWriter(
- patch_filename, arguments.compressor_type(),
- arguments.compression_quality());
+ patch_writer = bsdiff::CreateBSDF2PatchWriter(patch_filename,
+ arguments.compressor_type(),
+ arguments.brotli_quality());
} else if (arguments.format() == bsdiff::BsdiffFormat::kEndsley) {
- patch_writer =
- bsdiff::CreateEndsleyPatchWriter(&raw_data, arguments.compressor_type(),
- arguments.compression_quality());
+ patch_writer = bsdiff::CreateEndsleyPatchWriter(
+ &raw_data, arguments.compressor_type(), arguments.brotli_quality());
} else {
std::cerr << "unexpected bsdiff format." << std::endl;
return 1;
@@ -122,8 +121,8 @@
"required to consider a match in the algorithm.\n"
<< " --type <bz2|brotli|nocompression> The algorithm to compress "
"the patch, bsdf2 format only.\n"
- << " --quality Quality of the patch "
- "compression, brotli only.\n";
+ << " --brotli_quality Quality of the brotli "
+ "compressor.\n";
}
} // namespace