mirror of
https://github.com/simonmichael/hledger.git
synced 2024-09-18 17:57:11 +03:00
move add-ons and scripts to bin/
This commit is contained in:
parent
e7f6bfa273
commit
34ec7406a1
1
.gitignore
vendored
1
.gitignore
vendored
@ -1,6 +1,5 @@
|
||||
.*
|
||||
_*
|
||||
bin/*
|
||||
cabal-dev*
|
||||
cabal.sandbox.config
|
||||
*/dist/
|
||||
|
20
bin/README
20
bin/README
@ -1,9 +1,13 @@
|
||||
Interesting/historical binaries are kept here, such as:
|
||||
hledger add-on commands, hledger-related scripts, developer builds.
|
||||
|
||||
- Optimised cabal builds, copied here from cabal's bin directory.
|
||||
- Old versions, with the -X.Y suffix. Used for performance benchmarking.
|
||||
- Builds for other platforms, with a -PLATFORM-ARCH suffix, maybe compressed for download.
|
||||
- Non-optimised developer builds compiled with make (*dev).
|
||||
Used during development for quicker, multi-package, and on-change compilation.
|
||||
- cabal and/or make builds with profiling enabled (*-prof).
|
||||
Used for investigating time and space usage.
|
||||
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
|
||||
|
||||
Other hledger-related scripts include bash aliases, makefile examples, etc.
|
||||
|
||||
hledger development-related binaries also are stored here, such as
|
||||
old versions for benchmarking, and platform-specific binaries.
|
||||
|
@ -6,8 +6,8 @@
|
||||
--package text
|
||||
-}
|
||||
-- To run or compile this script, it's easiest to be in the hledger source tree. Then:
|
||||
-- To run it directly: extra/hledger-rewrite.hs ARGS
|
||||
-- To compile it: stack build hledger --only-dependencies && stack ghc extra/hledger-rewrite.hs
|
||||
-- To run it directly: bin/hledger-rewrite.hs ARGS
|
||||
-- To compile it: stack build hledger --only-dependencies && stack ghc bin/hledger-rewrite.hs
|
||||
|
||||
{-|
|
||||
hledger-rewrite [PATTERNS] --add-posting "ACCT AMTEXPR" ...
|
||||
@ -31,6 +31,7 @@ Related: https://github.com/simonmichael/hledger/issues/99
|
||||
|
||||
TODO:
|
||||
- should allow regex matching and interpolating matched name in replacement
|
||||
- should apply all matching rules to a transaction, not just one
|
||||
- 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
|
||||
|
@ -1 +1 @@
|
||||
Extra stuff: less-maintained add-ons, custom report scripts, shell aliases, make rules...
|
||||
"Extra" stuff, such as the old hledger-chart package.
|
||||
|
@ -884,7 +884,7 @@ $ LEDGER_FILE=unique.journal hledger print-unique
|
||||
## rewrite
|
||||
Prints all journal entries, adding specified custom postings to matched entries.
|
||||
|
||||
[hledger-rewrite.hs](https://github.com/simonmichael/hledger/blob/master/extra/hledger-rewrite.hs),
|
||||
[hledger-rewrite.hs](https://github.com/simonmichael/hledger/blob/master/bin/hledger-rewrite.hs),
|
||||
in hledger's extra directory (compilation optional), adds postings to existing transactions,
|
||||
optionally with an amount based on the existing transaction's first amount. See the script for more details.
|
||||
|
||||
|
@ -316,7 +316,7 @@ $ make test -n
|
||||
&& echo pkgtest PASSED) || echo pkgtest FAILED
|
||||
(stack exec hledger test \
|
||||
&& echo builtintest PASSED) || echo builtintest FAILED
|
||||
(COLUMNS=80 PATH=`pwd`/bin:/home/simon/src/hledger/bin:/home/simon/src/hledger/extra:/home/simon/.local/bin:/home/simon/.cabal/bin:/opt/ghc/7.10.1/bin:/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/usr/games:/usr/local/games:/var/lib/gems/1.9.1/bin stack exec -- shelltest --execdir -- -j16 --hide-successes tests \
|
||||
(COLUMNS=80 PATH=`pwd`/bin:/home/simon/src/hledger/bin:/home/simon/.local/bin:/home/simon/.cabal/bin:/opt/ghc/7.10.1/bin:/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/usr/games:/usr/local/games:/var/lib/gems/1.9.1/bin stack exec -- shelltest --execdir -- -j16 --hide-successes tests \
|
||||
&& echo functest PASSED) || echo functest FAILED
|
||||
```
|
||||
|
||||
|
@ -96,13 +96,13 @@ See also the two Twitter feeds:
|
||||
- [ledger-autosync](https://bitbucket.org/egh/ledger-autosync) downloads/converts/deduplicates OFX data
|
||||
- [hledger-chart](http://hackage.haskell.org/package/hledger-chart) generates simple pie charts (unmaintained)
|
||||
- [hledger-vty](http://hackage.haskell.org/package/hledger-vty) a simple curses-style UI (unmaintained)
|
||||
- More in [extra/](https://github.com/simonmichael/hledger/tree/master/extra/)
|
||||
- More in [bin/](https://github.com/simonmichael/hledger/tree/master/bin/)
|
||||
|
||||
## Scripting examples
|
||||
|
||||
- <https://gist.github.com/4172604> printing average expenses by month
|
||||
- <https://gist.github.com/4210558> calculating historical account balances
|
||||
- More in [extra/](https://github.com/simonmichael/hledger/tree/master/extra/)
|
||||
- More in [bin/](https://github.com/simonmichael/hledger/tree/master/bin/)
|
||||
|
||||
## Similar projects
|
||||
|
||||
|
@ -138,7 +138,7 @@ Simon Michael, Johannes Gerer, Nikolay Orlyuk, Shubham Lagwankar.
|
||||
|
||||
- fix non-existent "oldtime" dependency ([#431](http://bugs.hledger.org/431))
|
||||
|
||||
- [hledger-equity.hs](https://github.com/simonmichael/hledger/blob/master/extra/hledger-equity.hs) now generates valid journal format when there are multiple commodities
|
||||
- [hledger-equity.hs](https://github.com/simonmichael/hledger/blob/master/bin/hledger-equity.hs) now generates valid journal format when there are multiple commodities
|
||||
|
||||
### hledger-ui 1.1
|
||||
|
||||
|
@ -1,7 +1,7 @@
|
||||
# Tests for equity addon
|
||||
|
||||
# Simple case
|
||||
runghc ../../extra/hledger-equity.hs -f- -p 2016 assets liabilities
|
||||
runghc ../../bin/hledger-equity.hs -f- -p 2016 assets liabilities
|
||||
<<<
|
||||
2016/1/1 open
|
||||
assets:bank $100
|
||||
@ -35,7 +35,7 @@ runghc ../../extra/hledger-equity.hs -f- -p 2016 assets liabilities
|
||||
>>>=0
|
||||
|
||||
# Verify effect of period
|
||||
runghc ../../extra/hledger-equity.hs -f- -p 2016 assets liabilities
|
||||
runghc ../../bin/hledger-equity.hs -f- -p 2016 assets liabilities
|
||||
<<<
|
||||
2015/12/31 open
|
||||
assets:bank $100
|
||||
@ -68,7 +68,7 @@ runghc ../../extra/hledger-equity.hs -f- -p 2016 assets liabilities
|
||||
|
||||
# # Tear transaction across periods
|
||||
# # TODO: clarify what should we see for this case
|
||||
# runghc ../../extra/hledger-equity.hs -f- -p 2016 assets liabilities
|
||||
# runghc ../../bin/hledger-equity.hs -f- -p 2016 assets liabilities
|
||||
# <<<
|
||||
# 2016/1/1 open
|
||||
# assets:bank $100
|
@ -1,7 +1,7 @@
|
||||
# Tests for rewrite addon
|
||||
|
||||
# Add proportional income tax (from documentation)
|
||||
runghc ../../extra/hledger-rewrite.hs -f- ^income --add-posting '(liabilities:tax) *.33'
|
||||
runghc ../../bin/hledger-rewrite.hs -f- ^income --add-posting '(liabilities:tax) *.33'
|
||||
<<<
|
||||
2016/1/1 paycheck
|
||||
income:remuneration $-100
|
||||
@ -23,7 +23,7 @@ runghc ../../extra/hledger-rewrite.hs -f- ^income --add-posting '(liabilities:ta
|
||||
>>>=0
|
||||
|
||||
# Duplicate posting for budgeting (from documentation)
|
||||
runghc ../../extra/hledger-rewrite.hs -f- expenses:gifts --add-posting '(budget:gifts) *-1'
|
||||
runghc ../../bin/hledger-rewrite.hs -f- expenses:gifts --add-posting '(budget:gifts) *-1'
|
||||
<<<
|
||||
2016/1/1 withdraw
|
||||
assets:cash $20
|
||||
@ -45,7 +45,7 @@ runghc ../../extra/hledger-rewrite.hs -f- expenses:gifts --add-posting '(budget:
|
||||
>>>=0
|
||||
|
||||
# Add absolute bank processing fee
|
||||
runghc ../../extra/hledger-rewrite.hs -f- assets:bank and 'amt:<0' --add-posting 'expenses:fee $5' --add-posting 'assets:bank $-5'
|
||||
runghc ../../bin/hledger-rewrite.hs -f- assets:bank and 'amt:<0' --add-posting 'expenses:fee $5' --add-posting 'assets:bank $-5'
|
||||
<<<
|
||||
2016/1/1 withdraw
|
||||
assets:cash $20
|
Loading…
Reference in New Issue
Block a user