Skip to content

Commit ac26388

Browse files
committed
;doc: register: Add new --drop flag with usage example
1 parent dd2555f commit ac26388

File tree

1 file changed

+12
-0
lines changed

1 file changed

+12
-0
lines changed

hledger/Hledger/Cli/Commands/Register.md

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,7 @@ Flags:
1717
description closest to DESC
1818
-r --related show postings' siblings instead
1919
--invert display all amounts with reversed sign
20+
--drop=N omit N leading account name parts
2021
--sort=FIELDS sort by: date, desc, account, amount, absamount,
2122
or a comma-separated combination of these. For a
2223
descending sort, prefix with -. (Default: date)
@@ -72,6 +73,8 @@ $ hledger register checking -b 2008/6 --historical
7273

7374
The `--depth` option limits the amount of sub-account detail displayed.
7475

76+
The `--drop` option will trim leading segments from account names.
77+
7578
The `--average`/`-A` flag shows the running average posting amount
7679
instead of the running total (so, the final number displayed is the
7780
average for the whole report period). This flag implies `--empty` (see below).
@@ -141,6 +144,15 @@ will be adjusted outward if necessary to contain a whole number of
141144
intervals. This ensures that the first and last intervals are full
142145
length and comparable to the others in the report.
143146

147+
If you have a deeply nested account tree some reports might benefit from trimming
148+
leading segments from the account names using `--drop`.
149+
150+
```cli
151+
$ hledger register --monthly income --drop 1
152+
2008/01 salary $-1 $-1
153+
2008/06 gifts $-1 $-2
154+
```
155+
144156
With `-m DESC`/`--match=DESC`, register does a fuzzy search for one recent posting
145157
whose description is most similar to DESC.
146158
DESC should contain at least two characters.

0 commit comments

Comments
 (0)