acc: rename --posted -> --used

This commit is contained in:
Simon Michael 2018-01-19 12:41:03 -08:00
parent 37a4d71f1b
commit 4ddb748d9c
5 changed files with 105 additions and 106 deletions

View File

@ -36,7 +36,7 @@ accountsmode = (defCommandMode $ ["accounts"] ++ aliases) {
modeHelp = "show account names" `withAliases` aliases modeHelp = "show account names" `withAliases` aliases
,modeHelpSuffix = [ ,modeHelpSuffix = [
"This command lists account names, either declared with account directives" "This command lists account names, either declared with account directives"
,"(--declared), posted to (--posted), or both (default)." ,"(--declared), posted to (--used), or both (default)."
,"With query arguments, only matched account names and account names" ,"With query arguments, only matched account names and account names"
,"referenced by matched postings are shown." ,"referenced by matched postings are shown."
,"It shows a flat list by default. With `--tree`, it uses indentation to" ,"It shows a flat list by default. With `--tree`, it uses indentation to"
@ -47,7 +47,7 @@ accountsmode = (defCommandMode $ ["accounts"] ++ aliases) {
,modeGroupFlags = C.Group { ,modeGroupFlags = C.Group {
groupUnnamed = [ groupUnnamed = [
flagNone ["declared"] (\opts -> setboolopt "declared" opts) "show account names declared with account directives" flagNone ["declared"] (\opts -> setboolopt "declared" opts) "show account names declared with account directives"
,flagNone ["posted"] (\opts -> setboolopt "posted" opts) "show account names posted to by transactions" ,flagNone ["used"] (\opts -> setboolopt "used" opts) "show account names referenced by transactions"
,flagNone ["tree"] (\opts -> setboolopt "tree" opts) "show short account names, as a tree" ,flagNone ["tree"] (\opts -> setboolopt "tree" opts) "show short account names, as a tree"
,flagNone ["flat"] (\opts -> setboolopt "flat" opts) "show full account names, as a list (default)" ,flagNone ["flat"] (\opts -> setboolopt "flat" opts) "show full account names, as a list (default)"
,flagReq ["drop"] (\s opts -> Right $ setopt "drop" s opts) "N" "flat mode: omit N leading account name parts" ,flagReq ["drop"] (\s opts -> Right $ setopt "drop" s opts) "N" "flat mode: omit N leading account name parts"
@ -67,12 +67,12 @@ accounts CliOpts{rawopts_=rawopts, reportopts_=ropts} j = do
depth = dbg1 "depth" $ queryDepth $ filterQuery queryIsDepth q depth = dbg1 "depth" $ queryDepth $ filterQuery queryIsDepth q
matcheddeclaredaccts = dbg1 "matcheddeclaredaccts" $ nub $ sort $ filter (matchesAccount q) $ jaccounts j matcheddeclaredaccts = dbg1 "matcheddeclaredaccts" $ nub $ sort $ filter (matchesAccount q) $ jaccounts j
matchedps = dbg1 "ps" $ journalPostings $ filterJournalPostings nodepthq j matchedps = dbg1 "ps" $ journalPostings $ filterJournalPostings nodepthq j
matchedpostedaccts = dbg1 "matchedpostedaccts" $ nub $ sort $ filter (not . T.null) $ map (clipAccountName depth) $ map paccount matchedps matchedusedaccts = dbg1 "matchedusedaccts" $ nub $ sort $ filter (not . T.null) $ map (clipAccountName depth) $ map paccount matchedps
posted = boolopt "posted" rawopts used = boolopt "used" rawopts
declared = boolopt "declared" rawopts declared = boolopt "declared" rawopts
as | declared && not posted = matcheddeclaredaccts as | declared && not used = matcheddeclaredaccts
| not declared && posted = matchedpostedaccts | not declared && used = matchedusedaccts
| otherwise = nub $ sort $ matcheddeclaredaccts ++ matchedpostedaccts | otherwise = nub $ sort $ matcheddeclaredaccts ++ matchedusedaccts
as' | tree_ ropts = expandAccountNames as as' | tree_ ropts = expandAccountNames as
| otherwise = as | otherwise = as
render a | tree_ ropts = T.replicate (2 * (accountNameLevel a - 1)) " " <> accountLeafName a render a | tree_ ropts = T.replicate (2 * (accountNameLevel a - 1)) " " <> accountLeafName a

View File

@ -1205,7 +1205,7 @@ show account names declared with account directives
.RS .RS
.RE .RE
.TP .TP
.B \f[C]\-\-posted\f[] .B \f[C]\-\-used\f[]
show account names posted to by transactions show account names posted to by transactions
.RS .RS
.RE .RE
@ -1226,7 +1226,7 @@ in flat mode: omit N leading account name parts
.RE .RE
.PP .PP
This command lists account names, either declared with account This command lists account names, either declared with account
directives (\[en]declared), posted to (\[en]posted), or both (default). directives (\[en]declared), posted to (\[en]used), or both (default).
With query arguments, only matched account names and account names With query arguments, only matched account names and account names
referenced by matched postings are shown. referenced by matched postings are shown.
It shows a flat list by default. It shows a flat list by default.

View File

@ -890,7 +890,7 @@ Show account names. Alias: a.
'--declared' '--declared'
show account names declared with account directives show account names declared with account directives
'--posted' '--used'
show account names posted to by transactions show account names posted to by transactions
'--tree' '--tree'
@ -904,7 +904,7 @@ Show account names. Alias: a.
in flat mode: omit N leading account name parts in flat mode: omit N leading account name parts
This command lists account names, either declared with account This command lists account names, either declared with account
directives (-declared), posted to (-posted), or both (default). With directives (-declared), posted to (-used), or both (default). With
query arguments, only matched account names and account names referenced query arguments, only matched account names and account names referenced
by matched postings are shown. It shows a flat list by default. With by matched postings are shown. It shows a flat list by default. With
'--tree', it uses indentation to show the account hierarchy. In flat '--tree', it uses indentation to show the account hierarchy. In flat
@ -2423,95 +2423,95 @@ Node: COMMANDS28399
Ref: #commands28511 Ref: #commands28511
Node: accounts29493 Node: accounts29493
Ref: #accounts29591 Ref: #accounts29591
Node: activity30841 Node: activity30837
Ref: #activity30951 Ref: #activity30947
Node: add31311 Node: add31307
Ref: #add31410 Ref: #add31406
Node: balance34071 Node: balance34067
Ref: #balance34182 Ref: #balance34178
Node: Flat mode37556 Node: Flat mode37552
Ref: #flat-mode37681 Ref: #flat-mode37677
Node: Depth limited balance reports38101 Node: Depth limited balance reports38097
Ref: #depth-limited-balance-reports38302 Ref: #depth-limited-balance-reports38298
Node: Multicolumn balance reports38722 Node: Multicolumn balance reports38718
Ref: #multicolumn-balance-reports38917 Ref: #multicolumn-balance-reports38913
Node: Budgets43606 Node: Budgets43602
Ref: #budgets43753 Ref: #budgets43749
Node: Custom balance output47584 Node: Custom balance output47580
Ref: #custom-balance-output47746 Ref: #custom-balance-output47742
Node: Colour support49839 Node: Colour support49835
Ref: #colour-support49998 Ref: #colour-support49994
Node: Output destination50171 Node: Output destination50167
Ref: #output-destination50327 Ref: #output-destination50323
Node: CSV output50597 Node: CSV output50593
Ref: #csv-output50714 Ref: #csv-output50710
Node: balancesheet51111 Node: balancesheet51107
Ref: #balancesheet51247 Ref: #balancesheet51243
Node: balancesheetequity53474 Node: balancesheetequity53470
Ref: #balancesheetequity53623 Ref: #balancesheetequity53619
Node: cashflow54160 Node: cashflow54156
Ref: #cashflow54288 Ref: #cashflow54284
Node: check-dates56327 Node: check-dates56323
Ref: #check-dates56454 Ref: #check-dates56450
Node: check-dupes56571 Node: check-dupes56567
Ref: #check-dupes56695 Ref: #check-dupes56691
Node: close56832 Node: close56828
Ref: #close56939 Ref: #close56935
Node: help57269 Node: help57265
Ref: #help57369 Ref: #help57365
Node: import58443 Node: import58439
Ref: #import58557 Ref: #import58553
Node: incomestatement59287 Node: incomestatement59283
Ref: #incomestatement59421 Ref: #incomestatement59417
Node: prices61741 Node: prices61737
Ref: #prices61856 Ref: #prices61852
Node: print61899 Node: print61895
Ref: #print62009 Ref: #print62005
Node: print-unique66894 Node: print-unique66890
Ref: #print-unique67020 Ref: #print-unique67016
Node: register67088 Node: register67084
Ref: #register67215 Ref: #register67211
Node: Custom register output71716 Node: Custom register output71712
Ref: #custom-register-output71845 Ref: #custom-register-output71841
Node: register-match73142 Node: register-match73138
Ref: #register-match73276 Ref: #register-match73272
Node: rewrite73459 Node: rewrite73455
Ref: #rewrite73576 Ref: #rewrite73572
Node: stats73645 Node: stats73641
Ref: #stats73748 Ref: #stats73744
Node: tags74630 Node: tags74626
Ref: #tags74728 Ref: #tags74724
Node: test74964 Node: test74960
Ref: #test75048 Ref: #test75044
Node: ADD-ON COMMANDS75416 Node: ADD-ON COMMANDS75412
Ref: #add-on-commands75526 Ref: #add-on-commands75522
Node: Official add-ons76813 Node: Official add-ons76809
Ref: #official-add-ons76953 Ref: #official-add-ons76949
Node: api77040 Node: api77036
Ref: #api77129 Ref: #api77125
Node: ui77181 Node: ui77177
Ref: #ui77280 Ref: #ui77276
Node: web77338 Node: web77334
Ref: #web77427 Ref: #web77423
Node: Third party add-ons77473 Node: Third party add-ons77469
Ref: #third-party-add-ons77648 Ref: #third-party-add-ons77644
Node: diff77783 Node: diff77779
Ref: #diff77880 Ref: #diff77876
Node: iadd77979 Node: iadd77975
Ref: #iadd78093 Ref: #iadd78089
Node: interest78176 Node: interest78172
Ref: #interest78297 Ref: #interest78293
Node: irr78392 Node: irr78388
Ref: #irr78490 Ref: #irr78486
Node: Experimental add-ons78568 Node: Experimental add-ons78564
Ref: #experimental-add-ons78720 Ref: #experimental-add-ons78716
Node: autosync79011 Node: autosync79007
Ref: #autosync79123 Ref: #autosync79119
Node: budget79362 Node: budget79358
Ref: #budget79484 Ref: #budget79480
Node: chart79550 Node: chart79546
Ref: #chart79667 Ref: #chart79663
Node: check79738 Node: check79734
Ref: #check79840 Ref: #check79836
 
End Tag Table End Tag Table

View File

@ -809,8 +809,7 @@ COMMANDS
--declared --declared
show account names declared with account directives show account names declared with account directives
--posted --used show account names posted to by transactions
show account names posted to by transactions
--tree show short account names and their parents, as a tree --tree show short account names and their parents, as a tree
@ -820,7 +819,7 @@ COMMANDS
in flat mode: omit N leading account name parts in flat mode: omit N leading account name parts
This command lists account names, either declared with account direc- This command lists account names, either declared with account direc-
tives (-declared), posted to (-posted), or both (default). With query tives (-declared), posted to (-used), or both (default). With query
arguments, only matched account names and account names referenced by arguments, only matched account names and account names referenced by
matched postings are shown. It shows a flat list by default. With matched postings are shown. It shows a flat list by default. With
--tree, it uses indentation to show the account hierarchy. In flat --tree, it uses indentation to show the account hierarchy. In flat

View File

@ -29,7 +29,7 @@ Show account names. Alias: a.
`--declared` `--declared`
: show account names declared with account directives : show account names declared with account directives
`--posted` `--used`
: show account names posted to by transactions : show account names posted to by transactions
`--tree` `--tree`
@ -42,7 +42,7 @@ Show account names. Alias: a.
: in flat mode: omit N leading account name parts : in flat mode: omit N leading account name parts
This command lists account names, either declared with account directives This command lists account names, either declared with account directives
(--declared), posted to (--posted), or both (default). (--declared), posted to (--used), or both (default).
With query arguments, only matched account names and account names With query arguments, only matched account names and account names
referenced by matched postings are shown. referenced by matched postings are shown.
It shows a flat list by default. With `--tree`, it uses indentation to It shows a flat list by default. With `--tree`, it uses indentation to