Skip to content

Commit 432006d

Browse files
committed
cleanup: update print msg section
Signed-off-by: K.B.Dharun Krishna <[email protected]>
1 parent f6a83d9 commit 432006d

File tree

1 file changed

+11
-7
lines changed

1 file changed

+11
-7
lines changed

tldr.py

Lines changed: 11 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -627,13 +627,17 @@ def main() -> None:
627627
output(results[0][0], plain=options.markdown)
628628
if results[1:]:
629629
platforms_str = [result[1] for result in results[1:]]
630-
single = len(platforms_str) == 1
631-
print(
632-
f"There {'is' if single else 'are'} other version"
633-
f"{'s' if not single else ''} of this page under the "
634-
f"following platform{'s' if not single else ''}: "
635-
f"{', '.join(platforms_str)}."
636-
)
630+
are_multiple_platforms = len(platforms_str) > 1
631+
if are_multiple_platforms:
632+
print(
633+
f"Found {len(platforms_str)} pages with the same name"
634+
f" under the platforms: {', '.join(platforms_str)}."
635+
)
636+
else:
637+
print(
638+
f"Found 1 page with the same name"
639+
f" under the platform: {platforms_str[0]}."
640+
)
637641
except URLError as e:
638642
sys.exit("Error fetching from tldr: {}".format(e))
639643

0 commit comments

Comments
 (0)