Seeing other people's input on this topic, I suppose that there are already
lots of other good ways to achieve the same thing. Shell aliases, shell
scripts, scripts in other languages, editor hacks, etc. are all far more
flexible, allowing multiple commands, parsing and processing of the output,
interactivity, and so on. Sure, they do tie you to a particular tool set,
limiting portability, but that's true no matter what: any system capable of
describing non-trivial reports is going to be so complex as to essentially
be a complete programming language, so we might as well just each pick an
existing language we like.

On Thu, Aug 4, 2016 at 11:13 AM, Simon Michael <si...@joyful.com> wrote:

> Josh Hanson <surely.you.j...@gmail.com> 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 <wyle...@gmail.com> 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 a topic in the
> Google Groups "Ledger" group.
> To unsubscribe from this topic, visit https://groups.google.com/d/to
> pic/ledger-cli/A2GD2VKEsuw/unsubscribe.
> To unsubscribe from this group and all its topics, send an email to
> ledger-cli+unsubscr...@googlegroups.com.
>
> For more options, visit https://groups.google.com/d/optout.
>

-- 

--- 
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 ledger-cli+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Reply via email to