hledger-ui 1.15 → 1.16
raw patch · 12 files changed
+297/−127 lines, 12 filesdep ~basedep ~base-compat-batteriesdep ~hledger
Dependency ranges changed: base, base-compat-batteries, hledger, hledger-lib
Files
- CHANGES.md +9/−0
- Hledger/UI/AccountsScreen.hs +2/−0
- Hledger/UI/Main.hs +8/−2
- Hledger/UI/RegisterScreen.hs +2/−0
- Hledger/UI/TransactionScreen.hs +72/−26
- Hledger/UI/UIOptions.hs +12/−9
- Hledger/UI/UIState.hs +26/−0
- Hledger/UI/UIUtils.hs +3/−1
- hledger-ui.1 +35/−7
- hledger-ui.cabal +11/−11
- hledger-ui.info +41/−17
- hledger-ui.txt +76/−54
CHANGES.md view
@@ -1,6 +1,15 @@ User-visible changes in hledger-ui. See also the hledger changelog. +# 1.16 2019-12-01++- add support for GHC 8.8, base-compat 0.11 (#1090)++- drop support for GHC 7.10++- the B and V keys toggle cost or value display (like the -B and -V+ command line flags)+ # 1.15 2019-09-01 - allow brick >=0.47
Hledger/UI/AccountsScreen.hs view
@@ -311,6 +311,8 @@ VtyEvent (EvKey (KChar 'a') []) -> suspendAndResume $ clearScreen >> setCursorPosition 0 0 >> add copts j >> uiReloadJournalIfChanged copts d j ui VtyEvent (EvKey (KChar 'A') []) -> suspendAndResume $ void (runIadd (journalFilePath j)) >> uiReloadJournalIfChanged copts d j ui VtyEvent (EvKey (KChar 'E') []) -> suspendAndResume $ void (runEditor endPos (journalFilePath j)) >> uiReloadJournalIfChanged copts d j ui+ VtyEvent (EvKey (KChar 'B') []) -> continue $ regenerateScreens j d $ toggleCost ui+ VtyEvent (EvKey (KChar 'V') []) -> continue $ regenerateScreens j d $ toggleValue ui VtyEvent (EvKey (KChar '0') []) -> continue $ regenerateScreens j d $ setDepth (Just 0) ui VtyEvent (EvKey (KChar '1') []) -> continue $ regenerateScreens j d $ setDepth (Just 1) ui VtyEvent (EvKey (KChar '2') []) -> continue $ regenerateScreens j d $ setDepth (Just 2) ui
Hledger/UI/Main.hs view
@@ -4,6 +4,7 @@ Released under GPL version 3 or later. -} {-# LANGUAGE CPP #-}+{-# LANGUAGE LambdaCase #-} {-# LANGUAGE OverloadedStrings #-} {-# LANGUAGE MultiParamTypeClasses #-} @@ -97,7 +98,7 @@ depth_ =depthfromoptsandargs, period_=periodfromoptsandargs, query_ =unwords -- as in ReportOptions, with same limitations- [v | (k,v) <- rawopts_ copts, k=="args", not $ any (`isPrefixOf` v) ["depth","date"]],+ $ collectopts filteredQueryArg (rawopts_ copts), -- always disable boring account name eliding, unlike the CLI, for a more regular tree no_elide_=True, -- flip the default for items with zero amounts, show them by default@@ -114,6 +115,11 @@ datespanfromargs = queryDateSpan (date2_ ropts) $ fst $ parseQuery d (T.pack $ query_ ropts) periodfromoptsandargs = dateSpanAsPeriod $ spansIntersect [periodAsDateSpan $ period_ ropts, datespanfromargs]+ filteredQueryArg = \case+ ("args", v)+ | not $ any (`isPrefixOf` v) ["depth:", "date:"] -- skip depth/date passed as query+ -> Just (quoteIfNeeded v)+ _ -> Nothing -- XXX move this stuff into Options, UIOpts theme = maybe defaultTheme (fromMaybe defaultTheme . getTheme) $@@ -166,7 +172,7 @@ if not (watch_ uopts') then- void $ defaultMain brickapp ui+ void $ Brick.defaultMain brickapp ui else do -- a channel for sending misc. events to the app
Hledger/UI/RegisterScreen.hs view
@@ -322,6 +322,8 @@ rsItemTransaction=Transaction{tsourcepos=JournalSourcePos f (l,_)}}) -> (Just (l, Nothing),f) -- display mode/query toggles+ VtyEvent (EvKey (KChar 'B') []) -> rsCenterAndContinue $ regenerateScreens j d $ toggleCost ui+ VtyEvent (EvKey (KChar 'V') []) -> rsCenterAndContinue $ regenerateScreens j d $ toggleValue ui VtyEvent (EvKey (KChar 'H') []) -> rsCenterAndContinue $ regenerateScreens j d $ toggleHistorical ui VtyEvent (EvKey (KChar 'T') []) -> rsCenterAndContinue $ regenerateScreens j d $ toggleTree ui VtyEvent (EvKey (KChar 'Z') []) -> rsCenterAndContinue $ regenerateScreens j d $ toggleEmpty ui
Hledger/UI/TransactionScreen.hs view
@@ -12,6 +12,7 @@ import Control.Monad import Control.Monad.IO.Class (liftIO) import Data.List+import Data.Maybe #if !(MIN_VERSION_base(4,11,0)) import Data.Monoid #endif@@ -43,12 +44,22 @@ tsInit :: Day -> Bool -> UIState -> UIState tsInit _d _reset ui@UIState{aopts=UIOpts{cliopts_=CliOpts{reportopts_=_ropts}}- ,ajournal=_j- ,aScreen=TransactionScreen{..}} = ui+ ,ajournal=_j+ ,aScreen=TransactionScreen{..}+ } =+ -- plog ("initialising TransactionScreen, value_ is "+ -- -- ++ (pshow (Just (AtDefault Nothing)::Maybe ValuationType))+ -- ++(pshow (value_ _ropts)) -- XXX calling value_ here causes plog to fail with: debug.log: openFile: resource busy (file is locked)+ -- ++ "?"+ -- ++" and first commodity is")+ -- (acommodity$head$amounts$pamount$head$tpostings$snd$tsTransaction)+ -- `seq`+ ui tsInit _ _ _ = error "init function called with wrong screen type, should not happen" tsDraw :: UIState -> [Widget Name] tsDraw UIState{aopts=UIOpts{cliopts_=copts@CliOpts{reportopts_=ropts}}+ ,ajournal=j ,aScreen=TransactionScreen{tsTransaction=(i,t) ,tsTransactions=nts ,tsAccount=acct@@ -61,8 +72,20 @@ _ -> [maincontent] where maincontent = Widget Greedy Greedy $ do+ let+ prices = journalPriceOracle j+ styles = journalCommodityStyles j+ periodlast =+ fromMaybe (error' "TransactionScreen: expected a non-empty journal") $ -- XXX shouldn't happen+ reportPeriodOrJournalLastDay ropts j+ mreportlast = reportPeriodLastDay ropts+ today = fromMaybe (error' "TransactionScreen: could not pick a valuation date, ReportOpts today_ is unset") $ today_ ropts+ multiperiod = interval_ ropts /= NoInterval+ render $ defaultLayout toplabel bottomlabel $ str $- showTransactionUnelidedOneLineAmounts $+ showTransactionOneLineAmounts $+ (if valuationTypeIsCost ropts then transactionToCost (journalCommodityStyles j) else id) $+ (if valuationTypeIsDefaultValue ropts then (\t -> transactionApplyValuation prices styles periodlast mreportlast today multiperiod t (AtDefault Nothing)) else id) $ -- (if real_ ropts then filterTransactionPostings (Real True) else id) -- filter postings by --real t where@@ -142,38 +165,35 @@ where p = reportPeriod ui e | e `elem` [VtyEvent (EvKey (KChar 'g') []), AppEvent FileChange] -> do+ -- plog (if e == AppEvent FileChange then "file change" else "manual reload") "" `seq` return () d <- liftIO getCurrentDay ej <- liftIO $ journalReload copts case ej of Left err -> continue $ screenEnter d errorScreen{esError=err} ui Right j' -> do- -- got to redo the register screen's transactions report, to get the latest transactions list for this screen- -- XXX duplicates rsInit- let- ropts' = ropts {depth_=Nothing- ,balancetype_=HistoricalBalance- }- q = filterQuery (not . queryIsDepth) $ queryFromOpts d ropts'- thisacctq = Acct $ accountNameToAccountRegex acct -- includes subs- items = reverse $ snd $ accountTransactionsReport ropts j' q thisacctq- ts = map first6 items- numberedts = zip [1..] ts- -- select the best current transaction from the new list- -- stay at the same index if possible, or if we are now past the end, select the last, otherwise select the first- (i',t') = case lookup i numberedts- of Just t'' -> (i,t'')- Nothing | null numberedts -> (0,nulltransaction)- | i > fst (last numberedts) -> last numberedts- | otherwise -> head numberedts- ui' = ui{aScreen=s{tsTransaction=(i',t')- ,tsTransactions=numberedts- ,tsAccount=acct}}- continue $ regenerateScreens j' d ui'+ continue $+ regenerateScreens j' d $+ regenerateTransactions ropts d j' s acct i $ -- added (inline) 201512 (why ?)+ clearCostValue $+ ui VtyEvent (EvKey (KChar 'I') []) -> continue $ uiCheckBalanceAssertions d (toggleIgnoreBalanceAssertions ui)- -- if allowing toggling here, we should refresh the txn list from the parent register screen++ -- for toggles that may change the current/prev/next transactions,+ -- we must regenerate the transaction list, like the g handler above ? with regenerateTransactions ? TODO WIP -- EvKey (KChar 'E') [] -> continue $ regenerateScreens j d $ stToggleEmpty ui -- EvKey (KChar 'C') [] -> continue $ regenerateScreens j d $ stToggleCleared ui -- EvKey (KChar 'R') [] -> continue $ regenerateScreens j d $ stToggleReal ui+ VtyEvent (EvKey (KChar 'B') []) ->+ continue $+ regenerateScreens j d $+ -- regenerateTransactions ropts d j s acct i $+ toggleCost ui+ VtyEvent (EvKey (KChar 'V') []) ->+ continue $+ regenerateScreens j d $+ -- regenerateTransactions ropts d j s acct i $+ toggleValue ui+ VtyEvent e | e `elem` moveUpEvents -> continue $ regenerateScreens j d ui{aScreen=s{tsTransaction=(iprev,tprev)}} VtyEvent e | e `elem` moveDownEvents -> continue $ regenerateScreens j d ui{aScreen=s{tsTransaction=(inext,tnext)}} VtyEvent e | e `elem` moveLeftEvents -> continue ui''@@ -185,6 +205,32 @@ _ -> continue ui tsHandle _ _ = error "event handler called with wrong screen type, should not happen"++-- Got to redo the register screen's transactions report, to get the latest transactions list for this screen.+-- XXX Duplicates rsInit. Why do we have to do this as well as regenerateScreens ?+regenerateTransactions :: ReportOpts -> Day -> Journal -> Screen -> AccountName -> Integer -> UIState -> UIState+regenerateTransactions ropts d j s acct i ui =+ let+ ropts' = ropts {depth_=Nothing+ ,balancetype_=HistoricalBalance+ }+ q = filterQuery (not . queryIsDepth) $ queryFromOpts d ropts'+ thisacctq = Acct $ accountNameToAccountRegex acct -- includes subs+ items = reverse $ snd $ accountTransactionsReport ropts j q thisacctq+ ts = map first6 items+ numberedts = zip [1..] ts+ -- select the best current transaction from the new list+ -- stay at the same index if possible, or if we are now past the end, select the last, otherwise select the first+ (i',t') = case lookup i numberedts+ of Just t'' -> (i,t'')+ Nothing | null numberedts -> (0,nulltransaction)+ | i > fst (last numberedts) -> last numberedts+ | otherwise -> head numberedts+ in+ ui{aScreen=s{tsTransaction=(i',t')+ ,tsTransactions=numberedts+ ,tsAccount=acct+ }} -- | Select the nth item on the register screen. rsSelect i scr@RegisterScreen{..} = scr{rsList=l'}
Hledger/UI/UIOptions.hs view
@@ -1,5 +1,6 @@ {-# LANGUAGE CPP #-} {-# LANGUAGE DeriveDataTypeable #-}+{-# LANGUAGE LambdaCase #-} {-| -}@@ -10,6 +11,7 @@ import Data.Default import Data.Typeable (Typeable) import Data.List (intercalate)+import Data.Maybe (fromMaybe) import System.Environment import Hledger.Cli hiding (progname,version,prognameandversion)@@ -45,8 +47,8 @@ -- ,flagNone ["no-elide"] (setboolopt "no-elide") "don't compress empty parent accounts on one line" ] ---uimode :: Mode [([Char], [Char])]-uimode = (mode "hledger-ui" [("command","ui")]+--uimode :: Mode RawOpts+uimode = (mode "hledger-ui" (setopt "command" "ui" def) "browse accounts, postings and entries in a full-window curses interface" (argsFlag "[PATTERNS]") []){ modeGroupFlags = Group {@@ -91,11 +93,12 @@ instance Default PresentOrFutureOpt where def = PFDefault presentorfutureopt :: RawOpts -> PresentOrFutureOpt-presentorfutureopt rawopts =- case reverse $ filter (`elem` ["present","future"]) $ map fst rawopts of- ("present":_) -> PFPresent- ("future":_) -> PFFuture- _ -> PFDefault+presentorfutureopt =+ fromMaybe PFDefault . choiceopt parse where+ parse = \case+ "present" -> Just PFPresent+ "future" -> Just PFFuture+ _ -> Nothing checkUIOpts :: UIOpts -> UIOpts checkUIOpts opts =@@ -106,10 +109,10 @@ -- XXX some refactoring seems due getHledgerUIOpts :: IO UIOpts---getHledgerUIOpts = processArgs uimode >>= return . decodeRawOpts >>= rawOptsToUIOpts+--getHledgerUIOpts = processArgs uimode >>= return >>= rawOptsToUIOpts getHledgerUIOpts = do args <- getArgs >>= expandArgsAt let args' = replaceNumericFlags args let cmdargopts = either usageError id $ process uimode args'- rawOptsToUIOpts $ decodeRawOpts cmdargopts+ rawOptsToUIOpts cmdargopts
Hledger/UI/UIState.hs view
@@ -108,6 +108,32 @@ where toggleEmpty ropts = ropts{empty_=not $ empty_ ropts} +-- | Show primary amounts, not cost or value.+clearCostValue :: UIState -> UIState+clearCostValue ui@UIState{aopts=uopts@UIOpts{cliopts_=copts@CliOpts{reportopts_=ropts}}} =+ ui{aopts=uopts{cliopts_=copts{reportopts_=ropts{value_ = plog "clearing value mode" Nothing}}}}++-- | Toggle between showing the primary amounts or costs.+toggleCost :: UIState -> UIState+toggleCost ui@UIState{aopts=uopts@UIOpts{cliopts_=copts@CliOpts{reportopts_=ropts}}} =+ ui{aopts=uopts{cliopts_=copts{reportopts_=ropts{value_ = valuationToggleCost $ value_ ropts}}}}++-- | Toggle between showing primary amounts or default valuation.+toggleValue :: UIState -> UIState+toggleValue ui@UIState{aopts=uopts@UIOpts{cliopts_=copts@CliOpts{reportopts_=ropts}}} =+ ui{aopts=uopts{cliopts_=copts{reportopts_=ropts{+ value_ = plog "toggling value mode to" $ valuationToggleValue $ value_ ropts}}}}++-- | Basic toggling of -B/cost, for hledger-ui.+valuationToggleCost :: Maybe ValuationType -> Maybe ValuationType+valuationToggleCost (Just (AtCost _)) = Nothing+valuationToggleCost _ = Just $ AtCost Nothing++-- | Basic toggling of -V, for hledger-ui.+valuationToggleValue :: Maybe ValuationType -> Maybe ValuationType+valuationToggleValue (Just (AtDefault _)) = Nothing+valuationToggleValue _ = Just $ AtDefault Nothing+ -- | Toggle between flat and tree mode. If current mode is unspecified/default, assume it's flat. toggleTree :: UIState -> UIState toggleTree ui@UIState{aopts=uopts@UIOpts{cliopts_=copts@CliOpts{reportopts_=ropts}}} =
Hledger/UI/UIUtils.hs view
@@ -129,13 +129,15 @@ ,str " " ,withAttr ("help" <> "heading") $ str "Help" ,renderKey ("? ", "toggle this help")- ,renderKey ("pmi ", "(with this help open)\nshow manual in pager/man/info")+ ,renderKey ("p/m/i ", "(with this help open)\nshow manual in pager/man/info") ,str " " ,withAttr ("help" <> "heading") $ str "Other" ,renderKey ("a ", "add transaction (hledger add)") ,renderKey ("A ", "add transaction (hledger-iadd)")+ ,renderKey ("B ", "toggle normal/cost mode") ,renderKey ("E ", "open editor") ,renderKey ("I ", "toggle balance assertions")+ ,renderKey ("V ", "toggle normal/value mode") ,renderKey ("g ", "reload data") ,renderKey ("C-l ", "redraw & recenter") ,renderKey ("C-z ", "suspend")
hledger-ui.1 view
@@ -1,11 +1,11 @@ -.TH "hledger-ui" "1" "August 2019" "hledger-ui 1.15" "hledger User Manuals"+.TH "hledger-ui" "1" "December 2019" "hledger-ui 1.16" "hledger User Manuals" .SH NAME .PP-hledger-ui - curses-style interface for the hledger accounting tool+hledger-ui - terminal interface for the hledger accounting tool .SH SYNOPSIS .PP \f[C]hledger-ui [OPTIONS] [QUERYARGS]\f[R]@@ -20,9 +20,9 @@ file format. hledger is inspired by and largely compatible with ledger(1). .PP-hledger-ui is hledger\[aq]s curses-style interface, providing an-efficient full-window text UI for viewing accounts and transactions, and-some limited data entry capability.+hledger-ui is hledger\[aq]s terminal interface, providing an efficient+full-window text UI for viewing accounts and transactions, and some+limited data entry capability. It is easier than hledger\[aq]s command-line interface, and sometimes quicker and more convenient than the web interface. .PP@@ -245,7 +245,7 @@ This allows some basic data entry. .PP \f[C]A\f[R] is like \f[C]a\f[R], but runs the hledger-iadd tool, which-provides a curses-style interface.+provides a terminal interface. This key will be available if \f[C]hledger-iadd\f[R] is installed in $PATH. .PP@@ -258,6 +258,34 @@ .PP \f[C]q\f[R] quits the application. .PP+Experimental:+.PP+\f[C]B\f[R] toggles cost mode, showing amounts in their transaction+price\[aq]s commodity (like toggling the \f[C]-B/--cost\f[R] flag).+.PP+\f[C]V\f[R] toggles value mode, showing amounts\[aq] current market+value in their default valuation commodity (like toggling the+\f[C]-V/--market\f[R] flag).+Note, \[dq]current market value\[dq] means the value on the report end+date if specified, otherwise today.+To see the value on another date, you can temporarily set that as the+report end date.+Eg: to see a transaction as it was valued on july 30, go to the accounts+or register screen, press \f[C]/\f[R], and add \f[C]date:-7/30\f[R] to+the query.+.PP+At most one of cost or value mode can be active at once.+.PP+There\[aq]s not yet any visual reminder when cost or value mode is+active; for now pressing \f[C]B\f[R] \f[C]B\f[R] \f[C]V\f[R] should+reliably reset to normal mode.+.PP+With --watch active, if you save an edit to the journal file while+viewing the transaction screen in cost or value mode, the+\f[C]B\f[R]/\f[C]V\f[R] keys will stop working.+To work around, press g to force a manual reload, or exit the+transaction screen.+.PP Additional screen-specific keys are described below. .SH SCREENS .SS Accounts screen@@ -440,7 +468,7 @@ .SH COPYRIGHT -Copyright (C) 2007-2016 Simon Michael.+Copyright (C) 2007-2019 Simon Michael. .br Released under GNU GPL v3 or later.
hledger-ui.cabal view
@@ -4,19 +4,19 @@ -- -- see: https://github.com/sol/hpack ----- hash: 0deef0df7a1a0ef153ebf7e31ddd57882a2671941a0f801bc2980dae7080501f+-- hash: 440030049a4495a4af1bac097d5e39afb5f4044d1f257574f04b22d4cd171038 name: hledger-ui-version: 1.15-synopsis: Curses-style user interface for the hledger accounting tool-description: This is hledger's curses-style interface.+version: 1.16+synopsis: Terminal user interface for the hledger accounting tool+description: This is hledger's terminal interface. It is simpler and more convenient for browsing data than the command-line interface, but lighter and faster than hledger-web. . hledger is a cross-platform program for tracking money, time, or any other commodity, using double-entry accounting and a simple, editable file format. It is inspired by and largely compatible- with ledger(1). hledger provides command-line, curses and web+ with ledger(1). hledger provides command-line, terminal and web interfaces, and aims to be a reliable, practical tool for daily use. category: Finance, Console@@ -27,7 +27,7 @@ maintainer: Simon Michael <simon@joyful.com> license: GPL-3 license-file: LICENSE-tested-with: GHC==7.10.3, GHC==8.0.2, GHC==8.2.2, GHC==8.4.3, GHC==8.6.5+tested-with: GHC==8.0.2, GHC==8.2.2, GHC==8.4.3, GHC==8.6.5, GHC==8.8.1 build-type: Simple extra-source-files: CHANGES.md@@ -64,20 +64,20 @@ hs-source-dirs: ./. ghc-options: -Wall -fno-warn-unused-do-bind -fno-warn-name-shadowing -fno-warn-missing-signatures -fno-warn-type-defaults -fno-warn-orphans- cpp-options: -DVERSION="1.15"+ cpp-options: -DVERSION="1.16" build-depends: ansi-terminal >=0.6.2.3 , async- , base >=4.8 && <4.13- , base-compat-batteries >=0.10.1 && <0.11+ , base >=4.9 && <4.14+ , base-compat-batteries >=0.10.1 && <0.12 , cmdargs >=0.8 , containers , data-default , directory , filepath , fsnotify >=0.2.1.2 && <0.4- , hledger >=1.15 && <1.16- , hledger-lib >=1.15 && <1.16+ , hledger >=1.16 && <1.17+ , hledger-lib >=1.16 && <1.17 , megaparsec >=7.0.0 && <8 , microlens >=0.4 , microlens-platform >=0.2.3.1
hledger-ui.info view
@@ -3,10 +3,10 @@ File: hledger-ui.info, Node: Top, Next: OPTIONS, Up: (dir) -hledger-ui(1) hledger-ui 1.15+hledger-ui(1) hledger-ui 1.16 ***************************** -hledger-ui is hledger's curses-style interface, providing an efficient+hledger-ui is hledger's terminal interface, providing an efficient full-window text UI for viewing accounts and transactions, and some limited data entry capability. It is easier than hledger's command-line interface, and sometimes quicker and more convenient than the web@@ -239,7 +239,7 @@ file. This allows some basic data entry. 'A' is like 'a', but runs the hledger-iadd tool, which provides a-curses-style interface. This key will be available if 'hledger-iadd' is+terminal interface. This key will be available if 'hledger-iadd' is installed in $PATH. 'E' runs $HLEDGER_UI_EDITOR, or $EDITOR, or a default ('emacsclient@@ -250,6 +250,30 @@ 'q' quits the application. + Experimental:++ 'B' toggles cost mode, showing amounts in their transaction price's+commodity (like toggling the '-B/--cost' flag).++ 'V' toggles value mode, showing amounts' current market value in+their default valuation commodity (like toggling the '-V/--market'+flag). Note, "current market value" means the value on the report end+date if specified, otherwise today. To see the value on another date,+you can temporarily set that as the report end date. Eg: to see a+transaction as it was valued on july 30, go to the accounts or register+screen, press '/', and add 'date:-7/30' to the query.++ At most one of cost or value mode can be active at once.++ There's not yet any visual reminder when cost or value mode is+active; for now pressing 'B' 'B' 'V' should reliably reset to normal+mode.++ With -watch active, if you save an edit to the journal file while+viewing the transaction screen in cost or value mode, the 'B'/'V' keys+will stop working. To work around, press g to force a manual reload, or+exit the transaction screen.+ Additional screen-specific keys are described below. @@ -399,19 +423,19 @@ Tag Table: Node: Top71-Node: OPTIONS1101-Ref: #options1198-Node: KEYS4589-Ref: #keys4684-Node: SCREENS7940-Ref: #screens8025-Node: Accounts screen8115-Ref: #accounts-screen8243-Node: Register screen10459-Ref: #register-screen10614-Node: Transaction screen12610-Ref: #transaction-screen12768-Node: Error screen13638-Ref: #error-screen13760+Node: OPTIONS1097+Ref: #options1194+Node: KEYS4585+Ref: #keys4680+Node: SCREENS8987+Ref: #screens9072+Node: Accounts screen9162+Ref: #accounts-screen9290+Node: Register screen11506+Ref: #register-screen11661+Node: Transaction screen13657+Ref: #transaction-screen13815+Node: Error screen14685+Ref: #error-screen14807 End Tag Table
hledger-ui.txt view
@@ -4,7 +4,7 @@ NAME- hledger-ui - curses-style interface for the hledger accounting tool+ hledger-ui - terminal interface for the hledger accounting tool SYNOPSIS hledger-ui [OPTIONS] [QUERYARGS]@@ -16,7 +16,7 @@ file format. hledger is inspired by and largely compatible with ledger(1). - hledger-ui is hledger's curses-style interface, providing an efficient+ hledger-ui is hledger's terminal interface, providing an efficient full-window text UI for viewing accounts and transactions, and some limited data entry capability. It is easier than hledger's command- line interface, and sometimes quicker and more convenient than the web@@ -117,8 +117,8 @@ using period expressions syntax --date2- match the secondary date instead (see command help for other- effects)+ match the secondary date instead (see command help for other ef-+ fects) -U --unmarked include only unmarked postings/txns (can combine with -P or -C)@@ -204,8 +204,8 @@ BACKSPACE or DELETE removes all filters, showing all transactions. As mentioned above, hledger-ui shows auto-generated periodic transac-- tions, and hides future transactions (auto-generated or not) by- default. F toggles showing and hiding these future transactions. This+ tions, and hides future transactions (auto-generated or not) by de-+ fault. F toggles showing and hiding these future transactions. This is similar to using a query like date:-tomorrow, but more convenient. (experimental) @@ -226,9 +226,9 @@ a runs command-line hledger's add command, and reloads the updated file. This allows some basic data entry. - A is like a, but runs the hledger-iadd tool, which provides a curses-- style interface. This key will be available if hledger-iadd is- installed in $PATH.+ A is like a, but runs the hledger-iadd tool, which provides a terminal+ interface. This key will be available if hledger-iadd is installed in+ $PATH. E runs $HLEDGER_UI_EDITOR, or $EDITOR, or a default (emacsclient -a "" -nw) on the journal file. With some editors (emacs, vi), the cursor@@ -238,27 +238,49 @@ q quits the application. + Experimental:++ B toggles cost mode, showing amounts in their transaction price's com-+ modity (like toggling the -B/--cost flag).++ V toggles value mode, showing amounts' current market value in their+ default valuation commodity (like toggling the -V/--market flag).+ Note, "current market value" means the value on the report end date if+ specified, otherwise today. To see the value on another date, you can+ temporarily set that as the report end date. Eg: to see a transaction+ as it was valued on july 30, go to the accounts or register screen,+ press /, and add date:-7/30 to the query.++ At most one of cost or value mode can be active at once.++ There's not yet any visual reminder when cost or value mode is active;+ for now pressing B B V should reliably reset to normal mode.++ With --watch active, if you save an edit to the journal file while+ viewing the transaction screen in cost or value mode, the B/V keys will+ stop working. To work around, press g to force a manual reload, or+ exit the transaction screen.+ Additional screen-specific keys are described below. SCREENS Accounts screen- This is normally the first screen displayed. It lists accounts and- their balances, like hledger's balance command. By default, it shows- all accounts and their latest ending balances (including the balances- of subaccounts). if you specify a query on the command line, it shows+ This is normally the first screen displayed. It lists accounts and+ their balances, like hledger's balance command. By default, it shows+ all accounts and their latest ending balances (including the balances+ of subaccounts). if you specify a query on the command line, it shows just the matched accounts and the balances from matched transactions. - Account names are shown as a flat list by default. Press T to toggle- tree mode. In flat mode, account balances are exclusive of subac-- counts, except where subaccounts are hidden by a depth limit (see- below). In tree mode, all account balances are inclusive of subac-- counts.+ Account names are shown as a flat list by default. Press T to toggle+ tree mode. In flat mode, account balances are exclusive of subac-+ counts, except where subaccounts are hidden by a depth limit (see be-+ low). In tree mode, all account balances are inclusive of subaccounts. To see less detail, press a number key, 1 to 9, to set a depth limit. Or use - to decrease and +/= to increase the depth limit. 0 shows even less detail, collapsing all accounts to a single total. To remove the- depth limit, set it higher than the maximum account depth, or press- ESCAPE.+ depth limit, set it higher than the maximum account depth, or press ES-+ CAPE. H toggles between showing historical balances or period balances. His- torical balances (the default) are ending balances at the end of the@@ -266,15 +288,15 @@ (filtered by the filter query if any), including transactions before the start of the report period. In other words, historical balances are what you would see on a bank statement for that account (unless- disturbed by a filter query). Period balances ignore transactions- before the report start date, so they show the change in balance during+ disturbed by a filter query). Period balances ignore transactions be-+ fore the report start date, so they show the change in balance during the report period. They are more useful eg when viewing a time log. U toggles filtering by unmarked status, including or excluding unmarked postings in the balances. Similarly, P toggles pending postings, and C toggles cleared postings. (By default, balances include all postings;- if you activate one or two status filters, only those postings are- included; and if you activate all three, the filter is removed.)+ if you activate one or two status filters, only those postings are in-+ cluded; and if you activate all three, the filter is removed.) R toggles real mode, in which virtual postings are ignored. @@ -318,33 +340,33 @@ R toggles real mode, in which virtual postings are ignored. - Z toggles nonzero mode, in which only transactions posting a nonzero- change are shown (hledger-ui shows zero items by default, unlike com-+ Z toggles nonzero mode, in which only transactions posting a nonzero+ change are shown (hledger-ui shows zero items by default, unlike com- mand-line hledger). Press right (or enter) to view the selected transaction in detail. Transaction screen- This screen shows a single transaction, as a general journal entry,- similar to hledger's print command and journal format (hledger_jour-+ This screen shows a single transaction, as a general journal entry,+ similar to hledger's print command and journal format (hledger_jour- nal(5)). - The transaction's date(s) and any cleared flag, transaction code,- description, comments, along with all of its account postings are- shown. Simple transactions have two postings, but there can be more- (or in certain cases, fewer).+ The transaction's date(s) and any cleared flag, transaction code, de-+ scription, comments, along with all of its account postings are shown.+ Simple transactions have two postings, but there can be more (or in+ certain cases, fewer). - up and down will step through all transactions listed in the previous- account register screen. In the title bar, the numbers in parentheses- show your position within that account register. They will vary- depending on which account register you came from (remember most trans-- actions appear in multiple account registers). The #N number preceding+ up and down will step through all transactions listed in the previous+ account register screen. In the title bar, the numbers in parentheses+ show your position within that account register. They will vary de-+ pending on which account register you came from (remember most transac-+ tions appear in multiple account registers). The #N number preceding them is the transaction's position within the complete unfiltered jour- nal, which is a more stable id (at least until the next reload). Error screen- This screen will appear if there is a problem, such as a parse error,- when you press g to reload. Once you have fixed the problem, press g+ This screen will appear if there is a problem, such as a parse error,+ when you press g to reload. Once you have fixed the problem, press g again to reload and resume normal operation. (Or, you can press escape to cancel the reload attempt.) @@ -352,17 +374,17 @@ COLUMNS The screen width to use. Default: the full terminal width. LEDGER_FILE The journal file path when not specified with -f. Default:- ~/.hledger.journal (on windows, perhaps C:/Users/USER/.hledger.jour-+ ~/.hledger.journal (on windows, perhaps C:/Users/USER/.hledger.jour- nal). FILES- Reads data from one or more files in hledger journal, timeclock, time-- dot, or CSV format specified with -f, or $LEDGER_FILE, or- $HOME/.hledger.journal (on windows, perhaps+ Reads data from one or more files in hledger journal, timeclock, time-+ dot, or CSV format specified with -f, or $LEDGER_FILE, or+ $HOME/.hledger.journal (on windows, perhaps C:/Users/USER/.hledger.journal). BUGS- The need to precede options with -- when invoked from hledger is awk-+ The need to precede options with -- when invoked from hledger is awk- ward. -f- doesn't work (hledger-ui can't read from stdin).@@ -370,24 +392,24 @@ -V affects only the accounts screen. When you press g, the current and all previous screens are regenerated,- which may cause a noticeable pause with large files. Also there is no+ which may cause a noticeable pause with large files. Also there is no visual indication that this is in progress. - --watch is not yet fully robust. It works well for normal usage, but- many file changes in a short time (eg saving the file thousands of- times with an editor macro) can cause problems at least on OSX. Symp-- toms include: unresponsive UI, periodic resetting of the cursor posi-+ --watch is not yet fully robust. It works well for normal usage, but+ many file changes in a short time (eg saving the file thousands of+ times with an editor macro) can cause problems at least on OSX. Symp-+ toms include: unresponsive UI, periodic resetting of the cursor posi- tion, momentary display of parse errors, high CPU usage eventually sub- siding, and possibly a small but persistent build-up of CPU usage until the program is restarted. - Also, if you are viewing files mounted from another machine, --watch+ Also, if you are viewing files mounted from another machine, --watch requires that both machine clocks are roughly in step. REPORTING BUGS- Report bugs at http://bugs.hledger.org (or on the #hledger IRC channel+ Report bugs at http://bugs.hledger.org (or on the #hledger IRC channel or hledger mail list) @@ -396,12 +418,12 @@ COPYRIGHT- Copyright (C) 2007-2016 Simon Michael.+ Copyright (C) 2007-2019 Simon Michael. Released under GNU GPL v3 or later. SEE ALSO- hledger(1), hledger-ui(1), hledger-web(1), hledger-api(1),+ hledger(1), hledger-ui(1), hledger-web(1), hledger-api(1), hledger_csv(5), hledger_journal(5), hledger_timeclock(5), hledger_time- dot(5), ledger(1) @@ -409,4 +431,4 @@ -hledger-ui 1.15 August 2019 hledger-ui(1)+hledger-ui 1.16 December 2019 hledger-ui(1)