]> git.armaanb.net Git - lightcards.git/blobdiff - lightcards/lightcards.py
Bump version to 0.6.0
[lightcards.git] / lightcards / lightcards.py
index 768ac6852a14eb9d18a9c2960125db0ced324b2f..102a17ae7cc66cdbc0527de2f18bebe94428d22e 100644 (file)
@@ -19,6 +19,9 @@ def parse_args():
                         metavar="input file",
                         type=str,
                         nargs=1)
+    parser.add_argument("-a", "--alphabetize",
+                        action='store_true',
+                        help="alphabetize card order")
     parser.add_argument("-f", "--flip",
                         action='store_true',
                         help="show second column first")
@@ -37,7 +40,7 @@ def parse_args():
                         help="shuffle card order")
     parser.add_argument("-v", "--version",
                         action='version',
-                        version="lightcards 0.4.0")
+                        version="lightcards 0.6.0")
     return parser.parse_args()
 
 
@@ -53,21 +56,22 @@ def show(args, stack, headers):
         progress.purge_all()
 
     # Check for caches
-    ida = progress.dive(stack)
-    if ida:
-        (idx, stack, headers) = ida
-    else:
-        idx = Status()
+    idx = Status()
+    cache = progress.dive(get_orig())
+    if cache:
+        (stack) = cache
 
     # Manipulate deck
-    if args.flip:
-        for x in stack:
-            x[0], x[1] = x[1], x[0]
-        headers[0], headers[1] = headers[1], headers[0]
     if args.shuffle:
         shuffle(stack)
+    if args.alphabetize:
+        stack.sort()
     if args.reverse:
         stack.reverse()
+    if args.flip:
+        for x in stack:
+            x[0], x[1] = x[1], x[0]
+        headers[0], headers[1] = headers[1], headers[0]
 
     # Send to display
     win = Display(stack, headers, idx)