From 3a1e30255c4c788ea74f59bf8dae6bf569b672f6 Mon Sep 17 00:00:00 2001 From: Simon Michael Date: Tue, 9 Sep 2025 12:11:31 +0100 Subject: [PATCH] fix:print: remove unused --show-costs flag from command line help --- hledger/Hledger/Cli/Commands/Print.hs | 5 +---- hledger/Hledger/Cli/Commands/Setup.hs | 2 +- hledger/hledger.m4.md | 2 +- hledger/test/journal/costs.test | 2 +- 4 files changed, 4 insertions(+), 7 deletions(-) diff --git a/hledger/Hledger/Cli/Commands/Print.hs b/hledger/Hledger/Cli/Commands/Print.hs index 957e63ce2..46d7c2c26 100644 --- a/hledger/Hledger/Cli/Commands/Print.hs +++ b/hledger/Hledger/Cli/Commands/Print.hs @@ -50,8 +50,6 @@ printmode = hledgerCommandMode $(embedFileRelative "Hledger/Cli/Commands/Print.txt") ([flagNone ["explicit","x"] (setboolopt "explicit") "show all amounts explicitly" - ,flagNone ["show-costs"] (setboolopt "show-costs") - "show transaction prices even with conversion postings" ,roundFlag ,flagNone ["invert"] (setboolopt "invert") "display all amounts with reversed sign" ,flagNone ["new"] (setboolopt "new") @@ -159,8 +157,7 @@ printEntries opts@CliOpts{rawopts_=rawopts, reportspec_=rspec} j = -- Use the fully inferred and amount-styled/rounded transaction in the following situations: -- with -x/--explicit: | boolopt "explicit" (rawopts_ opts) = id - -- with --show-costs: - -- XXX infer_costs is --infer-costs not --show-costs. And where is show-costs used anyway ? + -- with --infer-costs | opts ^. infer_costs = id -- with -B/-V/-X/--value ("because of #551, and because of print -V valuing only one posting when there's an implicit txn price.") | has (value . _Just) opts = id diff --git a/hledger/Hledger/Cli/Commands/Setup.hs b/hledger/Hledger/Cli/Commands/Setup.hs index 71852f7c2..c4e34c09e 100644 --- a/hledger/Hledger/Cli/Commands/Setup.hs +++ b/hledger/Hledger/Cli/Commands/Setup.hs @@ -220,7 +220,7 @@ setupHledger = do -- pdesc "common general options are configured ?" -- --infer-costs" - -- print --explicit --show-costs" + -- print --explicit --infer-costs" return $ Just $ Right conf else diff --git a/hledger/hledger.m4.md b/hledger/hledger.m4.md index 59d505574..29a7e5e1e 100644 --- a/hledger/hledger.m4.md +++ b/hledger/hledger.m4.md @@ -578,7 +578,7 @@ in a more featureful hledger config file. Here's a small example: # Options following a `[COMMAND]` heading are used with that hledger command only. [print] ---explicit --show-costs +--explicit --infer-costs ``` To use a config file, specify it with the `--conf` option. diff --git a/hledger/test/journal/costs.test b/hledger/test/journal/costs.test index 0af5301aa..51ae42fd1 100644 --- a/hledger/test/journal/costs.test +++ b/hledger/test/journal/costs.test @@ -467,7 +467,7 @@ $ hledger -f- print --infer-costs assets $-135 assets £-80 -$ hledger -f- print --show-costs --infer-costs +$ hledger -f- print --infer-costs 2011-01-01 expenses:food €110 @@ £80 expenses:foreign currency €100 @@ $135