Do not use padding, when outputting in batch mode.

This commit is contained in:
Andris Raugulis 2016-09-08 19:00:35 +03:00
parent 2747907784
commit bdee87c7d3
1 changed files with 2 additions and 2 deletions

View File

@ -768,7 +768,7 @@ def output_algorithm(alg_type, alg_name, alg_max_len=0):
prefix = '(' + alg_type + ') ' prefix = '(' + alg_type + ') '
if alg_max_len == 0: if alg_max_len == 0:
alg_max_len = len(alg_name) alg_max_len = len(alg_name)
padding = ' ' * (alg_max_len - len(alg_name)) padding = '' if out.batch else ' ' * (alg_max_len - len(alg_name))
texts = [] texts = []
if alg_name in KexDB.ALGORITHMS[alg_type]: if alg_name in KexDB.ALGORITHMS[alg_type]:
alg_desc = KexDB.ALGORITHMS[alg_type][alg_name] alg_desc = KexDB.ALGORITHMS[alg_type][alg_name]
@ -830,7 +830,7 @@ def output_security_cve(software, padlen):
if not software.version_between(vfrom, vtill): if not software.version_between(vfrom, vtill):
continue continue
cve, cvss, descr = line[2:5] cve, cvss, descr = line[2:5]
padding = ' ' * (padlen - len(cve)) padding = '' if out.batch else ' ' * (padlen - len(cve))
out.fail('(cve) {0}{1} -- ({2}) {3}'.format(cve, padding, cvss, descr)) out.fail('(cve) {0}{1} -- ({2}) {3}'.format(cve, padding, cvss, descr))