diff --git a/hledger-lib/Hledger/Reports/ReportOptions.hs b/hledger-lib/Hledger/Reports/ReportOptions.hs index 2c4c199fa..486efae1f 100644 --- a/hledger-lib/Hledger/Reports/ReportOptions.hs +++ b/hledger-lib/Hledger/Reports/ReportOptions.hs @@ -458,7 +458,7 @@ flat_ = not . tree_ -- depthFromOpts opts = min (fromMaybe 99999 $ depth_ opts) (queryDepth $ queryFromOpts nulldate opts) -- | Convert this journal's postings' amounts to cost using their --- transaction prices, if specified by options (-B/--value=cost). +-- transaction prices, if specified by options (-B/--cost). -- Maybe soon superseded by newer valuation code. journalSelectingAmountFromOpts :: ReportOpts -> Journal -> Journal journalSelectingAmountFromOpts opts = case cost_ opts of diff --git a/hledger/Hledger/Cli/CliOptions.hs b/hledger/Hledger/Cli/CliOptions.hs index ef8031b97..4de85b284 100644 --- a/hledger/Hledger/Cli/CliOptions.hs +++ b/hledger/Hledger/Cli/CliOptions.hs @@ -156,7 +156,7 @@ reportflags = [ -- valuation ,flagNone ["B","cost"] (setboolopt "B") - "show amounts converted to their cost/selling amount, using the transaction price. Equivalent to --value=cost." + "show amounts converted to their cost/selling amount, using the transaction price." ,flagNone ["V","market"] (setboolopt "V") (unwords ["show amounts converted to period-end market value in their default valuation commodity." @@ -166,12 +166,11 @@ reportflags = [ (unwords ["show amounts converted to current (single period reports)" ,"or period-end (multiperiod reports) market value in the specified commodity." - ,"Equivalent to --value=now,COMM / --value=end,COMM." + ,"Equivalent to --value=end,COMM." ]) ,flagReq ["value"] (\s opts -> Right $ setopt "value" s opts) "TYPE[,COMM]" (unlines ["show amounts converted with valuation TYPE, and optionally to specified commodity COMM. TYPE can be:" - ,"'cost': convert to cost using transaction prices, then optionally to COMM using period-end market prices" ,"'then': convert to contemporaneous market value, in default valuation commodity or COMM (print & register commands only)" ,"'end': convert to period-end market value, in default valuation commodity or COMM" ,"'now': convert to current market value, in default valuation commodity or COMM" diff --git a/hledger/Hledger/Cli/Commands/Roi.hs b/hledger/Hledger/Cli/Commands/Roi.hs index ff53c4727..449af8adf 100644 --- a/hledger/Hledger/Cli/Commands/Roi.hs +++ b/hledger/Hledger/Cli/Commands/Roi.hs @@ -273,7 +273,7 @@ unMix a = Just a -> aquantity a Nothing -> error' $ "Amounts could not be converted to a single cost basis: " ++ show (map showAmount $ amounts a) ++ "\nConsider using --value to force all costs to be in a single commodity." ++ - "\nFor example, \"--value cost, --infer-value\", where commodity is the one that was used to pay for the investment." + "\nFor example, \"--cost --value=end, --infer-value\", where commodity is the one that was used to pay for the investment." -- Show Decimal rounded to two decimal places, unless it has less places already. This ensures that "2" won't be shown as "2.00" showDecimal :: Decimal -> String diff --git a/hledger/hledger.m4.md b/hledger/hledger.m4.md index 7e3790ca8..a91554ecf 100644 --- a/hledger/hledger.m4.md +++ b/hledger/hledger.m4.md @@ -885,12 +885,11 @@ $ hledger -f t.j bal -N euros -V ## --value: Flexible valuation -`-B`, `-V` and `-X` are special cases of the more general `--value` option: +`-V` and `-X` are special cases of the more general `--value` option: - --value=TYPE[,COMM] TYPE is cost, then, end, now or YYYY-MM-DD. + --value=TYPE[,COMM] TYPE is then, end, now or YYYY-MM-DD. COMM is an optional commodity symbol. Shows amounts converted to: - - cost commodity using transaction prices (then optionally to COMM using market prices at period end(s)) - default valuation commodity (or COMM) using market prices at posting dates - default valuation commodity (or COMM) using market prices at period end(s) - default valuation commodity (or COMM) using current market prices @@ -898,9 +897,6 @@ $ hledger -f t.j bal -N euros -V The TYPE part selects cost or value and valuation date: -`--value=cost` -: Convert amounts to cost, using the prices recorded in transactions. - `--value=then` : Convert amounts to their value in the [default valuation commodity](#valuation-commodity), using market prices on each posting's date. @@ -945,7 +941,7 @@ P 2000-04-01 A 4 B Show the cost of each posting: ```shell -$ hledger -f- print --value=cost +$ hledger -f- print --cost 2000-01-01 (a) 5 B @@ -1056,7 +1052,7 @@ Related: [#329](https://github.com/simonmichael/hledger/issues/329), [#1083](https://github.com/simonmichael/hledger/issues/1083). -| Report type | `-B`, `--value=cost` | `-V`, `-X` | `--value=then` | `--value=end` | `--value=DATE`, `--value=now` | +| Report type | `-B`, `--cost` | `-V`, `-X` | `--value=then` | `--value=end` | `--value=DATE`, `--value=now` | |-----------------------------------------------------|------------------------------------------------------------------|-------------------------------------------------------------------|------------------------------------------------------------------------------------------------|-------------------------------------------------------------------|-----------------------------------------| | **print** | | | | | | | posting amounts | cost | value at report end or today | value at posting date | value at report or journal end | value at DATE/today | diff --git a/hledger/test/roi.test b/hledger/test/roi.test index 1fdc74f77..af750f631 100644 --- a/hledger/test/roi.test +++ b/hledger/test/roi.test @@ -240,7 +240,7 @@ hledger -f- roi -p 2019-11 --inv Investment --pnl PnL >>>2 hledger: Amounts could not be converted to a single cost basis: ["10 B","-10 B @@ 100 A"] Consider using --value to force all costs to be in a single commodity. -For example, "--value cost, --infer-value", where commodity is the one that was used to pay for the investment. +For example, "--cost --value=end, --infer-value", where commodity is the one that was used to pay for the investment. >>>=1 # 10. Forcing valuation via --value