]> git.armaanb.net Git - lightcards.git/blobdiff - lightcards/runner.py
Remove CursesError exception
[lightcards.git] / lightcards / runner.py
index fdbbf9267573e0f50112454e2bb6855e37cdd6fb..40b5b15f25673e0f2c4599ebb950249a35f98977 100644 (file)
@@ -8,7 +8,7 @@ from random import shuffle
 import sys
 
 from . import parse, progress, config
-from .display import Display, CursesError
+from .display import Display
 from .deck import Status
 
 
@@ -40,6 +40,13 @@ def parse_args():
         action="store_true",
         help="don't raise exception if tables are malformed",
     )
+    parser.add_argument(
+        "-t",
+        "--table",
+        metavar="num_table",
+        type=int,
+        help="specify which table to use if multiple are given",
+    )
     parser.add_argument(
         "-a",
         "--alphabetize",
@@ -101,7 +108,7 @@ def show(args, stack, headers, conf):
     try:
         curses.wrapper(win.run)
     except curses.error as e:
-        raise CursesError() from e
+        raise e
 
 
 def get_orig():
@@ -117,7 +124,7 @@ def main(args=sys.argv):
         sys.tracebacklimit = 0
 
     global headers, stack
-    (headers, stack) = parse.parse_html(parse.md2html(args.inp), args.lenient)
+    (headers, stack) = parse.parse_html(parse.md2html(args.inp), args, conf)
 
     show(args, stack, headers, conf)