add arguments to take a version

This commit is contained in:
a2p1k02 2021-01-03 17:10:49 +03:00
parent 58a7e70860
commit 51c9bb05c6
3 changed files with 9 additions and 4 deletions

Binary file not shown.

View File

@ -1,6 +1,4 @@
from zipfile import ZipFile
# from bs4 import BeautifulSoup
# from lxml import etree
def reader(path_to_file):

View File

@ -1,4 +1,11 @@
from fb3_reader import fb3
from sys import argv
from fb3_reader import fb3, __version__
if __name__ == '__main__':
fb3.reader(input("Enter path to file: "))
try:
if argv[1] == "--version" or argv[1] == "-v":
print(__version__)
else:
fb3.reader(input("Enter path to file: "))
except IndexError:
fb3.reader(input("Enter path to file: "))