From 45be57da2aa2f54ab797319b70793c1486a1a261 Mon Sep 17 00:00:00 2001 From: Xie Yanbo Date: Wed, 6 Nov 2024 17:07:17 +0800 Subject: [PATCH] Avoid crash if not provide book_name --- book_maker/cli.py | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/book_maker/cli.py b/book_maker/cli.py index 5404b5f..0f7043a 100644 --- a/book_maker/cli.py +++ b/book_maker/cli.py @@ -325,8 +325,11 @@ So you are close to reaching the limit. You have to choose your own value, there options = parser.parse_args() + if not options.book_name: + print(f"Error: please provide the path of your book using --book_name ") + exit(1) if not os.path.isfile(options.book_name): - print(f"Error: {options.book_name} does not exist.") + print(f"Error: the book {options.book_name!r} does not exist.") exit(1) PROXY = options.proxy