aboutsummaryrefslogtreecommitdiffstats
path: root/epubgrep.py
diff options
context:
space:
mode:
Diffstat (limited to 'epubgrep.py')
-rwxr-xr-xepubgrep.py6
1 files changed, 5 insertions, 1 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()