Skip to content

New "-V" flag behavour not reverse compatible when combined with "--end" flag #1083

@trevorld

Description

@trevorld

In particular in hledger the "-V" when combined with the "--end" flag used to only use price directives up to the end date to determine market value but now it also uses price directives after the end flag.

Example:

$ cat error.hledger 

P 2016/01/01 00:00:00 SP                        250 USD
P 2017/01/01 00:00:00 SP                        500 USD

2016-01-01 * Brokerage | Buy Stock
  Assets:Checking  4 SP @ 250 USD
  Equity:Opening  -1000 USD
$ hledger -f error.hledger register -V --end=2016-12-31
2016/01/01 Brokerage | Buy Stock                                                 Assets:Checking                                                           2000 USD      2000 USD
                                                                                 Equity:Opening                                                           -1000 USD      1000 USD
$ hledger -f error.hledger register -V --end=2017-12-31
2016/01/01 Brokerage | Buy Stock                                                 Assets:Checking                                                           2000 USD      2000 USD
                                                                                 Equity:Opening                                                           -1000 USD      1000 USD

The old behaviour used to be equivalent to the new "--value=END-DATE" behaviour:

$ hledger -f error.hledger register --value=2016-12-31
2016/01/01 Brokerage | Buy Stock                                                 Assets:Checking                                                           1000 USD      1000 USD
                                                                                 Equity:Opening                                                           -1000 USD             0

Is this new "-V" combined with "--end=YYYY-MM-DD" behaviour considered a bug that will be fixed? Or do I need to update r-ledger to detect which version of hledger is being used and if the version is new enough use the -value=END-DATE and if older instead use -V --end=END-DATE?

Metadata

Metadata

Assignees

No one assigned

    Labels

    A-BUGSomething wrong, confusing or sub-standard in the software, docs, or user experience.balancedocsDocumentation-related.printregister

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions