Commit 83ebe3cb authored by Chris Lamb's avatar Chris Lamb 💬

Split --report-size into --max-text-report-size - the defaults for each are...

Split --report-size into --max-text-report-size - the defaults for each are not really compatible and --text should emit everything by default.
Signed-off-by: Chris Lamb's avatarChris Lamb <lamby@debian.org>
parent d0975c64
......@@ -28,6 +28,7 @@ class Config(object):
# GNU diff cannot process arbitrary large files :(
max_diff_input_lines = 2 ** 20
max_report_size = 2000 * 2 ** 10 # 2000 kB
max_text_report_size = 0
max_report_child_size = 500 * 2 ** 10
new_file = False
fuzzy_threshold = 60
......
......@@ -107,6 +107,11 @@ def create_parser():
group2.add_argument('--no-default-limits', action='store_true', default=False,
help='Disable most default limits. Note that text '
'output already ignores most of these.')
group2.add_argument('--max-text-report-size', metavar='BYTES',
dest='max_text_report_size', type=int,
help='Maximum bytes written in --text report. (0 to '
'disable)', default=None).completer=RangeCompleter(0,
Config().max_text_report_size, 200000)
group2.add_argument('--max-report-size', metavar='BYTES',
dest='max_report_size', type=int,
help='Maximum bytes written in report. In html-dir '
......@@ -229,6 +234,7 @@ def run_diffoscope(parsed_args):
if not tlsh and Config().fuzzy_threshold != parsed_args.fuzzy_threshold:
logger.warning('Fuzzy-matching is currently disabled as the "tlsh" module is unavailable.')
maybe_set_limit(Config(), parsed_args, "max_report_size")
maybe_set_limit(Config(), parsed_args, "max_text_report_size")
maybe_set_limit(Config(), parsed_args, "max_report_child_size")
# need to set them in this order due to Config._check_constraints
maybe_set_limit(Config(), parsed_args, "max_diff_block_lines_saved")
......
......@@ -32,7 +32,7 @@ class TextPresenter(Presenter):
def __init__(self, print_func, color):
self.print_func = create_limited_print_func(
print_func,
Config().max_report_size,
Config().max_text_report_size,
)
self.color = color
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment