I've seen #1013 and that covers some of my issue, but the scope is still not right, so here I am...
I've just setup a couple more projects using plain text accounting and am now pretty aggravated with needing different commands for the same workflow in different projects.
Out of the box hledger has a user oriented scope. It assumes that the user is going to be doing one thing with their journals no matter where they call it from. This is strongly reflected in the LEDGER_FILE default walue that is relative to the $HOME directory. Instead of using the current directory and moving up the tree looking for a project root, then eventually stopping on the user directory if reached, it jumps straight to taking it's queues from the $USER. This might be convenient for some folks, but not for me. All my PTA projects are in specific directories and tracked as Git repositories.
When you run git diff, you expect it to operate in the current project, using setting first from .git/config and then falling back to ~/.gitconfig and /etc/.... I have some project with specific filters that help process files into a format that can be diffed, e.g. for diffing binary file types using speciall tooling. It doesn't matter what project I clone or what system I do it on, git diff comes ready to run for that project.
Not so with hledger that at the very least needs to have a file name specified via -f. I tried for a while to try to keep the main entry point ledger for all projects named the same thing so I could alias hledger='hledger -f main.ledger', but working with projects in other languages that has proved unattainable. There are solutions such as .env files and various utilities to load environment variables per project, but this requires all users of the project to use the same tooling in their shell (and that typically affects other projects). I've event tried setting up all projects with similar arg file sets, but again this just doesn't always work out.
It would be really nice if there was some file that could be placed in a project that would be found by ledger to at least set a default LEDGER_FILE. Perhaps this could be a default args file that is read that could include -f=filename.ledger perhaps other args.
I've seen #1013 and that covers some of my issue, but the scope is still not right, so here I am...
I've just setup a couple more projects using plain text accounting and am now pretty aggravated with needing different commands for the same workflow in different projects.
Out of the box
hledgerhas a user oriented scope. It assumes that the user is going to be doing one thing with their journals no matter where they call it from. This is strongly reflected in theLEDGER_FILEdefault walue that is relative to the$HOMEdirectory. Instead of using the current directory and moving up the tree looking for a project root, then eventually stopping on the user directory if reached, it jumps straight to taking it's queues from the$USER. This might be convenient for some folks, but not for me. All my PTA projects are in specific directories and tracked as Git repositories.When you run
git diff, you expect it to operate in the current project, using setting first from.git/configand then falling back to~/.gitconfigand/etc/.... I have some project with specific filters that help process files into a format that can be diffed, e.g. for diffing binary file types using speciall tooling. It doesn't matter what project I clone or what system I do it on,git diffcomes ready to run for that project.Not so with
hledgerthat at the very least needs to have a file name specified via-f. I tried for a while to try to keep the main entry point ledger for all projects named the same thing so I couldalias hledger='hledger -f main.ledger', but working with projects in other languages that has proved unattainable. There are solutions such as.envfiles and various utilities to load environment variables per project, but this requires all users of the project to use the same tooling in their shell (and that typically affects other projects). I've event tried setting up all projects with similar arg file sets, but again this just doesn't always work out.It would be really nice if there was some file that could be placed in a project that would be found by
ledgerto at least set a defaultLEDGER_FILE. Perhaps this could be a default args file that is read that could include-f=filename.ledgerperhaps other args.