acc 0.4.1

plaintext double-entry accounting command line tool
Documentation
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
//! `accounts` flat mode — sorted, deduped, one account name per line.

use std::collections::BTreeSet;

use crate::loader::Journal;

pub(super) fn print(journal: &Journal) {
    for account in journal
        .transactions
        .iter()
        .flat_map(|tx| tx.value.postings.iter())
        .map(|p| p.value.account.as_str())
        .collect::<BTreeSet<&str>>()
    {
        println!("{}", account);
    }
}