summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJohn Wiegley <johnw@newartisans.com>2005-02-14 07:44:32 +0000
committerJohn Wiegley <johnw@newartisans.com>2008-04-13 02:40:59 -0400
commit65b21818607da7a38f4aba03c9c843891056f76b (patch)
tree427f127c0e75c06bafe451fbb9228d395c6aec89
parent873c68b234ed03066de71800a8e49e9e3ae12b66 (diff)
downloadfork-ledger-65b21818607da7a38f4aba03c9c843891056f76b.tar.gz
fork-ledger-65b21818607da7a38f4aba03c9c843891056f76b.tar.bz2
fork-ledger-65b21818607da7a38f4aba03c9c843891056f76b.zip
Added new --head and --tail options, which control how many *entries*
are displayed in a register report or print report. The UNIX commands "head" and "tail" can be used to control how many transactions are displayed.
-rw-r--r--config.cc11
-rw-r--r--config.h2
2 files changed, 13 insertions, 0 deletions
diff --git a/config.cc b/config.cc
index ea9c235e..baf244b3 100644
--- a/config.cc
+++ b/config.cc
@@ -46,6 +46,9 @@ config_t::config_t()
#endif
pricesdb_format = "P %[%Y/%m/%d %H:%M:%S] %A %t\n";
+ head_entries = 0;
+ tail_entries = 0;
+
show_collapsed = false;
show_subtotal = false;
show_totals = false;
@@ -714,6 +717,14 @@ OPT_BEGIN(wide, "w") {
config.register_format = config.wide_register_format;
} OPT_END(wide);
+OPT_BEGIN(head, ":") {
+ config.head_entries = std::atoi(optarg);
+} OPT_END(head);
+
+OPT_BEGIN(tail, ":") {
+ config.tail_entries = std::atoi(optarg);
+} OPT_END(tail);
+
OPT_BEGIN(empty, "E") {
config.show_empty = true;
} OPT_END(empty);
diff --git a/config.h b/config.h
index 6343be6f..4d06bd2e 100644
--- a/config.h
+++ b/config.h
@@ -51,6 +51,8 @@ struct config_t
std::string reconcile_date;
unsigned long budget_flags;
unsigned long pricing_leeway;
+ int head_entries;
+ int tail_entries;
bool show_collapsed;
bool show_subtotal;
bool show_totals;