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

Passing negative values to ledger#entry errors. #163

Open
adamipc opened this issue Dec 4, 2024 · 1 comment · May be fixed by #164
Open

Passing negative values to ledger#entry errors. #163

adamipc opened this issue Dec 4, 2024 · 1 comment · May be fixed by #164

Comments

@adamipc
Copy link

adamipc commented Dec 4, 2024

When passing a negative value to ledger#entry such as 2024-12-04 employer income -500 checking you get an error Illegal option -5 because vim-ledger doesn't escape the parameters to ledger entry.

Example:

2024-12-03 Employer
	Income:Salary	-$500
	Assets:Checking

2024-12-04 employer -500

(Note: Yes, I know that in most cases if you organize your transactions such that you reverse the accounts you don't have to specify a negative value. But for some of my work it is clearer to provide negative values to some entries.)

This can be fixed by adding -- to the command line run before entry so that the rest of the arguments are not treated as possible options.

adamipc added a commit to adamipc/vim-ledger that referenced this issue Dec 4, 2024
@alerque
Copy link
Member

alerque commented Dec 4, 2024

PRs welcome. I use hledger not ledger so I don't use this particular command and it's hard to test, but if you get it working for yourself please do send a PR and I'll facilitate getting it put in.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants