If I understand you correctly ~/.ledgerrc should never contain --file or 
--include options, but only general options, and each project should be 
contained in its own folder. I still have couple of questions:
- when I have an  ~/.ledgerrc and another  .ledgerrc in project folder, is 
the second one loaded, assuming that working directory is  project folder 
when I invoke ledger? Which order?
- the documentation for include says "Include the stated file as if it were 
part of the current file. The file name can contain a wildcard (‘*’) to 
refer to multiple files (e.g. ‘bank/*.ledger’)" which is really useful. Is 
there any way to specify the working directory in .ledger or to use shell 
variables for include / file options?

TIA.
On Tuesday, October 24, 2023 at 7:03:37 PM UTC-4 Enrico Lamperti wrote:

> It's the expected behavior. Dotfiles in your home folder usually have 
> global settings, so having more than one is a bad practice. 
>
> You may have your common rules in it, and then in the directory where you 
> have each ledger file (e.g. `~/work` and `~/personal`) you can have another 
> `.ledgerrc` with specific settings for each project if you need.
>
> Also, instead of sourcing many files with `--file` you may use includes 
> <https://ledger-cli.org/doc/ledger3.html#index-include> in a main ledger 
> file, e.g.:
>
>     include accounts.ledger
>     include 2022.ledger
>     include 2023.ledger
>     include loans/friends.ledger
>
> Then you just have to specify this file with `--file` and all the others 
> will be included as you want.
>
> This could even simplify your two `.ledgerrc` files down to a single one, 
> because if you specify e.g. "--file main.ledger", I think it should work in 
> both directories.
>
>
> On Sun, Oct 22, 2023 at 3:00 PM lipp f <[email protected]> wrote:
>
>> $ find ~ -name \*.ledgerrc
>> /home/<user>/.ledgerrc
>> /home/<user>/t14.ledgerrc
>>
>> The default one supposed to be for myself and t14 for my business. 
>> Expecting to be completely separated. Each file has one or more --file 
>> entry, no overlap.
>>
>>
>> $ ledger -i ~/t14.ledgerrc stats 
>> and
>> $ ledger -i ~/.ledgerrc stats
>>
>> show actually only the default data, never the t14. 
>>
>> I was expecting that whenever an init file is specified, the default one 
>> wouldn't be used. Is this a bug?
>>
>> -- 
>>
>> --- 
>> 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/dd183690-c70b-45d4-a881-87080cf5c510n%40googlegroups.com
>>  
>> <https://groups.google.com/d/msgid/ledger-cli/dd183690-c70b-45d4-a881-87080cf5c510n%40googlegroups.com?utm_medium=email&utm_source=footer>
>> .
>>
>

-- 

--- 
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/df713be2-b149-4a4a-bbfd-1d331a403ba0n%40googlegroups.com.

Reply via email to