Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

directives don't affect other journal files #510

Open
simonmichael opened this issue Feb 11, 2017 · 1 comment

Comments

Projects
None yet
2 participants
@simonmichael
Copy link
Owner

commented Feb 11, 2017

In the report linked at https://twitter.com/LedgerTips/status/830238616261586945, I wanted to apply some journal directives to affect formatting of the output. I expected this to work:

$ echo "commodity 0,000,000 bytes" > tarsnap.preamble.journal
$ hledger -f tarsnap.preamble.journal -f tarsnap.csv bal

It didn't, nor does hledger -f tarsnap.preamble.journal -f tarsnap.journal ..., because directives affect only the file they are in, and not other files specified with additional -f arguments.

Ideally, this would just work, but there might be some complexities. Should directives affect subsequent files on the command line, or all files specified ? Should they affect just journal files, or all file types ? Would some directives work differently from others ? (Eg some directives are location-independent and some are not.)


Want to back this issue? Post a bounty on it! We accept bounties via Bountysource.

@ony

This comment has been minimized.

Copy link
Collaborator

commented Feb 12, 2017

I thought this was a feature. You can have a separate file for your vacation expenses where you use different aliases. Note that includes inside of the file with directives will be affected also. This allows you to have a hierarchy of files and apply stuff only at some level.

Unless there will be directives like begin tag/end tag and begin alias/end alias I wouldn't like to loose such functionality.

Other option would be to use export or alike prefix for directives to make them global.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.