diff options
author | benadha <benawiadha@gmail.com> | 2022-01-15 19:13:41 +0700 |
---|---|---|
committer | benadha <benawiadha@gmail.com> | 2022-01-15 19:13:41 +0700 |
commit | ba1c6689a07fd29da0c8ca3eb2415d023f86ff9b (patch) | |
tree | d2bb828889d932773f6d402a1151e154979d9151 | |
parent | 5f6985fcb8e93c0b3c5c4841c50da817926fcf93 (diff) | |
download | epy-ba1c6689a07fd29da0c8ca3eb2415d023f86ff9b.tar.gz |
Minor cosmetics
-rwxr-xr-x | epy.py | 13 |
1 files changed, 8 insertions, 5 deletions
@@ -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 """ ), ) |