Fix issues with spack [cmd] -h help output

- Shorten Spack command usage for short options. Short options are now
  shown as [-abc] instead of as [-a] [-b] [-c]

- fix bug that mixed long and short options for top-level `spack help`
This commit is contained in:
Todd Gamblin
2018-02-11 02:37:29 -08:00
parent fff3cc695d
commit 1b998cbeee
2 changed files with 40 additions and 13 deletions

View File

@@ -356,8 +356,6 @@ def _format_usage(self, usage, actions, groups, prefix):
pos_usage = format(positionals, groups)
opt_parts = _re.findall(part_regexp, opt_usage)
pos_parts = _re.findall(part_regexp, pos_usage)
assert ' '.join(opt_parts) == opt_usage
assert ' '.join(pos_parts) == pos_usage
# helper for wrapping lines
def get_lines(parts, indent, prefix=None):