Skip to content

Commit

Permalink
status message displayed at end
Browse files Browse the repository at this point in the history
  • Loading branch information
cosminbasca committed Feb 15, 2016
1 parent 0e15cef commit 3dd05df
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 4 deletions.
4 changes: 2 additions & 2 deletions cleanmymac/cli.py
Original file line number Diff line number Diff line change
Expand Up @@ -165,5 +165,5 @@ def cli(update, dry_run, quiet, strict, list_targets, stop_on_error, config, tar
free_space_after = get_disk_usage('/', unit=UNIT_MB).free
if not dry_run:
echo_info('\ncleanup complete', verbose=verbose)
echo_success('freed {0:.3f} MB of disk space'.format(free_space_after - free_space_before),
verbose=verbose)
echo_success('\nfreed {0:.3f} MB of disk space'.format(free_space_after - free_space_before),
verbose=True, nl=verbose)
5 changes: 3 additions & 2 deletions cleanmymac/log.py
Original file line number Diff line number Diff line change
Expand Up @@ -132,16 +132,17 @@ def echo_warn(msg, verbose=True):
click.secho(msg, fg='yellow')


def echo_success(msg, verbose=True):
def echo_success(msg, verbose=True, nl=True):
"""
convenience method to display a message using the **green** ANSI color,
the method relies on :func:`click.secho`
:param str msg: the message
:param bool verbose: echo message only if True
:param bool nl: print new line
"""
if verbose:
click.secho(msg, fg='green')
click.secho(msg, fg='green', nl=nl)


def echo_target(msg, verbose=True):
Expand Down

0 comments on commit 3dd05df

Please sign in to comment.