From 300ff2b3e1ccd190f361f47ef2eb640d7e141073 Mon Sep 17 00:00:00 2001 From: Zack Hobson Date: Sun, 26 Jan 2014 10:07:28 -0800 Subject: confirm timer cancel, closes #47 --- lib/hcl/commands.rb | 3 +++ 1 file changed, 3 insertions(+) (limited to 'lib') diff --git a/lib/hcl/commands.rb b/lib/hcl/commands.rb index c753fbf..9bad615 100644 --- a/lib/hcl/commands.rb +++ b/lib/hcl/commands.rb @@ -45,6 +45,9 @@ module HCl def cancel entry = DayEntry.with_timer(http) || DayEntry.last(http) if entry + confirmed = /^y/.match(ask("#{entry}\nDelete this entry? (y/n): ").downcase) + return unless confirmed + if entry.cancel http "Deleted entry #{entry}." else -- cgit v1.2.3