Commit graph

320 commits

Author SHA1 Message Date
Alexis Hildebrandt
17189b8106 [fix] Make trim function trim trailing whitespace
std::isspace(*e) returns false for the end of c-string null-byte.

Bugzilla: 1106
2015-01-20 22:18:32 +01:00
Alexis Hildebrandt
1dd9dcaab4 Bump copyright notice to 2015
The following script makes it a no-brainer:
% NEXT_YEAR=2015; ag -l 'Copyright.*Wiegley' \
  | xargs sed -i '' -e "s/\(Copyright.*\)-20[0-9]\{2\}/\1-${NEXT_YEAR}/"
2014-12-27 11:24:55 +01:00
Stefano Zacchiroli
56976a127c make --columns default to terminal width, as returned by ioctl()
If set, the COLUMNS environment variable will take precedence over terminal
width. However, please note that COLUMNS is usually *not* exported by shells to
child processes, so in most cases COLUMNS will be undefined for ledger---hence
the motivation for this change.

Terminal width is queried using ioctl() on stdin. For the sake of portability
the querying is done only on platform where ioctl() is detected as supported at
compile-time.
2014-10-13 17:15:56 -04:00
Martin Michlmayr
7eeb2e2e18 Recognize --cleared-format option
Bug fix for #747
2014-05-30 22:14:48 -04:00
Martin Michlmayr
e367cfd895 Recognize the --no-pager option
Thanks to Johann Klähn.
2014-05-12 22:15:57 -04:00
Alexis Hildebrandt
2b9208e850 Bump copyright information to 2014 2014-02-02 12:36:22 +01:00
Johann Klähn
a875940a93 fix ledger xml output, remove ledger json command
As the format used by property trees to represent valid JSON
and that for valid XML is too different and given that there are
more requests for valid XML output I decided to pursue a quick fix
and remove the json command in favor of a working xml command.

See bug #782, #909, recent discussion on mailing list.

JSON support is postponed until I or someone else finds time to work on
this or the python bindings are more stable.
2013-03-08 22:56:01 +01:00
John Wiegley
0951bcebef Bump copyright information to 2013 2013-02-18 06:51:21 -06:00
John Wiegley
9e9d99e918 Removed an unnecessary if. Fixes #140 2013-01-31 04:56:12 -06:00
Craig Earls
0df1366168 Bug 634 Added roundto function, optimized floor and ceiling
Fixes Bug634 by adding roundto(amount, places).
2013-01-30 15:35:31 -07:00
Craig Earls
1b3dfa1297 Fixes regression error introduced by tags command patch
Not sure how the changes to the options got into the repot.cc file, but this takes the changes out.
2013-01-29 11:26:43 -07:00
Craig Earls
3e72a51dc3 Addes tags command and --values option
Tags command reports all metadat tags in use.  With the
values option it reports tags and their values.
2013-01-29 09:42:10 -07:00
Johann Klähn
d922f46595 fix bug 748: option aliases not recognized 2013-01-15 23:30:17 +01:00
Craig Earls
5c5c6463c7 Added missing break; statement in report.cc 2012-10-26 15:46:10 -07:00
Craig Earls
10180f0fff Added "draft" and "lisp" command synonyms 2012-10-26 13:33:27 -07:00
Craig Earls
b044a74bd3 Bug 634 and 488, Corrected behavior of floor, and added ceiling
This is only a partial fix for 634, since rounding is not fixed.
2012-10-25 22:28:26 -07:00
John Wiegley
4681e58d7f Converted the Ledger build system to use CMake 2012-05-20 04:48:05 -05:00
John Wiegley
7e8ba51cd0 Added a "json" report command 2012-05-18 01:38:39 -06:00
John Wiegley
a38ed141c1 Switched to Boost.PropertyTree for XML generation 2012-05-18 01:31:01 -06:00
John Wiegley
f4f3058b8c Switch to using Boost.Format 2012-05-14 21:44:00 -06:00
John Wiegley
6a5360e2b5 Make --detail a synonym for --rich-data 2012-04-13 15:16:24 -05:00
Martin Michlmayr
a47625be35 Make pricesdb an alias for pricedb for backwards compatibility with ledger 2
ledger 2.2 introduced the pricesdb command.  This was renamed to
pricedb in ledger 3.  Allow pricesdb as an alternative to pricedb
to provide backwards compatibility.

