Commit Graph

3467 Commits

Author SHA1 Message Date
Simon Michael
9d1ef010ac finish previous commit 2014-10-21 17:49:41 -07:00
Simon Michael
9416d12d8a --output -> --output-file/-o & --output-format/-O, refactor
Use two options and less surprising behaviour. Notes:
* a recognised suffix on the output file name can set the format
* but --output-format always wins
* -o - means stdout
* currently these are command-specific options on balance, print, register
* later, --output-file should become a global option
* and --output-format should be available at least on all commands which
  support multiple formats. Each command may support a different set of
  output formats, which should be listed in its command line help.
2014-10-21 17:14:37 -07:00
Simon Michael
827aaad08e hledger-balance-csv, hledger-print-csv: remove 2014-10-21 12:55:35 -07:00
Simon Michael
b6774f47a3 balance, print: add -o and CSV output here too
Not very elegant yet, but works.
2014-10-21 12:02:23 -07:00
Simon Michael
2dc44cb131 register command cleanups 2014-10-21 12:01:47 -07:00
Simon Michael
b542da133c cli: add csv dependency 2014-10-20 13:09:41 -07:00
Simon Michael
d234663b6d register: add -o/--output option, merge CSV functionality (cf #206) 2014-10-20 13:04:36 -07:00
Simon Michael
301f506486 the --format option shall be known as "line format" 2014-10-20 13:03:44 -07:00
Simon Michael
7f6cf1f849 balance, register, register-csv: depth 0 shows summary items (#206)
Previously, a depth:0 query produced an empty report (since there are no
level zero accounts). Now, it aggregates all data into one summary item
with account name "...".

This makes it easier to see the kind of data Gwern was looking for from
register-csv (net worth over time). Eg this shows one line per month
summarising the total of assets and liabilities:

hledger register-csv -- -MHE ^assets ^liabilities depth:0

Single and multi-column balance reports behave similarly.
2014-10-19 17:53:20 -07:00
Simon Michael
0620ec9840 fix redundant compilation in the hledger packages, at last
This seems to work well now with my haddock and GHC 7.8.
Not tested with GHC 7.6 though.
2014-10-19 09:37:18 -07:00
Simon Michael
f4842726e0 tools: fix warnings in simplebench 2014-10-19 09:34:46 -07:00
Simon Michael
6d67bcb026 cli: --version shows "dev build" when VERSION is undefined
Probably only noticeable in GHCI.
2014-10-18 12:36:27 -07:00
Simon Michael
e8a58d9388 cli: add a hidden --version+ flag showing number representation (#118) 2014-10-18 12:35:58 -07:00
Simon Michael
3b70362525 switch to Decimal for representing quantities (closes #118)
hledger has represented quantities with floating point (Double) until
now.  While this has been working fine in practice, the time has come to
upgrade our number representation to something more principled: Decimal,
for now. As a bonus, this brings a ~30% speed boost to most reports.

We'll keep the old representation(s) around for a while, selectable via
hledger-lib cabal flag, for research/testing/benchmarking purposes. To
build with the old Double representation: cabal install -fdouble
hledger-lib hledger hledger-web
2014-10-18 12:33:31 -07:00
Simon Michael
5f32855040 tools: make allcabal* -> make cabal* 2014-10-18 11:17:02 -07:00
Simon Michael
e888be0bf4 clarify similarAmountsOp doc 2014-10-18 10:45:17 -07:00
Simon Michael
c2644f4c48 web: clean up warnings 2014-10-18 10:35:04 -07:00
Simon Michael
2b39f68682 fix a warning in TransactionsReports 2014-10-18 10:32:01 -07:00
Simon Michael
6c0975be81 tools: document ghci*, repl* rules 2014-10-18 10:20:32 -07:00
Simon Michael
4ec9bc4c53 tools: make uninstall, reduces noise when testing
Tries to unregister all three hledger packages from the user's package
db (not cabal sandbox aware).
2014-10-18 10:19:00 -07:00
Simon Michael
33499a9957 tools: more selective make clean* 2014-10-18 10:18:36 -07:00
Simon Michael
84a90374b4 make build warnings consistent 2014-10-18 10:16:22 -07:00
Simon Michael
6a23ea87cc tools: make clean avoid sandboxes 2014-10-18 09:30:53 -07:00
Simon Michael
7a13934968 hledger-register-csv: print multiple commodities on one line (#206)
When posting amounts or the running total contain more than one
commodity, register-csv now prints them comma-separated on one line,
instead of on multiple lines breaking the CSV output.

This is may not be ideal for CSV consumers; alternatives include
failing with an error, adding columns for additional commodities,
ignoring all but one commodity.
2014-10-17 17:06:47 -07:00
Simon Michael
e6bd0a3bde extra/hledger-register-csv: accept -H/-A/-r (#206)
hledger-register-csv.hs now accepts the same -H, -A and -r flags that
register does (but not -w, which wouldn't make sense).

Note: remember, when running add-ons with the hledger executable, most
add-on command flags must be preceded by --. So it's:

$ hledger register-csv -- -H
2014-10-17 16:47:26 -07:00
Simon Michael
69f53f768f extra/hledger-register-csv: clarify last field heading 2014-10-17 16:46:58 -07:00
Simon Michael
1e54797d49 extra/hledger-register-csv: fix breakage from aa85e786 2014-10-17 16:31:58 -07:00
gwern
d1618aaca8 strip trailing whitespace from all Haskell files 2014-10-14 18:48:24 -07:00
Simon Michael
22279978af revert an unnecessary "fix" in efe7c7a that broke tests 2014-09-13 21:28:48 -07:00
Simon Michael
a65116ae5e fix func. test numbering 2014-09-13 21:28:07 -07:00
Simon Michael
42a22be9b0 tools: fix tagrelease 2014-09-12 18:41:53 -07:00
Simon Michael
5d403c2bb7 doc: changelogs (resolve conflicts)
Conflicts:
	hledger-lib/CHANGES
	hledger-web/CHANGES
2014-09-12 18:41:35 -07:00
Simon Michael
53aee0e236 resolve conflict 2014-09-12 18:39:15 -07:00
Simon Michael
d7f1733243 remove text upper bound, allowing 1.2+ (fixes #207) 2014-09-12 18:36:23 -07:00
Simon Michael
efe7c7a029 journal: dates should be followed by whitespace or newline 2014-09-06 09:20:22 -07:00
Simon Michael
2992ce069d web: add form ignores trailing blank fields
Empty final account/amount fields are now ignored. Empty fields
followed by non-empty fields are not allowed.
2014-08-14 01:10:51 -07:00
Simon Michael
8d1ceb00f5 web: increase initial add form postings to four
We can't enable typeahead in dynamically added postings currently,
so increase the number of postings shown initially.
2014-08-14 00:55:51 -07:00
Simon Michael
834fef7389 web: add handler cleanup, rename vars 2014-08-14 00:26:22 -07:00
Simon Michael
6bf599ae9e tools: dev setup/test updates 2014-08-13 17:48:24 -07:00
Simon Michael
2d6b2008f5 tools: "make check" tests the dev environment
Fed up with GHC/cabal constantly assaulting me like Cato in a Pink
Panther movie, here are some shell tests to give me some
warning/reassurance about the dev setup on various machines.
Thou Shalt Not Reimplement Autoconf, but perhaps a little cross-platform
test suite focussed on my needs is a reasonable idea.
2014-08-13 15:44:11 -07:00
Simon Michael
776a973d2c cli: clarify --debug help 2014-08-08 19:12:20 -07:00
Simon Michael
69da28d9b9 doc: more manual changes from wiki 2014-08-08 19:10:18 -07:00
Simon Michael
0ad24be353 doc: merge latest manual changes from wiki 2014-08-08 18:39:37 -07:00
Simon Michael
aa85e786b9 register: describe datespans briefly, like balance
Eg instead of 2014/01/01 - 2014/01/31, show 2014/01, as in a multicolumn
balance report. The data model is not very elegant, but works for now.
2014-08-08 07:34:11 -07:00
Simon Michael
e2d3ab0002 docs: note --average limitation 2014-08-08 07:29:02 -07:00
Simon Michael
c485017ca6 journal: require consistent separators in a Y/M/D date
Date separators can be /, - or . but only one kind should be used in
each date. Eg we now reject 2014-8/1.
2014-08-08 07:29:02 -07:00
Simon Michael
3e27f4fb8b journal: add p suffix to date[time] parsers 2014-08-08 07:29:02 -07:00
Simon Michael
a0010a294f cli: smart dates must use a consistent separator
Along with the preceding commits, this means that date:2014-8/1 is now
parsed as 2014/01/01-2014/08/01 as intended, not 2014/08/01.
2014-08-08 07:21:02 -07:00
Simon Michael
632dee668d parse period expressions and date: more strictly
Period expressions and date: query terms must now be parseable all the
way to their end; we won't ignore unparseable trailing bits.
2014-08-08 07:21:02 -07:00
Simon Michael
a675b99870 query: report an error when date:D fails to parse
Previously, a date:D query term was just ignored if D could not be
parsed as a date.
2014-08-08 07:21:02 -07:00