X-Git-Url: https://git.armaanb.net/?a=blobdiff_plain;f=lightcards%2Frunner.py;h=f9f1abd9437d5f430bd7e6da721fc0562beb2b76;hb=a407ed5623d0f4140ac1be54e6179785eb4431ea;hp=83a71b009b25413e51f112f2e200251b4b705a76;hpb=65cb608a985f5168edfa6e2833f37bc812274a2f;p=lightcards.git diff --git a/lightcards/runner.py b/lightcards/runner.py index 83a71b0..f9f1abd 100644 --- a/lightcards/runner.py +++ b/lightcards/runner.py @@ -4,6 +4,7 @@ import argparse from curses import wrapper import os +import pkg_resources from random import shuffle import sys @@ -40,7 +41,10 @@ def parse_args(): "-s", "--shuffle", action="store_true", help="shuffle card order" ) parser.add_argument( - "-v", "--version", action="version", version="lightcards 0.6.0" + "-v", + "--version", + action="version", + version=f"lightcards {pkg_resources.require('lightcards')[0].version}", ) return parser.parse_args() @@ -56,7 +60,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 @@ -64,7 +68,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: