Skip to content

Commit

Permalink
Add support for passing several journal files
Browse files Browse the repository at this point in the history
  • Loading branch information
ad-si committed Feb 4, 2024
1 parent 732c3e5 commit c0ba028
Show file tree
Hide file tree
Showing 8 changed files with 310 additions and 171 deletions.
2 changes: 1 addition & 1 deletion .gitignore
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/.parcel-cache
/.psci*
/.psc*
/.spago
/docs
/docs-dev
Expand Down
55 changes: 38 additions & 17 deletions cli-spec.ncl
Original file line number Diff line number Diff line change
@@ -1,3 +1,16 @@
let journalArgs = [
{
name = "JOURNAL_FILE",
description = "Path to the journal file",
type = 'Text,
},
{
name = "JOURNAL_FILE",
description = "Additional journal files",
type = 'List-Text,
},
]
in
{
name = "transity",
description = m%"
Expand All @@ -9,102 +22,110 @@
{
name = "balance",
description = "Simple balance of the owner's accounts",
arguments = ["JOURNAL_FILE"],
arguments = journalArgs,
},
{
name = "balance-all",
description = "Simple balance of all accounts",
arguments = ["JOURNAL_FILE"],
arguments = journalArgs,
},
{
name = "transactions",
description = "All transactions and their transfers",
arguments = ["JOURNAL_FILE"],
arguments = journalArgs,
},
{
name = "transfers",
description = "All transfers with one transfer per line",
arguments = ["JOURNAL_FILE"],
arguments = journalArgs,
},
{
name = "entries",
description = m%"
All individual deposits & withdrawals, space separated
"%,
arguments = ["JOURNAL_FILE"],
arguments = journalArgs,
},
{
name = "entities",
description = "[WIP] List all referenced entities",
arguments = ["JOURNAL_FILE"],
arguments = journalArgs,
},
{
name = "entities-sorted",
description = m%"
[WIP] List all referenced entities sorted alphabetically
"%,
arguments = ["JOURNAL_FILE"],
arguments = journalArgs,
},
{
name = "ledger-entries",
description = "All entries in Ledger format",
arguments = ["JOURNAL_FILE"],
arguments = journalArgs,
},
{
name = "csv",
description = "Transfers, comma separated (printed to stdout)",
arguments = ["JOURNAL_FILE"],
arguments = journalArgs,
},
{
name = "tsv",
description = "Transfers, tab separated (printed to stdout)",
arguments = ["JOURNAL_FILE"],
arguments = journalArgs,
},
{
name = "xlsx",
description = "XLSX file with all transfers (printed to stdout)",
arguments = ["JOURNAL_FILE"],
arguments = journalArgs,
},
{
name = "entries-by-account",
description = m%"
All individual deposits & withdrawals, grouped by account
"%,
arguments = ["JOURNAL_FILE"],
arguments = journalArgs,
},
{
name = "gplot",
description = m%"
Code and data for gnuplot impulse diagram
to visualize transfers of all accounts
"%,
arguments = ["JOURNAL_FILE"],
arguments = journalArgs,
},
{
name = "gplot-cumul",
description = m%"
Code and data for cumuluative gnuplot step chart
to visualize balance of all accounts
"%,
arguments = ["JOURNAL_FILE"],
arguments = journalArgs,
},
{
name = "unused-files",
description = m%"
Recursively list all files in a directory
which are not referenced in the journal
"%,
arguments = ["DIRECTORY", "JOURNAL_FILE"],
arguments =
[
{
name = "DIRECTORY",
description = "Path to the directory",
type = 'Text,
},
]
@ journalArgs,
},
{
name = "help",
description = "Print this help dialog",
arguments = ["JOURNAL_FILE"],
arguments = journalArgs,
},
{
name = "version",
description = "Print currently used version",
arguments = ["JOURNAL_FILE"],
arguments = journalArgs,
},
]
}
16 changes: 16 additions & 0 deletions examples/journal-only-transactions.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
# This file on its own is not valid,
# but it can be merged with other journals
transactions:
- utc: '2020-09-28 14:55'
note: Bread and butter
transfers:
- from: john:giro
to: bakery
amount: 7.64 £

- utc: '2021-02-13 07:29'
title: New sneakers
transfers:
- from: anna
to: evil-corp
amount: 122 £
Loading

0 comments on commit c0ba028

Please sign in to comment.