docs: whitespace

This commit is contained in:
Simon Michael 2011-09-23 14:27:26 +00:00
parent 43daa05f97
commit 9a0a0be01c
3 changed files with 30 additions and 34 deletions

View File

@ -1182,38 +1182,38 @@ entries, and the following c++ ledger options and commands:
#### Other differences #### Other differences
- hledger recognises description and negative patterns by "desc:" - hledger recognises description and negative patterns by "desc:"
and "not:" prefixes, unlike ledger 3's free-form parser and "not:" prefixes, unlike ledger 3's free-form parser
- hledger doesn't require a space before command-line option - hledger doesn't require a space before command-line option
values, eg either `-f-` or `-f -` is fine values, eg either `-f-` or `-f -` is fine
- hledger's weekly reporting intervals always start on mondays - hledger's weekly reporting intervals always start on mondays
- hledger shows start and end dates of the intervals requested, - hledger shows start and end dates of the intervals requested,
not just the span containing data not just the span containing data
- hledger always shows timelog balances in hours - hledger always shows timelog balances in hours
- hledger splits multi-day timelog sessions at midnight - hledger splits multi-day timelog sessions at midnight
- hledger doesn't track the value of commodities with varying - hledger doesn't track the value of commodities with varying
price; prices are fixed as of the transaction date price; prices are fixed as of the transaction date
- hledger's output follows the decimal point character, digit grouping, - hledger's output follows the decimal point character, digit grouping,
and digit group separator character used in the journal. and digit group separator character used in the journal.
- hledger print shows amounts for all postings, and shows unit - hledger print shows amounts for all postings, and shows unit
prices for amounts which have them. (This currently means that prices for amounts which have them. (This currently means that
it does not print multi-commodity transactions in valid journal format.) it does not print multi-commodity transactions in valid journal format.)
- hledger's default commodity directive (D) sets the commodity for - hledger's default commodity directive (D) sets the commodity for
subsequent commodityless amounts, and contributes to that commodity's subsequent commodityless amounts, and contributes to that commodity's
display settings. ledger uses D only for commodity display settings display settings. ledger uses D only for commodity display settings
and for the entry command. and for the entry command.
- hledger generates a description for timelog sessions, instead of - hledger generates a description for timelog sessions, instead of
taking it from the clock-out entry taking it from the clock-out entry
### Troubleshooting ### Troubleshooting

View File

@ -59,27 +59,23 @@ pcommentwidth = no limit -- 22
@ @
-} -}
showTransaction :: Transaction -> String showTransaction :: Transaction -> String
showTransaction = showTransaction' True False showTransaction = showTransaction' True
showTransactionUnelided :: Transaction -> String showTransactionUnelided :: Transaction -> String
showTransactionUnelided = showTransaction' False False showTransactionUnelided = showTransaction' False
showTransactionForPrint :: Bool -> Transaction -> String showTransaction' :: Bool -> Transaction -> String
showTransactionForPrint effective = showTransaction' False effective showTransaction' elide t =
showTransaction' :: Bool -> Bool -> Transaction -> String
showTransaction' elide effective t =
unlines $ [description] ++ showpostings (tpostings t) ++ [""] unlines $ [description] ++ showpostings (tpostings t) ++ [""]
where where
description = concat [date, status, code, desc, comment] description = concat [date, status, code, desc, comment]
date | effective = showdate $ fromMaybe (tdate t) $ teffectivedate t date = showdate (tdate t) ++ maybe "" showedate (teffectivedate t)
| otherwise = showdate (tdate t) ++ maybe "" showedate (teffectivedate t) showdate = printf "%-10s" . showDate
showedate = printf "=%s" . showdate
status = if tstatus t then " *" else "" status = if tstatus t then " *" else ""
code = if length (tcode t) > 0 then printf " (%s)" $ tcode t else "" code = if length (tcode t) > 0 then printf " (%s)" $ tcode t else ""
desc = if null d then "" else " " ++ d where d = tdescription t desc = if null d then "" else " " ++ d where d = tdescription t
comment = if null c then "" else " ; " ++ c where c = tcomment t comment = if null c then "" else " ; " ++ c where c = tcomment t
showdate = printf "%-10s" . showDate
showedate = printf "=%s" . showdate
showpostings ps showpostings ps
| elide && length ps > 1 && isTransactionBalanced Nothing t -- imprecise balanced check | elide && length ps > 1 && isTransactionBalanced Nothing t -- imprecise balanced check
= map showposting (init ps) ++ [showpostingnoamt (last ps)] = map showposting (init ps) ++ [showpostingnoamt (last ps)]

View File

@ -25,5 +25,5 @@ showTransactions :: ReportOpts -> FilterSpec -> Journal -> String
showTransactions opts fspec j = entriesReportAsText opts fspec $ entriesReport opts fspec j showTransactions opts fspec j = entriesReportAsText opts fspec $ entriesReport opts fspec j
entriesReportAsText :: ReportOpts -> FilterSpec -> EntriesReport -> String entriesReportAsText :: ReportOpts -> FilterSpec -> EntriesReport -> String
entriesReportAsText opts _ items = concatMap (showTransactionForPrint (effective_ opts)) items entriesReportAsText _ _ items = concatMap showTransactionUnelided items