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 ["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 ["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 ["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"
|
,flagNone ["types"] (setboolopt "types") "also show account types when known"
|
||||||
]
|
]
|
||||||
++ flattreeflags False ++
|
++ flattreeflags False ++
|
||||||
[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"]
|
||||||
)
|
)
|
||||||
cligeneralflagsgroups1
|
cligeneralflagsgroups1
|
||||||
hiddenflags
|
(hiddenflags ++
|
||||||
|
[flagNone ["positions"] (setboolopt "locations") "deprecated, use --locations instead"
|
||||||
|
])
|
||||||
([], Just $ argsFlag "[QUERY..]")
|
([], Just $ argsFlag "[QUERY..]")
|
||||||
|
|
||||||
-- | The accounts command.
|
-- | The accounts command.
|
||||||
@ -57,7 +59,7 @@ accounts opts@CliOpts{rawopts_=rawopts, reportspec_=ReportSpec{_rsQuery=query,_r
|
|||||||
-- 1. identify the accounts we'll show
|
-- 1. identify the accounts we'll show
|
||||||
let tree = tree_ ropts
|
let tree = tree_ ropts
|
||||||
directives = boolopt "directives" rawopts
|
directives = boolopt "directives" rawopts
|
||||||
positions = boolopt "positions" rawopts
|
locations = boolopt "locations" rawopts
|
||||||
types = boolopt "types" rawopts
|
types = boolopt "types" rawopts
|
||||||
-- Modified queries. These may not work with boolean queries (#2371).
|
-- 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
|
-- 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)
|
(True, Just t) -> pad a <> " ; type: " <> T.pack (show t)
|
||||||
_ -> ""
|
_ -> ""
|
||||||
showAcctDeclOrder a
|
showAcctDeclOrder a
|
||||||
| positions =
|
| locations =
|
||||||
(if types then "," else pad a <> " ;") <>
|
(if types then "," else pad a <> " ;") <>
|
||||||
case lookup a $ jdeclaredaccounts j of
|
case lookup a $ jdeclaredaccounts j of
|
||||||
Just adi ->
|
Just adi ->
|
||||||
|
|||||||
@ -11,7 +11,7 @@ Flags:
|
|||||||
--find list the first account matched by the first
|
--find list the first account matched by the first
|
||||||
argument (a case-insensitive infix regexp)
|
argument (a case-insensitive infix regexp)
|
||||||
--directives show as account directives, for use in journals
|
--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
|
--types also show account types when known
|
||||||
-l --flat list/tree mode: show accounts as a flat list
|
-l --flat list/tree mode: show accounts as a flat list
|
||||||
(default)
|
(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
|
This is useful together with `--undeclared` when updating your account declarations
|
||||||
to satisfy `hledger check accounts`.
|
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;
|
account's declaration, if any, and the account's overall declaration order;
|
||||||
these may be useful when troubleshooting account display order.
|
these may be useful when troubleshooting account display order.
|
||||||
|
|
||||||
|
|||||||
@ -2219,7 +2219,7 @@ Tips:
|
|||||||
|
|
||||||
- You can list accounts and their types, for troubleshooting:
|
- You can list accounts and their types, for troubleshooting:
|
||||||
```cli
|
```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.
|
- 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-equity
|
||||||
--infer-market-prices
|
--infer-market-prices
|
||||||
--info
|
--info
|
||||||
|
--locations
|
||||||
--man
|
--man
|
||||||
--market
|
--market
|
||||||
--monthly
|
--monthly
|
||||||
--pending
|
--pending
|
||||||
--period=
|
--period=
|
||||||
--pivot=
|
--pivot=
|
||||||
--positions
|
|
||||||
--pretty
|
--pretty
|
||||||
--quarterly
|
--quarterly
|
||||||
--real
|
--real
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user