sleep: no blank first line when there is nothing to report before the nap

This commit is contained in:
victortaelin 2026-07-25 18:48:22 -03:00
parent 50b688ab68
commit 909e28fec9

5
memo
View file

@ -389,8 +389,9 @@ def cmd_note(d, args):
def cmd_sleep(d, args): def cmd_sleep(d, args):
T = log_len(d) T, said = log_len(d), False
if args: if args:
said = True
if len(args) != 2: if len(args) != 2:
die("usage: memo sleep <lo>-<hi> \"<one line>\"") die("usage: memo sleep <lo>-<hi> \"<one line>\"")
m = re.fullmatch(r"(\d+)-(\d+)", args[0]) m = re.fullmatch(r"(\d+)-(\d+)", args[0])
@ -413,7 +414,7 @@ def cmd_sleep(d, args):
if not nap: if not nap:
print("Nothing left to compress.") print("Nothing left to compress.")
return return
print("\n" + nap) print(("\n" if said else "") + nap)
def cmd_forget(d, args): def cmd_forget(d, args):