Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix: do not hardcode console width #3451

Merged
merged 1 commit into from
Oct 23, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 2 additions & 1 deletion cve_bin_tool/output_engine/console.py
Original file line number Diff line number Diff line change
Expand Up @@ -52,11 +52,12 @@ def _output_console_nowrap(
exploits: bool = False,
all_product_data=None,
offline: bool = False,
width: int = None,
console: Console = Console(theme=cve_theme),
):
"""Output list of CVEs in a tabular format with color support"""

console._width = 120
console._width = width
now = datetime.now().strftime("%Y-%m-%d %H:%M:%S")
time_of_last_update = time_of_last_update.strftime("%Y-%m-%d %H:%M:%S")

Expand Down
3 changes: 3 additions & 0 deletions test/test_output_engine.py
Original file line number Diff line number Diff line change
Expand Up @@ -942,6 +942,7 @@ def test_output_console(self):
exploits,
all_product_data,
True,
120,
console,
outfile,
)
Expand Down Expand Up @@ -984,6 +985,7 @@ def test_output_console_affected_versions(self):
exploits,
all_product_data,
True,
120,
console,
outfile,
)
Expand Down Expand Up @@ -1031,6 +1033,7 @@ def test_output_console_outfile(self):
exploits,
all_product_data,
True,
120,
outfile,
)

Expand Down