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):
|
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):
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue