Josh Hanson <[email protected]> writes:
>>> The syntax for the directive might be:
>>> *report <name of report> <ledger command line arguments>*To run the
>> report,
>>> you'd run at the command line: *ledger report <name of report>*

I think it's a pretty attractive idea.

Pro:

- report commands are detailed and hard to recall. Saving them
  (in a standard, easily accessible, cross-platform way) is good.

- they are often quite specific to a journal. Having them version-controlled and refactorable together is good.

Con:

- your proposal allows only single ledger commands. It could allow arbitrary command lines too I guess.

- reports expressed as command lines are fairly specific to the cli, not so good for other uis (I'm thinking of hledger-ui and hledger-web). I wonder if there's a more portable way to describe them.

- some report commands are generic and you may not want to redeclare them in every journal you work with, creating a maintenance task. Where to put those ?

I was thinking of a different scheme: aliases (not just reports) defined in the user's config, which can run arbitrary command lines, just like git does it.

Richard Lawrence <[email protected]> wrote:
>> I do wonder if ledger itself is the best place to implement it, though.
>> You can already mostly achieve what you want with shell aliases.  That's
>> what I do.

Me too. I have many shell aliases (and when I must, functions), defined in a single bashrc file kept alongside journals. I tend to forget what's in there and they get out of date easily. I suppose a more specific JOURNALFILE.bashrc might be good. Shell scripts are harder to share with others, eg windows and non-bash users.

nx wrote:
Might be better to have a link to a repo on the plaintextaccounting.org
site with shellscripts for running complex reports.

+1


--

--- You received this message because you are subscribed to the Google Groups "Ledger" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
For more options, visit https://groups.google.com/d/optout.

Reply via email to