Fixes bug #728
2012-03-25 11:50:16 +01:00
John Wiegley
cd50fe0547 More improvements to nail_down; fixes #715 2012-03-19 00:41:32 -05:00
John Wiegley
f9088f8836 Added --verify-memory and missing TRACE_[CD]TOR calls 2012-03-18 01:01:30 -05:00
John Wiegley
f96a205c03 Make --days-of-week an alias for --dow 2012-03-17 05:55:11 -05:00
John Wiegley
37347bad56 Add experimental support for select queries 2012-03-13 10:35:08 -05:00
John Wiegley
c8dd3d28e3 Added --time-report option
This is a rather basic option at the moment which only affects the
balance report.  I use it as follows, for entering contractor hours into
a project planning application, where $1 is the contractor's timelog
file, and $2 is the date after which new entries appear in the file:

    ledger -f $1 balance                            \
           --account=payee                          \
           --time-report                            \
           -d "latest > [$2]"                       \
           --datetime-format='%m/%d/%y %I:%M %p'
2012-03-13 03:45:06 -05:00
John Wiegley
cb317f9d39 Added format_datetime valexpr function 2012-03-13 03:40:16 -05:00
John Wiegley
cf67fcbd06 Resolved a huge performance issue with 'pricedb' 2012-03-12 05:48:10 -05:00
John Wiegley
62c04deb87 Quieted several compiler warnings from Clang 2012-03-11 05:08:55 -05:00
John Wiegley
fad24d40f7 When --percent is used, disable --decimal-comma after parsing
Fixes #674
2012-03-11 04:02:52 -05:00
John Wiegley
363670d35b Tighten up argument passing related to fn_market() 2012-03-11 03:55:25 -05:00
John Wiegley
2303aa993c Allow balances to be passed to nail_down
Fixes #679
2012-03-11 03:06:50 -05:00
John Wiegley
0d9d845338 Corrected a rounding error in nail_down
Fixes #678
2012-03-11 03:06:03 -05:00
John Wiegley
6ddd935e4a --percent now plays well with -X and -V 2012-03-10 21:58:43 -06:00
John Wiegley
2a4d7e1af0 Added --immediate option 2012-03-10 21:58:28 -06:00
John Wiegley
860610fdaf Added --dc option, for debit/credit style reports 2012-03-10 21:34:51 -06:00
John Wiegley
7b45a664f2 Make --lot-notes the primary name, not --lot-tags 2012-03-10 21:33:31 -06:00
John Wiegley
02225a014a Give a better error when sequences are mis-indexed 2012-03-10 21:32:38 -06:00
John Wiegley
50f202c4e8 Make --lot-notes a synonym for --lot-tags 2012-03-10 01:01:26 -06:00
John Wiegley
77e9e3bfb9 Allow --budget-format to be used 2012-03-09 14:11:13 -06:00
John Wiegley
318b5f49ff Fixed the behavior of fn_nail_down 2012-03-09 07:02:53 -06:00
John Wiegley
59f5ebe2df Reworked the way that options are handled 2012-03-09 03:51:53 -06:00
John Wiegley
9f81c798ee fn_market can now accept a commodity name for arg 0 2012-03-08 01:08:08 -06:00
John Wiegley
113fb0ee6a Added --historical option 2012-03-08 01:00:16 -06:00
John Wiegley
21e8b7f6f0 Added nail_down() for pinning market value exprs 2012-03-08 00:55:06 -06:00
John Wiegley
b1107f85ae Removed value_t::price and balance_t::price 2012-03-07 10:32:24 -06:00
John Wiegley
b6adc8f460 Use unique_ptr instead of std::auto_ptr 2012-03-05 17:46:42 -06:00
John Wiegley
477a9106e3 Prettified some code in report.cc 2012-03-05 17:45:45 -06:00
John Wiegley
dc9ecc600a Guard against double-freeing of report objects 2012-03-05 15:17:59 -06:00