From a965744d4d562b5c0235fd9d5baacb2ef7aa27c2 Mon Sep 17 00:00:00 2001 From: Armaan Bhojwani Date: Sat, 30 Jan 2021 23:38:31 -0500 Subject: [PATCH] Add reverse option --- lightcards/lightcards.py | 15 ++++++++++----- man/lightcards.1 | 8 ++++++-- man/lightcards.1.md | 7 +++++-- setup.py | 2 +- 4 files changed, 22 insertions(+), 10 deletions(-) diff --git a/lightcards/lightcards.py b/lightcards/lightcards.py index 9affd44..e41b2cf 100755 --- a/lightcards/lightcards.py +++ b/lightcards/lightcards.py @@ -17,19 +17,24 @@ def parse_args(): metavar="input file", type=str, nargs=1) - parser.add_argument("-v", "--version", - action='version', - version="lightcards 0.1.0") + parser.add_argument("-r", "--reverse", + action='store_true', + help="reverse card order") parser.add_argument("-s", "--shuffle", action='store_true', - help="shuffle cards before starting") + help="shuffle card order") + parser.add_argument("-v", "--version", + action='version', + version="lightcards 0.2.0") return parser.parse_args() def show(args, stack, headers): idx = Status() - if args: + if args.shuffle: shuffle(stack) + elif args.reverse: + stack.reverse() wrapper(display.get_key, stack, headers, idx) diff --git a/man/lightcards.1 b/man/lightcards.1 index 3d3cc5f..98e8a43 100644 --- a/man/lightcards.1 +++ b/man/lightcards.1 @@ -1,6 +1,6 @@ .\" Automatically generated by Pandoc 2.11.3 .\" -.TH "lightcards" "1" "January 2021" "0.1.0" "" +.TH "lightcards" "1" "January 2021" "0.2.0" "" .hy .SH NAME .PP @@ -22,8 +22,12 @@ Relative or absolute path to the input Markdown or HTML file \f[B]-h\f[R], \f[B]\[en]help\f[R] Show a help message and exit .TP +\f[B]-r\f[R], \f[B]\[en]reverse\f[R] +Reverse card order. +Has no effect when shuffling as well +.TP \f[B]-s\f[R], \f[B]\[en]shuffle\f[R] -Shuffle cards before starting +Shuffle card order .TP \f[B]-v\f[R], \f[B]\[en]version\f[R] Print version and exit diff --git a/man/lightcards.1.md b/man/lightcards.1.md index 90ba1d4..3b5d8d2 100644 --- a/man/lightcards.1.md +++ b/man/lightcards.1.md @@ -1,4 +1,4 @@ -% lightcards(1) 0.1.0 +% lightcards(1) 0.2.0 % Armaan Bhojwani % January 2021 @@ -19,8 +19,11 @@ lightcards [[options]] [input file] **-h**, **--help** : Show a help message and exit +**-r**, **--reverse** +: Reverse card order. Has no effect when shuffling as well + **-s**, **--shuffle** -: Shuffle cards before starting +: Shuffle card order **-v**, **--version** : Print version and exit diff --git a/setup.py b/setup.py index 1925b48..2e9f881 100644 --- a/setup.py +++ b/setup.py @@ -2,7 +2,7 @@ from setuptools import setup setup( name="lightcards", - version="0.1.0", + version="0.2.0", description="Markdown flashcards", url="https://sr.ht/~armaan/lightcards", author="Armaan Bhojwani", -- 2.39.2