aboutsummaryrefslogtreecommitdiff
path: root/ledger.py
diff options
context:
space:
mode:
authorAdrián Oliva <adrian.oliva@cimat.mx>2023-05-07 00:17:58 -0600
committerAdrián Oliva <adrian.oliva@cimat.mx>2023-05-07 00:17:58 -0600
commit03304074913aaf5cfc05de8ffc00f66823896e50 (patch)
treef89174ca7e4f3352315857c3e2f6962cc48e1fec /ledger.py
parent4875c36a055ea89118e665bdd8b3d0148b112307 (diff)
downloadLedger.py-03304074913aaf5cfc05de8ffc00f66823896e50.tar.gz
Ledger.py-03304074913aaf5cfc05de8ffc00f66823896e50.zip
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:
Diffstat (limited to '')
-rwxr-xr-xledger.py4
1 files changed, 4 insertions, 0 deletions
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)