Skip to content

Commit

Permalink
Merge pull request #404 from zapta/develop
Browse files Browse the repository at this point in the history
Now preserving leading whitespaces in stderr and stdout of subprocesses
  • Loading branch information
Obijuan authored Sep 4, 2024
2 parents f3924f7 + 67ed2e3 commit 094ba00
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 3 deletions.
5 changes: 3 additions & 2 deletions apio/__main__.py
Original file line number Diff line number Diff line change
Expand Up @@ -11,8 +11,8 @@
# --------------------------------------------

import string
import click
import re
import click

from apio import util

Expand Down Expand Up @@ -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(
Expand Down
3 changes: 2 additions & 1 deletion apio/util.py
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down

0 comments on commit 094ba00

Please sign in to comment.