acc 0.3.2

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
//! `codes` command — list every distinct transaction code used in
//! the journal, one per line, sorted. Runs after the filter phase.

use std::collections::BTreeSet;

use crate::loader::Journal;

pub fn run(journal: &Journal) {
    for code in journal
        .transactions
        .iter()
        .filter_map(|tx| tx.value.code.as_deref())
        .collect::<BTreeSet<&str>>()
    {
        println!("{}", code);
    }
}