summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-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: