imp:accounts: rename --positions to --locations for consistency
with `print`. --positions still works, as a hidden flag.
This commit is contained in:
parent
8b125a2ee6
commit
64023478b7
@ -40,14 +40,16 @@ accountsmode = hledgerCommandMode
|
||||
,flagNone ["unused"] (setboolopt "unused") "list accounts declared but not used"
|
||||
,flagNone ["find"] (setboolopt "find") "list the first account matched by the first argument (a case-insensitive infix regexp)"
|
||||
,flagNone ["directives"] (setboolopt "directives") "show as account directives, for use in journals"
|
||||
,flagNone ["positions"] (setboolopt "positions") "also show where accounts were declared"
|
||||
,flagNone ["locations"] (setboolopt "locations") "also show where accounts were declared"
|
||||
,flagNone ["types"] (setboolopt "types") "also show account types when known"
|
||||
]
|
||||
++ flattreeflags False ++
|
||||
[flagReq ["drop"] (\s opts -> Right $ setopt "drop" s opts) "N" "flat mode: omit N leading account name parts"]
|
||||
)
|
||||
cligeneralflagsgroups1
|
||||
hiddenflags
|
||||
(hiddenflags ++
|
||||
[flagNone ["positions"] (setboolopt "locations") "deprecated, use --locations instead"
|
||||
])
|
||||
([], Just $ argsFlag "[QUERY..]")
|
||||
|
||||
-- | The accounts command.
|
||||
@ -57,7 +59,7 @@ accounts opts@CliOpts{rawopts_=rawopts, reportspec_=ReportSpec{_rsQuery=query,_r
|
||||
-- 1. identify the accounts we'll show
|
||||
let tree = tree_ ropts
|
||||
directives = boolopt "directives" rawopts
|
||||
positions = boolopt "positions" rawopts
|
||||
locations = boolopt "locations" rawopts
|
||||
types = boolopt "types" rawopts
|
||||
-- Modified queries. These may not work with boolean queries (#2371).
|
||||
-- a depth limit will clip and exclude account names later, but we don't want to exclude accounts at this stage
|
||||
@ -115,7 +117,7 @@ accounts opts@CliOpts{rawopts_=rawopts, reportspec_=ReportSpec{_rsQuery=query,_r
|
||||
(True, Just t) -> pad a <> " ; type: " <> T.pack (show t)
|
||||
_ -> ""
|
||||
showAcctDeclOrder a
|
||||
| positions =
|
||||
| locations =
|
||||
(if types then "," else pad a <> " ;") <>
|
||||
case lookup a $ jdeclaredaccounts j of
|
||||
Just adi ->
|
||||
|
||||
@ -11,7 +11,7 @@ Flags:
|
||||
--find list the first account matched by the first
|
||||
argument (a case-insensitive infix regexp)
|
||||
--directives show as account directives, for use in journals
|
||||
--positions also show where accounts were declared
|
||||
--locations also show where accounts were declared
|
||||
--types also show account types when known
|
||||
-l --flat list/tree mode: show accounts as a flat list
|
||||
(default)
|
||||
@ -33,7 +33,7 @@ With `--directives`, it shows valid account directives which could be pasted int
|
||||
This is useful together with `--undeclared` when updating your account declarations
|
||||
to satisfy `hledger check accounts`.
|
||||
|
||||
With `--positions`, it also shows the file and line number of each
|
||||
With `--locations`, it also shows the file and line number of each
|
||||
account's declaration, if any, and the account's overall declaration order;
|
||||
these may be useful when troubleshooting account display order.
|
||||
|
||||
|
||||
@ -2219,7 +2219,7 @@ Tips:
|
||||
|
||||
- You can list accounts and their types, for troubleshooting:
|
||||
```cli
|
||||
$ hledger accounts --types [ACCTPAT] [type:TYPECODES] [-DEPTH] [--positions]
|
||||
$ hledger accounts --types [ACCTPAT] [type:TYPECODES] [-DEPTH]
|
||||
```
|
||||
|
||||
- It's a good idea to declare at least one account for each account type.
|
||||
|
||||
@ -540,13 +540,13 @@ read -r -d "" _hledger_complist_options_accounts <<"__TEXT__"
|
||||
--infer-equity
|
||||
--infer-market-prices
|
||||
--info
|
||||
--locations
|
||||
--man
|
||||
--market
|
||||
--monthly
|
||||
--pending
|
||||
--period=
|
||||
--pivot=
|
||||
--positions
|
||||
--pretty
|
||||
--quarterly
|
||||
--real
|
||||
|
||||
Loading…
Reference in New Issue
Block a user