From d176215f037c3e8e5fe4d08a5f75ff61111a4194 Mon Sep 17 00:00:00 2001 From: Henning Thielemann Date: Thu, 31 Oct 2024 09:34:38 +0100 Subject: [PATCH] cli: Commands.Aregister: --header -> --heading --- hledger/Hledger/Cli/Commands/Aregister.hs | 14 +++++++------- hledger/Hledger/Cli/Commands/Aregister.md | 8 ++++---- 2 files changed, 11 insertions(+), 11 deletions(-) diff --git a/hledger/Hledger/Cli/Commands/Aregister.hs b/hledger/Hledger/Cli/Commands/Aregister.hs index 322ce7735..0c6efead2 100644 --- a/hledger/Hledger/Cli/Commands/Aregister.hs +++ b/hledger/Hledger/Cli/Commands/Aregister.hs @@ -57,8 +57,8 @@ aregistermode = hledgerCommandMode -- "show running average of posting amounts instead of total (implies --empty)" -- ,flagNone ["related","r"] (setboolopt "related") "show postings' siblings instead" ,flagNone ["invert"] (setboolopt "invert") "display all amounts with reversed sign" - ,flagReq ["header"] (\s opts -> Right $ setopt "header" s opts) "YN" - "show header row above table: yes (default) or no" + ,flagReq ["heading"] (\s opts -> Right $ setopt "heading" s opts) "YN" + "show heading row above table: yes (default) or no" ,flagReq ["width","w"] (\s opts -> Right $ setopt "width" s opts) "N" ("set output width (default: " ++ #ifdef mingw32_HOST_OS @@ -128,7 +128,7 @@ aregister opts@CliOpts{rawopts_=rawopts,reportspec_=rspec} j = do | fmt=="json" = toJsonText | otherwise = error' $ unsupportedOutputFormatError fmt -- PARTIAL: where - hd = headeropt opts + hd = headingopt opts fmt = outputFormatFromOpts opts writeOutputLazyText opts $ render items' @@ -179,7 +179,7 @@ accountTransactionsReportAsHTML copts reportq thisacctq items = L.renderText $ do L.link_ [L.rel_ "stylesheet", L.href_ "hledger.css"] L.table_ $ do - when (headeropt copts) $ L.thead_ $ L.tr_ $ do + when (headingopt copts) $ L.thead_ $ L.tr_ $ do L.th_ "date" L.th_ "description" L.th_ "otheraccounts" @@ -195,7 +195,7 @@ accountTransactionsReportAsHTML copts reportq thisacctq items = -- | Render a register report as plain text suitable for console output. accountTransactionsReportAsText :: CliOpts -> Query -> Query -> AccountTransactionsReport -> TL.Text accountTransactionsReportAsText copts reportq thisacctq items = TB.toLazyText $ - (optional (headeropt copts) $ title <> TB.singleton '\n') + (optional (headingopt copts) $ title <> TB.singleton '\n') <> postingsOrTransactionsReportAsText alignAll copts itemAsText itemamt itembal items where @@ -218,8 +218,8 @@ accountTransactionsReportAsText copts reportq thisacctq items = TB.toLazyText $ length (querystring_ $ _rsReportOpts $ reportspec_ copts) > 1 && not (queryIsNull $ filterQuery (not.(\q->queryIsDepth q || queryIsDateOrDate2 q)) reportq) -headeropt :: CliOpts -> Bool -headeropt = fromMaybe True . maybeynopt "header" . rawopts_ +headingopt :: CliOpts -> Bool +headingopt = fromMaybe True . maybeynopt "heading" . rawopts_ optional :: (Monoid p) => Bool -> p -> p optional b x = if b then x else mempty diff --git a/hledger/Hledger/Cli/Commands/Aregister.md b/hledger/Hledger/Cli/Commands/Aregister.md index 69981923d..af35bb9c9 100644 --- a/hledger/Hledger/Cli/Commands/Aregister.md +++ b/hledger/Hledger/Cli/Commands/Aregister.md @@ -13,7 +13,7 @@ Flags: --no-elide don't show only 2 commodities per amount --cumulative show running total from report start date --invert display all amounts with reversed sign - --header=YN show header row above table: yes (default) or no + --heading=YN show heading row above table: yes (default) or no -w --width=N set output width (default: terminal width or $COLUMNS). -wN,M sets description width as well. --align-all guarantee alignment across all lines (slower) @@ -76,10 +76,10 @@ this means unusually wide values in later lines can cause visual discontinuities as column widths are adjusted. If you want to ensure perfect alignment, at the cost of more time and memory, use the `--align-all` flag. -By default, `aregister` shows a header above the data. +By default, `aregister` shows a heading above the data. However, when reporting in a language different from English, -it is easier to omit this header and prepend your own one. -For this purpose, use the `--header=no` option. +it is easier to omit this heading and prepend your own one. +For this purpose, use the `--heading=no` option. This command also supports the [output destination](hledger.html#output-destination) and