Added a new --depth option
This commit is contained in:
parent
76be843201
commit
ac8e27a4b8
5 changed files with 9 additions and 3 deletions
|
|
@ -1,4 +1,4 @@
|
|||
.Dd February 24, 2009
|
||||
.Dd February 25, 2009
|
||||
.Dt ledger 1
|
||||
.Sh NAME
|
||||
.Nm ledger
|
||||
|
|
@ -120,6 +120,7 @@ See \fB\-\-basis\fR.
|
|||
.It Fl \-date-format Ar DATEFMT Pq Fl y
|
||||
.It Fl \-date-width Ar INT
|
||||
.It Fl \-debug Ar STR
|
||||
.It Fl \-depth Ar INT
|
||||
.It Fl \-deviation Pq Fl D
|
||||
.It Fl \-display Ar EXPR Pq Fl d
|
||||
.It Fl \-display-amount Ar EXPR
|
||||
|
|
|
|||
|
|
@ -46,7 +46,7 @@
|
|||
#ifndef _OPTION_H
|
||||
#define _OPTION_H
|
||||
|
||||
#include "scope.h"
|
||||
#include "interactive.h"
|
||||
|
||||
namespace ledger {
|
||||
|
||||
|
|
|
|||
|
|
@ -32,7 +32,6 @@
|
|||
#ifndef _PYINTERP_H
|
||||
#define _PYINTERP_H
|
||||
|
||||
#include "interactive.h"
|
||||
#include "session.h"
|
||||
|
||||
#if defined(HAVE_BOOST_PYTHON)
|
||||
|
|
|
|||
|
|
@ -434,6 +434,7 @@ option_t<report_t> * report_t::lookup_option(const char * p)
|
|||
case 'd':
|
||||
OPT(daily);
|
||||
else OPT(date_format_);
|
||||
else OPT(depth_);
|
||||
else OPT(deviation);
|
||||
else OPT_(display_);
|
||||
else OPT(display_amount_);
|
||||
|
|
|
|||
|
|
@ -313,6 +313,11 @@ public:
|
|||
on("%y-%b-%d");
|
||||
});
|
||||
|
||||
OPTION_(report_t, depth_, DO_(scope) {
|
||||
interactive_t args(scope, "l");
|
||||
parent->HANDLER(limit_).on(string("depth<=") + args.get<string>(0));
|
||||
});
|
||||
|
||||
OPTION_(report_t, deviation, DO() { // -D
|
||||
parent->HANDLER(display_total_).set_expr("amount_expr-total_expr/count");
|
||||
});
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue