sleep: no blank first line when there is nothing to report before the nap
This commit is contained in:
parent
50b688ab68
commit
909e28fec9
1 changed files with 3 additions and 2 deletions
5
memo
5
memo
|
|
@ -389,8 +389,9 @@ def cmd_note(d, args):
|
|||
|
||||
|
||||
def cmd_sleep(d, args):
|
||||
T = log_len(d)
|
||||
T, said = log_len(d), False
|
||||
if args:
|
||||
said = True
|
||||
if len(args) != 2:
|
||||
die("usage: memo sleep <lo>-<hi> \"<one line>\"")
|
||||
m = re.fullmatch(r"(\d+)-(\d+)", args[0])
|
||||
|
|
@ -413,7 +414,7 @@ def cmd_sleep(d, args):
|
|||
if not nap:
|
||||
print("Nothing left to compress.")
|
||||
return
|
||||
print("\n" + nap)
|
||||
print(("\n" if said else "") + nap)
|
||||
|
||||
|
||||
def cmd_forget(d, args):
|
||||
|
|
|
|||
Loading…
Reference in a new issue