]> git.armaanb.net Git - lightcards.git/commitdiff
Add flip option
authorArmaan Bhojwani <me@armaanb.net>
Sun, 31 Jan 2021 04:45:15 +0000 (23:45 -0500)
committerArmaan Bhojwani <me@armaanb.net>
Sun, 31 Jan 2021 04:45:15 +0000 (23:45 -0500)
lightcards/lightcards.py
man/lightcards.1.md

index e41b2cfb541a72c1de2c1d7e302a84e9360f1440..ca3eac83d1d0a6bbe897085bda1061a5922ad2e5 100755 (executable)
@@ -17,6 +17,9 @@ def parse_args():
                         metavar="input file",
                         type=str,
                         nargs=1)
+    parser.add_argument("-f", "--flip",
+                        action='store_true',
+                        help="show second column first")
     parser.add_argument("-r", "--reverse",
                         action='store_true',
                         help="reverse card order")
@@ -31,6 +34,10 @@ def parse_args():
 
 def show(args, stack, headers):
     idx = Status()
+    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)
     elif args.reverse:
index 3b5d8d2faa74e375d23124da6c31c38e5894bb1b..5fc0aed6810459e6387546752adc35f6a2aea691 100644 (file)
@@ -19,6 +19,9 @@ lightcards [[options]] [input file]
 **-h**, **--help**
 : Show a help message and exit
 
+**-f**, **--flip**
+: Show second column first
+
 **-r**, **--reverse**
 : Reverse card order. Has no effect when shuffling as well