]> git.armaanb.net Git - lightcards.git/blobdiff - lightcards/runner.py
Fix sort function
[lightcards.git] / lightcards / runner.py
index 2fa42f49e6cc214c92b82d2d1ea8a76fc825acb9..35651f92b5fd1d20cb7454b9bc1e1f34c661d1e6 100644 (file)
@@ -13,6 +13,7 @@ from .deck import Status
 
 
 def parse_args():
+    """Parse command line arguments"""
     parser = argparse.ArgumentParser(
         description="Terminal flashcards from Markdown"
     )
@@ -55,7 +56,7 @@ def show(args, stack, headers):
 
     # Check for caches
     idx = Status()
-    cache = progress.dive(get_orig())
+    cache = progress.dive(get_orig()[1])
     if cache:
         (stack) = cache
 
@@ -63,7 +64,7 @@ def show(args, stack, headers):
     if args.shuffle:
         shuffle(stack)
     if args.alphabetize:
-        stack.sort()
+        stack.sort(key=lambda x: x.front)
     if args.reverse:
         stack.reverse()
     if args.flip: