use consistent UPC order for --unmarked/--pending/--cleared (#564)
This commit is contained in:
parent
cca95d2974
commit
eb42ea04e5
@ -26,9 +26,9 @@ Available options:
|
|||||||
--ignore-assertions ignore any balance assertions in the journal
|
--ignore-assertions ignore any balance assertions in the journal
|
||||||
-b,--begin DATE include postings/txns on or after this date
|
-b,--begin DATE include postings/txns on or after this date
|
||||||
-e,--end DATE include postings/txns before this date
|
-e,--end DATE include postings/txns before this date
|
||||||
-C,--cleared include only cleared postings/txns
|
|
||||||
-P,--pending include only pending postings/txns
|
|
||||||
-U,--unmarked include only unmarked postings/txns
|
-U,--unmarked include only unmarked postings/txns
|
||||||
|
-P,--pending include only pending postings/txns
|
||||||
|
-C,--cleared include only cleared postings/txns
|
||||||
-R,--real include only non-virtual postings
|
-R,--real include only non-virtual postings
|
||||||
--sunday weeks start on Sunday
|
--sunday weeks start on Sunday
|
||||||
-D,--daily ASSERT assertions that must hold at the end of the day
|
-D,--daily ASSERT assertions that must hold at the end of the day
|
||||||
|
|||||||
@ -137,14 +137,14 @@ m4_define({{_reportingoptions_}}, {{
|
|||||||
`--date2`
|
`--date2`
|
||||||
: show, and match with -b/-e/-p/date:, secondary dates instead
|
: show, and match with -b/-e/-p/date:, secondary dates instead
|
||||||
|
|
||||||
`-C --cleared`
|
`-U --unmarked`
|
||||||
: include only cleared postings/txns
|
: include only unmarked postings/txns (can combine with -P or -C)
|
||||||
|
|
||||||
`-P --pending`
|
`-P --pending`
|
||||||
: include only pending postings/txns
|
: include only pending postings/txns
|
||||||
|
|
||||||
`-U --unmarked`
|
`-C --cleared`
|
||||||
: include only unmarked postings/txns
|
: include only cleared postings/txns
|
||||||
|
|
||||||
`-R --real`
|
`-R --real`
|
||||||
: include only non-virtual postings
|
: include only non-virtual postings
|
||||||
|
|||||||
@ -17,20 +17,20 @@ import Hledger.Cli.CliOptions
|
|||||||
import Hledger.UI.UITypes
|
import Hledger.UI.UITypes
|
||||||
import Hledger.UI.UIOptions
|
import Hledger.UI.UIOptions
|
||||||
|
|
||||||
-- | Toggle between showing only cleared items or all items.
|
-- | Toggle between showing only unmarked items or all items.
|
||||||
toggleCleared :: UIState -> UIState
|
toggleUnmarked :: UIState -> UIState
|
||||||
toggleCleared ui@UIState{aopts=uopts@UIOpts{cliopts_=copts@CliOpts{reportopts_=ropts}}} =
|
toggleUnmarked ui@UIState{aopts=uopts@UIOpts{cliopts_=copts@CliOpts{reportopts_=ropts}}} =
|
||||||
ui{aopts=uopts{cliopts_=copts{reportopts_=reportOptsToggleStatus Cleared ropts}}}
|
ui{aopts=uopts{cliopts_=copts{reportopts_=reportOptsToggleStatus Unmarked ropts}}}
|
||||||
|
|
||||||
-- | Toggle between showing only pending items or all items.
|
-- | Toggle between showing only pending items or all items.
|
||||||
togglePending :: UIState -> UIState
|
togglePending :: UIState -> UIState
|
||||||
togglePending ui@UIState{aopts=uopts@UIOpts{cliopts_=copts@CliOpts{reportopts_=ropts}}} =
|
togglePending ui@UIState{aopts=uopts@UIOpts{cliopts_=copts@CliOpts{reportopts_=ropts}}} =
|
||||||
ui{aopts=uopts{cliopts_=copts{reportopts_=reportOptsToggleStatus Pending ropts}}}
|
ui{aopts=uopts{cliopts_=copts{reportopts_=reportOptsToggleStatus Pending ropts}}}
|
||||||
|
|
||||||
-- | Toggle between showing only unmarked items or all items.
|
-- | Toggle between showing only cleared items or all items.
|
||||||
toggleUnmarked :: UIState -> UIState
|
toggleCleared :: UIState -> UIState
|
||||||
toggleUnmarked ui@UIState{aopts=uopts@UIOpts{cliopts_=copts@CliOpts{reportopts_=ropts}}} =
|
toggleCleared ui@UIState{aopts=uopts@UIOpts{cliopts_=copts@CliOpts{reportopts_=ropts}}} =
|
||||||
ui{aopts=uopts{cliopts_=copts{reportopts_=reportOptsToggleStatus Unmarked ropts}}}
|
ui{aopts=uopts{cliopts_=copts{reportopts_=reportOptsToggleStatus Cleared ropts}}}
|
||||||
|
|
||||||
reportOptsToggleStatus s ropts
|
reportOptsToggleStatus s ropts
|
||||||
| clearedstatus_ ropts == [s] = ropts{clearedstatus_=[]}
|
| clearedstatus_ ropts == [s] = ropts{clearedstatus_=[]}
|
||||||
|
|||||||
@ -28,7 +28,7 @@ runHelp = runCommand "hledger-ui --help | less" >>= waitForProcess
|
|||||||
|
|
||||||
-- ui
|
-- ui
|
||||||
|
|
||||||
uiShowClearedStatus = map showstatus
|
uiShowClearedStatus = map showstatus . sort
|
||||||
where
|
where
|
||||||
showstatus Cleared = "cleared"
|
showstatus Cleared = "cleared"
|
||||||
showstatus Pending = "pending"
|
showstatus Pending = "pending"
|
||||||
@ -76,9 +76,9 @@ helpDialog =
|
|||||||
,renderKey ("t", "set report period to today")
|
,renderKey ("t", "set report period to today")
|
||||||
,str " "
|
,str " "
|
||||||
,renderKey ("/", "set a filter query")
|
,renderKey ("/", "set a filter query")
|
||||||
,renderKey ("C", "toggle cleared/all")
|
|
||||||
,renderKey ("P", "toggle pending/all")
|
|
||||||
,renderKey ("U", "toggle unmarked/all")
|
,renderKey ("U", "toggle unmarked/all")
|
||||||
|
,renderKey ("P", "toggle pending/all")
|
||||||
|
,renderKey ("C", "toggle cleared/all")
|
||||||
,renderKey ("R", "toggle real/all")
|
,renderKey ("R", "toggle real/all")
|
||||||
,renderKey ("Z", "toggle nonzero/all")
|
,renderKey ("Z", "toggle nonzero/all")
|
||||||
,renderKey ("DEL/BS", "remove filters")
|
,renderKey ("DEL/BS", "remove filters")
|
||||||
|
|||||||
@ -139,9 +139,9 @@ reportflags = [
|
|||||||
,flagReq ["period","p"] (\s opts -> Right $ setopt "period" s opts) "PERIODEXP" "set start date, end date, and/or report interval all at once (overrides the flags above)"
|
,flagReq ["period","p"] (\s opts -> Right $ setopt "period" s opts) "PERIODEXP" "set start date, end date, and/or report interval all at once (overrides the flags above)"
|
||||||
,flagNone ["date2"] (setboolopt "date2") "show, and make -b/-e/-p/date: match, secondary dates instead"
|
,flagNone ["date2"] (setboolopt "date2") "show, and make -b/-e/-p/date: match, secondary dates instead"
|
||||||
|
|
||||||
,flagNone ["cleared","C"] (setboolopt "cleared") "include only cleared postings/txns"
|
,flagNone ["unmarked","U"] (setboolopt "unmarked") "include only unmarked postings/txns (can combine with -P or -C)"
|
||||||
,flagNone ["pending","P"] (setboolopt "pending") "include only pending postings/txns"
|
,flagNone ["pending","P"] (setboolopt "pending") "include only pending postings/txns"
|
||||||
,flagNone ["unmarked","U"] (setboolopt "unmarked") "include only unmarked postings/txns"
|
,flagNone ["cleared","C"] (setboolopt "cleared") "include only cleared postings/txns"
|
||||||
,flagNone ["real","R"] (setboolopt "real") "include only non-virtual postings"
|
,flagNone ["real","R"] (setboolopt "real") "include only non-virtual postings"
|
||||||
,flagReq ["depth"] (\s opts -> Right $ setopt "depth" s opts) "N" "hide accounts/postings deeper than N"
|
,flagReq ["depth"] (\s opts -> Right $ setopt "depth" s opts) "N" "hide accounts/postings deeper than N"
|
||||||
,flagNone ["empty","E"] (setboolopt "empty") "show items with zero amount, normally hidden"
|
,flagNone ["empty","E"] (setboolopt "empty") "show items with zero amount, normally hidden"
|
||||||
|
|||||||
@ -71,8 +71,8 @@ If the `--date2` command line flag is present, this matches [secondary dates](ma
|
|||||||
**`real:, real:0`**
|
**`real:, real:0`**
|
||||||
: match real or virtual postings respectively
|
: match real or virtual postings respectively
|
||||||
|
|
||||||
**`status:*, status:!, status:`**
|
**`status:, status:!, status:*`**
|
||||||
: match cleared, pending, or uncleared/pending transactions respectively
|
: match unmarked, pending, or cleared transactions respectively
|
||||||
|
|
||||||
**`tag:REGEX[=REGEX]`**
|
**`tag:REGEX[=REGEX]`**
|
||||||
: match by tag name, and optionally also by tag value. Note a
|
: match by tag name, and optionally also by tag value. Note a
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user