diff --git a/apio/__main__.py b/apio/__main__.py index cbc4a9f4..4c36c382 100644 --- a/apio/__main__.py +++ b/apio/__main__.py @@ -11,8 +11,8 @@ # -------------------------------------------- import string -import click import re +import click from apio import util @@ -128,7 +128,8 @@ def cli(ctx): # -- We later split the command lines into command groups. index = help_lines.index("Commands:") header_lines = help_lines[:index] - command_lines = help_lines[index + 1 :] + index += 1 # Skip the Commands: line. + command_lines = help_lines[index:] # -- Select project commands: project_help = select_commands_help( diff --git a/apio/util.py b/apio/util.py index b6e81df7..62cdb537 100644 --- a/apio/util.py +++ b/apio/util.py @@ -86,7 +86,8 @@ def run(self): """DOC: TODO""" for line in iter(self._pipe_reader.readline, ""): - line = line.strip() + # We do preserve trailing whitespace and indentation. + line = line.rstrip() self._buffer.append(line) if self.outcallback: self.outcallback(line)