From b7f7d901d11aee366b3bf2f0f7e8624ccab43862 Mon Sep 17 00:00:00 2001 From: Greg Becker Date: Wed, 26 May 2021 13:34:13 -0700 Subject: allow whitespace formatting in variant descriptions (#23853) --- lib/spack/spack/cmd/info.py | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/lib/spack/spack/cmd/info.py b/lib/spack/spack/cmd/info.py index 6b316f3cc4..441223b738 100644 --- a/lib/spack/spack/cmd/info.py +++ b/lib/spack/spack/cmd/info.py @@ -121,10 +121,12 @@ class VariantFormatter(object): ) allowed = v.allowed_values.replace('True, False', 'on, off') allowed = textwrap.wrap(allowed, width=self.column_widths[1]) - description = textwrap.wrap( - v.description, - width=self.column_widths[2] - ) + description = [] + for d_line in v.description.split('\n'): + description += textwrap.wrap( + d_line, + width=self.column_widths[2] + ) for t in zip_longest( name, allowed, description, fillvalue='' ): -- cgit v1.2.3-70-g09d2