From 03304074913aaf5cfc05de8ffc00f66823896e50 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Adri=C3=A1n=20Oliva?= Date: Sun, 7 May 2023 00:17:58 -0600 Subject: First attempt at sorting. We can only sort by date and amount right now. I don't know if there are other important ways of sorting. D: --- ledger.py | 4 ++++ 1 file changed, 4 insertions(+) (limited to 'ledger.py') diff --git a/ledger.py b/ledger.py index d9eb14f..0e1e166 100755 --- a/ledger.py +++ b/ledger.py @@ -2,6 +2,7 @@ from utils.args import get_arguments, test_args from utils.read_file import read_ledger from utils.register import print_register +from utils.sort import sort_entries def main(): args = get_arguments() @@ -12,6 +13,9 @@ def main(): for file in args.files: result += read_ledger(file) + if args.sort: + sort_entries(result, args.sort) + if args.verb == 'print': for ent in result: print(ent) -- cgit v1.2.3