From a446e7eded68f8ea4bbcbf08daa795cf851af73c Mon Sep 17 00:00:00 2001 From: Armaan Bhojwani Date: Sat, 30 Jan 2021 23:45:15 -0500 Subject: [PATCH] Add flip option --- lightcards/lightcards.py | 7 +++++++ man/lightcards.1.md | 3 +++ 2 files changed, 10 insertions(+) diff --git a/lightcards/lightcards.py b/lightcards/lightcards.py index e41b2cf..ca3eac8 100755 --- a/lightcards/lightcards.py +++ b/lightcards/lightcards.py @@ -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: diff --git a/man/lightcards.1.md b/man/lightcards.1.md index 3b5d8d2..5fc0aed 100644 --- a/man/lightcards.1.md +++ b/man/lightcards.1.md @@ -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 -- 2.39.2