Skip to content

Commit

Permalink
'Stop' comman' command shows saved fact
Browse files Browse the repository at this point in the history
Closes #157
  • Loading branch information
elbenfreund committed Apr 25, 2016
1 parent f8f3505 commit be0ca37
Showing 1 changed file with 4 additions and 3 deletions.
7 changes: 4 additions & 3 deletions hamster_cli/hamster_cli.py
Original file line number Diff line number Diff line change
Expand Up @@ -304,16 +304,17 @@ def _stop(controler):
ValueError: If no *ongoing fact* can be found.
"""
try:
controler.facts.stop_tmp_fact()
fact = controler.facts.stop_tmp_fact()
except ValueError:
message = _(
"Unable to continue temporary fact. Are you sure there is one?"
"Try running *current*."
)
raise click.ClickException(message)
else:
controler.client_logger.info(_("Temporary fact stoped."))
click.echo(_("Temporary fact stoped!"))
message = '{fact} ({duration} minutes)'.format(fact=fact, duration=fact.get_string_delta())
controler.client_logger.info(_(message))
click.echo(_(message))


@run.command(help=help_strings.CANCEL_HELP)
Expand Down

0 comments on commit be0ca37

Please sign in to comment.