summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAdam J. Stewart <ajstewart426@gmail.com>2019-12-17 12:23:22 -0600
committerTamara Dahlgren <35777542+tldahlgren@users.noreply.github.com>2019-12-17 10:23:22 -0800
commit18c2029fef2725396d95b9ff7d11bb61ae8037a8 (patch)
treef8f5bfb82b8950f3bc1e8375d752728c25e2a752
parent189eb5b883517c57d026b22732c0019e51bb4671 (diff)
downloadspack-18c2029fef2725396d95b9ff7d11bb61ae8037a8.tar.gz
spack-18c2029fef2725396d95b9ff7d11bb61ae8037a8.tar.bz2
spack-18c2029fef2725396d95b9ff7d11bb61ae8037a8.tar.xz
spack-18c2029fef2725396d95b9ff7d11bb61ae8037a8.zip
Fix argparse rST parsing of help messages (#14014)
Thanks!
-rw-r--r--lib/spack/llnl/util/argparsewriter.py5
1 files changed, 3 insertions, 2 deletions
diff --git a/lib/spack/llnl/util/argparsewriter.py b/lib/spack/llnl/util/argparsewriter.py
index 16bb570a77..a942f511f2 100644
--- a/lib/spack/llnl/util/argparsewriter.py
+++ b/lib/spack/llnl/util/argparsewriter.py
@@ -10,9 +10,10 @@ import errno
import sys
-class ArgparseWriter(object):
+class ArgparseWriter(argparse.HelpFormatter):
"""Analyzes an argparse ArgumentParser for easy generation of help."""
def __init__(self, out=sys.stdout):
+ super(ArgparseWriter, self).__init__(out)
self.level = 0
self.out = out
@@ -48,7 +49,7 @@ class ArgparseWriter(object):
def action_group(function, actions):
for action in actions:
arg = fmt._format_action_invocation(action)
- help = action.help if action.help else ''
+ help = self._expand_help(action) if action.help else ''
function(arg, re.sub('\n', ' ', help))
if root: