From 34c401d1cfd620f9422b6fde2c39bf52632d48b8 Mon Sep 17 00:00:00 2001 From: Simon Michael Date: Thu, 1 Jun 2023 15:09:14 -1000 Subject: [PATCH] imp: Revert "imp: cli: make some reporting flags toggle on/off when repeated" This reverts commit 57c0205107300c0c937f63a22ff68cb9470002b6. Toggling means it can be hard to know if the feature is on or off. This needs more testing. --- hledger-lib/Hledger/Reports/ReportOptions.hs | 18 +++++++++--------- hledger/hledger.m4.md | 14 -------------- 2 files changed, 9 insertions(+), 23 deletions(-) diff --git a/hledger-lib/Hledger/Reports/ReportOptions.hs b/hledger-lib/Hledger/Reports/ReportOptions.hs index 0f76959db..e18d223d4 100644 --- a/hledger-lib/Hledger/Reports/ReportOptions.hs +++ b/hledger-lib/Hledger/Reports/ReportOptions.hs @@ -243,13 +243,13 @@ rawOptsToReportOpts d rawopts = ,infer_prices_ = boolopt "infer-market-prices" rawopts ,depth_ = maybeposintopt "depth" rawopts ,date2_ = boolopt "date2" rawopts - ,empty_ = toggleopt "empty" rawopts + ,empty_ = boolopt "empty" rawopts ,no_elide_ = boolopt "no-elide" rawopts ,real_ = boolopt "real" rawopts ,format_ = format ,querystring_ = querystring - ,average_ = toggleopt "average" rawopts - ,related_ = toggleopt "related" rawopts + ,average_ = boolopt "average" rawopts + ,related_ = boolopt "related" rawopts ,txn_dates_ = boolopt "txn-dates" rawopts ,balancecalc_ = balancecalcopt rawopts ,balanceaccum_ = balanceaccumopt rawopts @@ -257,15 +257,15 @@ rawOptsToReportOpts d rawopts = ,accountlistmode_ = accountlistmodeopt rawopts ,drop_ = posintopt "drop" rawopts ,declared_ = boolopt "declared" rawopts - ,row_total_ = toggleopt "row-total" rawopts - ,no_total_ = toggleopt "no-total" rawopts + ,row_total_ = boolopt "row-total" rawopts + ,no_total_ = boolopt "no-total" rawopts ,show_costs_ = boolopt "show-costs" rawopts - ,sort_amount_ = toggleopt "sort-amount" rawopts - ,percent_ = toggleopt "percent" rawopts - ,invert_ = toggleopt "invert" rawopts + ,sort_amount_ = boolopt "sort-amount" rawopts + ,percent_ = boolopt "percent" rawopts + ,invert_ = boolopt "invert" rawopts ,pretty_ = pretty ,color_ = useColorOnStdout -- a lower-level helper - ,transpose_ = toggleopt "transpose" rawopts + ,transpose_ = boolopt "transpose" rawopts ,layout_ = layoutopt rawopts } diff --git a/hledger/hledger.m4.md b/hledger/hledger.m4.md index cc9d9d1a9..33278b7cd 100644 --- a/hledger/hledger.m4.md +++ b/hledger/hledger.m4.md @@ -258,20 +258,6 @@ _reportingoptions_ Here are some details useful to know about for hledger command lines (and elsewhere). Feel free to skip this section until you need it. -## Option repetition - -If options are repeated in a command line, hledger will generally use the last (right-most) occurence. -Some of the boolean flags will toggle if repeated; these include: -`--invert`, -`--transpose`, -`-r/--related`, -`-%/--percent`, -`-E/--empty`, -`-N/--no-total`, -`-T/--row-total`, -`-A/--average`, and -`-S/--sort-amount`. - ## Special characters ### Single escaping (shell metacharacters)