diff options
-rw-r--r-- | lib/spack/spack/main.py | 5 |
1 files changed, 5 insertions, 0 deletions
diff --git a/lib/spack/spack/main.py b/lib/spack/spack/main.py index 1eeec8827b..31a4bfe4ed 100644 --- a/lib/spack/spack/main.py +++ b/lib/spack/spack/main.py @@ -12,6 +12,7 @@ from __future__ import print_function import argparse import inspect +import operator import os import os.path import pstats @@ -188,6 +189,10 @@ class SpackHelpFormatter(argparse.RawTextHelpFormatter): usage = '[-%s] %s' % (chars, usage) return usage.strip() + def add_arguments(self, actions): + actions = sorted(actions, key=operator.attrgetter('option_strings')) + super(SpackHelpFormatter, self).add_arguments(actions) + class SpackArgumentParser(argparse.ArgumentParser): def format_help_sections(self, level): |