bin: add-ons compile script

This commit is contained in:
Simon Michael 2017-01-08 10:24:33 -08:00
parent a22d56ee28
commit 031cad9497
7 changed files with 39 additions and 28 deletions

View File

@ -1,13 +1,23 @@
hledger add-on commands, hledger-related scripts, developer builds.
Scripts named hledger-* are hledger add-on commands. You can run them directly,
or via "hledger [HLEDGEROPTS] ADDONCMD [-- ADDONOPTS]". You should:
1. add this directory to your $PATH
2. ensure the scripts have executable permission (they should already, at least on unix)
3. optionally, compile them for quicker startup
See also: http://hledger.org/hledger.html#add-on-commands
Scripts named hledger-* are hledger add-on commands. The ones in this
bin/ directory are tested along with hledger, but shipped as add-ons
rather than built-in commands because they are experimental, or
for some other reason.
Other hledger-related scripts include bash aliases, makefile examples, etc.
Add this directory to your $PATH and they will show up as commands
listed by hledger (or, you can run them directly).
To speed them up (recommended), compile them:
hledger development-related binaries also are stored here, such as
old versions for benchmarking, and platform-specific binaries.
$ bin/compile.sh
When using hledger to run add-on commands, remember to use a --
before add-on-specific options or hledger will complain. Like so:
$ hledger [HLEDGEROPTS] ADDONCMD [-- ADDONOPTS]
See also http://hledger.org/hledger.html#add-on-commands .
hledger-related bash scripts, example make rules etc. are also kept here.
And hledger developer binaries may get stored here,
such as old versions for benchmarking, and platform-specific binaries.

8
bin/compile.sh Executable file
View File

@ -0,0 +1,8 @@
#!/bin/sh
cd "$(dirname "$0")"
echo "building dependencies"
stack build hledger
echo "building add-on commands"
for f in hledger-*.hs; do stack ghc $f; done
echo "add-on commands available:"
ls -F hledger-* | grep -vE '\.(hs|hi|o)'

View File

@ -3,15 +3,16 @@
--package hledger-lib
--package hledger
-}
-- You can compile this script for speed:
-- stack build hledger && stack ghc bin/hledger-check-dates.hs
{-
{-|
hledger-check-dates [--strict] [--date2] [-f JOURNALFILE]
Check that transactions' date are monotonically increasing.
Reads the default or specified journal.
|-}
With --strict, dates must also be unique.
With --date2, checks transactions' secondary dates.
Reads the default journal file, or another specified with -f.
-}
import Hledger
import Hledger.Cli

View File

@ -4,10 +4,8 @@
--package hledger
--package time
-}
-- You can compile this script for speed:
-- stack build hledger && stack ghc bin/hledger-equity.hs
{-
hledger-equity [HLEDGEROPTS] [QUERY]
Show a "closing balances" transaction that brings the balance of the

View File

@ -3,10 +3,8 @@
--package hledger-lib
--package hledger
-}
-- You can compile this script for speed:
-- stack build hledger && stack ghc bin/hledger-print-unique.hs
{-
hledger-print-unique [-f JOURNALFILE | -f-]
Print only journal entries which are unique by description (or

View File

@ -4,10 +4,8 @@
--package hledger
--package text
-}
-- You can compile this script for speed:
-- stack build hledger && stack ghc bin/hledger-register-match.hs
{-
{-|
hledger-register-match DESC
A helper for ledger-autosync. This prints the one posting whose transaction
@ -15,7 +13,7 @@ description is closest to DESC, in the style of the register command.
If there are multiple equally good matches, it shows the most recent.
Query options (options, not arguments) can be used to restrict the search space.
|-}
-}
{-# LANGUAGE OverloadedStrings #-}

View File

@ -5,10 +5,8 @@
--package megaparsec
--package text
-}
-- You can compile this script for speed:
-- stack build hledger && stack ghc bin/hledger-rewrite.hs
{-
{-|
hledger-rewrite [PATTERNS] --add-posting "ACCT AMTEXPR" ...
A start at a generic rewriter of journal entries.
@ -32,7 +30,7 @@ TODO:
- should apply the rule for each matched posting within a transaction, if there's more than one
- should be possible to use this on unbalanced entries, eg while editing one
|-}
-}
import qualified Data.Text as T
-- hledger lib, cli and cmdargs utils