On Mon, 2021-09-13 at 08:52 -0700, Felipe Mica wrote: > Why > > ledger bal --depth 4 --depth 1 > > Makes 1 overwrite 4, but: > > ledger bal --depth 4 --depth 6 > > 6 doesn't overwrite 4? > > Is it a reason for that or it is a bug? It's a weird behavior for me.
Leaving out whether or not this behavior makes sense, what's happening here is as follows: The commandline options are processed in series and each "filter" gets applied one after the other. The reason `--depth 6` doesn't "overwrite" `--depth 4` is that after applying `--depth 4`, only accounts with up to 4 levels are still in the list so the `--depth 6` filter does not even see any of the deeper-level accounts anymore. > On Sunday, September 12, 2021 at 4:07:41 AM UTC-3 Rahix wrote: > > Hi, > > > > On Sat, 2021-09-11 at 18:12 -0700, Felipe Mica wrote: > > > I put this in my .ledgerc file: > > > --depth 4 > > > > > > Now, if I do: > > > > > > ledger --depth 1 balance > > > > > > the ledger overwrites the option in the init file and shows only 1 depth. > > > That's the expected behavior. However, if put some depth bigger than the > > > defined 4 in the file, I would get only 4 > > > levels. > > > The option defined in the init file is used as "maximum" depth value, > > > which makes no sense to me. > > > > > > Am I missing something? > > > > I think what's happening here is that both --depth options get applied, > > one after the other. The following command behaves exactly the same: > > > > ledger bal --depth 4 --depth 1 > > > > The reason for this is closely tied to the way these "filters" are > > applied in ledger, so I think it isn't that easy to change this without > > introducing inconsistencies... > > > > However maybe open a bug on GH to discuss whether this should be changed > > in the future? I do see the appeal of having later --depth options > > overwrite any earlier ones, it does feel more sensible to me as well... > > -- Rahix -- --- You received this message because you are subscribed to the Google Groups "Ledger" group. To unsubscribe from this group and stop receiving emails from it, send an email to [email protected]. To view this discussion on the web visit https://groups.google.com/d/msgid/ledger-cli/5e26ad475d3b44e23a3844dcba804dda601691bd.camel%40rahix.de.
