summaryrefslogtreecommitdiff
path: root/lib
diff options
context:
space:
mode:
authorGreg Becker <becker33@llnl.gov>2021-05-26 13:34:13 -0700
committerGitHub <noreply@github.com>2021-05-26 14:34:13 -0600
commitb7f7d901d11aee366b3bf2f0f7e8624ccab43862 (patch)
tree5554cc099d14b3b372b799bd06ee15a9f14e5e8f /lib
parentf1e0053bf45b2ec92b9f894bb9a56e38ac68fd81 (diff)
downloadspack-b7f7d901d11aee366b3bf2f0f7e8624ccab43862.tar.gz
spack-b7f7d901d11aee366b3bf2f0f7e8624ccab43862.tar.bz2
spack-b7f7d901d11aee366b3bf2f0f7e8624ccab43862.tar.xz
spack-b7f7d901d11aee366b3bf2f0f7e8624ccab43862.zip
allow whitespace formatting in variant descriptions (#23853)
Diffstat (limited to 'lib')
-rw-r--r--lib/spack/spack/cmd/info.py10
1 files 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=''
):