Skip to content

Commit

Permalink
Add wrapping for exit code messages.
Browse files Browse the repository at this point in the history
Also move required messages for inputs/outputs to bottom.
  • Loading branch information
sphuber committed Oct 24, 2022
1 parent b6a0f52 commit 3bae980
Showing 1 changed file with 5 additions and 5 deletions.
10 changes: 5 additions & 5 deletions aiida/cmdline/utils/common.py
Original file line number Diff line number Diff line change
Expand Up @@ -448,7 +448,6 @@ def build_entries(ports):

if process_spec.inputs:
echo.echo('\nInputs:', fg=echo.COLORS['report'], bold=True)
echo.echo(style('Required inputs are displayed in bold red\n', italic=True))

table = []

Expand All @@ -457,10 +456,10 @@ def build_entries(ports):

if table:
echo.echo(tabulate(table, tablefmt='plain', colalign=('right',)))
echo.echo(style('\nRequired inputs are displayed in bold red.\n', italic=True))

if process_spec.outputs:
echo.echo('\nOutputs:', fg=echo.COLORS['report'], bold=True)
echo.echo(style('Required outputs are displayed in bold red\n', italic=True))
echo.echo('Outputs:', fg=echo.COLORS['report'], bold=True)

table = []

Expand All @@ -469,9 +468,10 @@ def build_entries(ports):

if table:
echo.echo(tabulate(table, tablefmt='plain', colalign=('right',)))
echo.echo(style('\nRequired outputs are displayed in bold red.\n', italic=True))

if process_spec.exit_codes:
echo.echo('\nExit codes:\n', fg=echo.COLORS['report'], bold=True)
echo.echo('Exit codes:\n', fg=echo.COLORS['report'], bold=True)

table = [('0', 'The process finished successfully.')]

Expand All @@ -480,7 +480,7 @@ def build_entries(ports):
status = style(exit_code.status, bold=True, fg='red')
else:
status = exit_code.status
table.append((status, exit_code.message))
table.append((status, '\n'.join(textwrap.wrap(exit_code.message, width=75))))

echo.echo(tabulate(table, tablefmt='plain'))
echo.echo(style('\nExit codes that invalidate the cache are marked in bold red.\n', italic=True))
Expand Down

0 comments on commit 3bae980

Please sign in to comment.