allow aliases to be defined within account declarations
Ledger's account directive supports various subdirectives, which our account directive currently ignores.
I'd like to have support for the alias subdirective, to begin with. This is an alternative to the top-level alias directive. Eg:
account A
alias B
alias C
creates aliases like:
alias B = A
alias C = A
If you want to alias multiple accounts to a new name A, say for tax reporting, the advantage is that A's name can be written just once instead of in multiple places which must be kept in sync.
Code: https://github.com/simonmichael/hledger/blob/1.18/hledger-lib/Hledger/Read/JournalReader.hs#L349
On the downside, currently the only way to apply a bunch of aliases temporarily is to insert/uncomment them, and this new style would seem to make it harder to enable/disable them as a block.
Well actually, in my tax reporting use case I'd be commenting the account directives too, so it's not a problem.
Hello @mildred - in 2019 on #217 you were interested in adding this feature to hledger (declaring aliases with account declarations) - are you still ? We'd still like to add this feature.
For the record I should note the complication also noted for #1389: multi-file setups sometimes want/need duplicated account declarations, so when we add more features to the account directive we need to consider what happens in that case. Eg perhaps if there's multiple declarations of an account, the subdirectives/tags from all of them are combined.