aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorbenadha <benawiadha@gmail.com>2022-01-15 19:13:41 +0700
committerbenadha <benawiadha@gmail.com>2022-01-15 19:13:41 +0700
commitba1c6689a07fd29da0c8ca3eb2415d023f86ff9b (patch)
treed2bb828889d932773f6d402a1151e154979d9151
parent5f6985fcb8e93c0b3c5c4841c50da817926fcf93 (diff)
downloadepy-ba1c6689a07fd29da0c8ca3eb2415d023f86ff9b.tar.gz
Minor cosmetics
-rwxr-xr-xepy.py13
1 files changed, 8 insertions, 5 deletions
diff --git a/epy.py b/epy.py
index e5a41fa..53aeb2f 100755
--- a/epy.py
+++ b/epy.py
@@ -1831,13 +1831,16 @@ def get_matching_library_item(
def print_reading_history(state: State) -> None:
termc, _ = shutil.get_terminal_size()
library_items = state.get_from_history()
+ if not library_items:
+ print("No Reading History.")
+ return
print("Reading History:")
dig = len(str(len(library_items) + 1))
tcols = termc - dig - 2
for n, item in enumerate(library_items):
print(
- "{}. {}".format(
+ "{} {}".format(
str(n + 1).rjust(dig),
truncate(str(item), "...", tcols, tcols - 3),
)
@@ -3829,10 +3832,10 @@ def parse_cli_args() -> Tuple[str, bool]:
epilog=textwrap.dedent(
f"""\
examples:
- {prog} /path/to/ebook read /path/to/ebook file
- {prog} 3 read #3 file from reading history
- {prog} count monte read file matching 'count monte'
- from reading history
+ {prog} /path/to/ebook read /path/to/ebook file
+ {prog} 3 read #3 file from reading history
+ {prog} count monte read file matching 'count monte'
+ from reading history
"""
),
)