aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMatěj Cepl <mcepl@cepl.eu>2020-06-18 10:40:54 +0200
committerMatěj Cepl <mcepl@cepl.eu>2020-06-18 10:40:54 +0200
commit29e595d8172264bb2bfd0509f0469bc9244466c4 (patch)
tree6b21370ff001f31a9ed88d7650d2dec2feb5c492
parentc4a7abd99f96f37ef0b18b1fd8e3660470a98829 (diff)
downloadepubgrep-29e595d8172264bb2bfd0509f0469bc9244466c4.tar.gz
Generate properly binary as an entry_point.0.4.1
-rwxr-xr-xepubgrep.py6
-rw-r--r--setup.py7
2 files changed, 11 insertions, 2 deletions
diff --git a/epubgrep.py b/epubgrep.py
index cf70bcf..7f35c1a 100755
--- a/epubgrep.py
+++ b/epubgrep.py
@@ -97,7 +97,7 @@ def grep_book(filename: str, pattern: str, flags: int, counting: bool=False, col
return out
-if __name__ == "__main__":
+def main():
parser = argparse.ArgumentParser(description='Grep through EPub book')
parser.add_argument('pattern')
parser.add_argument('files', nargs='+')
@@ -139,3 +139,7 @@ if __name__ == "__main__":
print(data)
except (BrokenPipeError, KeyboardInterrupt):
sys.exit()
+
+
+if __name__ == '__main__':
+ main()
diff --git a/setup.py b/setup.py
index 6fb4595..9ba5c6f 100644
--- a/setup.py
+++ b/setup.py
@@ -4,7 +4,7 @@ from setuptools import setup, find_packages
setup(
name="epubgrep",
- version="0.4.0",
+ version="0.4.1",
description='Grep through EPub files',
author=u'Matěj Cepl',
author_email='mcepl@cepl.eu',
@@ -12,6 +12,11 @@ setup(
packages=find_packages(),
test_suite='tests',
install_requires=['epub_meta'],
+ entry_points={
+ 'console_scripts': [
+ 'epubgrep=epubgrep:main',
+ ],
+ },
classifiers=[
"Programming Language :: Python :: 3",
"Programming Language :: Python :: 3.3",