Skip to content

Fix double dash#2542

Open
schoettl wants to merge 1 commit intosimonmichael:masterfrom
schoettl:fix-double-dash
Open

Fix double dash#2542
schoettl wants to merge 1 commit intosimonmichael:masterfrom
schoettl:fix-double-dash

Conversation

@schoettl
Copy link
Collaborator

@schoettl schoettl commented Jan 24, 2026

This fixes this problems:

  • discard -- from arguments to add command

It does not fix the that -5 gets translated --depth 5 even after --.

@schoettl
Copy link
Collaborator Author

schoettl commented Jan 24, 2026

  • run hledger tests locally
  • just functest – 5 failed test cases on NixOS, same on master
  • how about other commands?

I think the problem that double dash is passed as arg to some commands is hard to fix globally because the args are taken within the command's function (e.g. within add :: CliOpts -> Journal -> IO () here).

@schoettl
Copy link
Collaborator Author

schoettl commented Jan 24, 2026

It does not fix the that -5 gets translated --depth 5 even after --.

Looks like this isn't a problem at all:

$ hledger bal assets: -- -1
          123 €  assets:bank:yyy
          456 €  assets:prepaid:gifts
--------------------
          123456 €  

So in this example, -1 isn't interpreted as option because it's after a double dash. Hence it isn't converted to --depth 1.

But the balance command as well misinterprets the double dash. It should be discarded there, too.

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 this pull request may close these issues.

1 participant