summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--CHANGES.md4
-rw-r--r--Hledger/UI/ErrorScreen.hs4
-rw-r--r--Hledger/UI/Main.hs24
-rw-r--r--Hledger/UI/UIOptions.hs20
-rw-r--r--hledger-ui.12
-rw-r--r--hledger-ui.cabal12
-rw-r--r--hledger-ui.info2
-rw-r--r--hledger-ui.txt2
8 files changed, 33 insertions, 37 deletions
diff --git a/CHANGES.md b/CHANGES.md
index 376062a..6fa2e99 100644
--- a/CHANGES.md
+++ b/CHANGES.md
@@ -1,6 +1,10 @@
User-visible changes in hledger-ui.
See also the hledger changelog.
+# 1.14 2019-03-01
+
+- use hledger 1.14
+
# 1.13.1 (2019/02/02)
- fix build issues with older brick/stack resolvers; require brick 0.23+
diff --git a/Hledger/UI/ErrorScreen.hs b/Hledger/UI/ErrorScreen.hs
index cf22eff..296836f 100644
--- a/Hledger/UI/ErrorScreen.hs
+++ b/Hledger/UI/ErrorScreen.hs
@@ -176,8 +176,8 @@ uiCheckBalanceAssertions d ui@UIState{aopts=UIOpts{cliopts_=copts}, ajournal=j}
| ignore_assertions_ $ inputopts_ copts = ui
| otherwise =
case journalCheckBalanceAssertions j of
- Right _ -> ui
- Left err ->
+ Nothing -> ui
+ Just err ->
case ui of
UIState{aScreen=s@ErrorScreen{}} -> ui{aScreen=s{esError=err}}
_ -> screenEnter d errorScreen{esError=err} ui
diff --git a/Hledger/UI/Main.hs b/Hledger/UI/Main.hs
index 74d97c3..e7415ab 100644
--- a/Hledger/UI/Main.hs
+++ b/Hledger/UI/Main.hs
@@ -61,28 +61,20 @@ writeChan = BC.writeBChan
main :: IO ()
main = do
opts <- getHledgerUIOpts
+ let copts = cliopts_ opts
+ copts' = copts
+ { inputopts_ = (inputopts_ copts) { auto_ = True }
+ , reportopts_ = (reportopts_ copts) { forecast_ = True }
+ }
+
-- when (debug_ $ cliopts_ opts) $ printf "%s\n" prognameandversion >> printf "opts: %s\n" (show opts)
- run opts
+ run $ opts { cliopts_ = copts' }
where
run opts
| "help" `inRawOpts` (rawopts_ $ cliopts_ opts) = putStr (showModeUsage uimode) >> exitSuccess
| "version" `inRawOpts` (rawopts_ $ cliopts_ opts) = putStrLn prognameandversion >> exitSuccess
| "binary-filename" `inRawOpts` (rawopts_ $ cliopts_ opts) = putStrLn (binaryfilename progname)
- | otherwise = withJournalDoUICommand opts runBrickUi
-
--- TODO fix nasty duplication of withJournalDo
--- | hledger-ui's version of withJournalDo, which turns on --auto and --forecast.
-withJournalDoUICommand :: UIOpts -> (UIOpts -> Journal -> IO ()) -> IO ()
-withJournalDoUICommand uopts@UIOpts{cliopts_=copts@CliOpts{inputopts_=iopts,reportopts_=ropts}} cmd = do
- let copts' = copts{inputopts_=iopts{auto_=True}, reportopts_=ropts{forecast_=True}}
- journalpath <- journalFilePathFromOpts copts'
- ej <- readJournalFiles (inputopts_ copts') journalpath
- let fn = cmd uopts
- . pivotByOpts copts'
- . anonymiseByOpts copts'
- <=< journalApplyValue (reportopts_ copts')
- <=< journalAddForecast copts'
- either error' fn ej
+ | otherwise = withJournalDo (cliopts_ opts) (runBrickUi opts)
runBrickUi :: UIOpts -> Journal -> IO ()
runBrickUi uopts@UIOpts{cliopts_=copts@CliOpts{inputopts_=_iopts,reportopts_=ropts}} j = do
diff --git a/Hledger/UI/UIOptions.hs b/Hledger/UI/UIOptions.hs
index 1e38395..4ef7bf4 100644
--- a/Hledger/UI/UIOptions.hs
+++ b/Hledger/UI/UIOptions.hs
@@ -26,23 +26,23 @@ prognameandversion :: String
prognameandversion = progname ++ " " ++ version :: String
uiflags = [
- -- flagNone ["debug-ui"] (\opts -> setboolopt "rules-file" opts) "run with no terminal output, showing console"
- flagNone ["watch"] (\opts -> setboolopt "watch" opts) "watch for data and date changes and reload automatically"
+ -- flagNone ["debug-ui"] (setboolopt "rules-file") "run with no terminal output, showing console"
+ flagNone ["watch"] (setboolopt "watch") "watch for data and date changes and reload automatically"
,flagReq ["theme"] (\s opts -> Right $ setopt "theme" s opts) "THEME" ("use this custom display theme ("++intercalate ", " themeNames++")")
,flagReq ["register"] (\s opts -> Right $ setopt "register" s opts) "ACCTREGEX" "start in the (first) matched account's register"
- ,flagNone ["change"] (\opts -> setboolopt "change" opts)
+ ,flagNone ["change"] (setboolopt "change")
"show period balances (changes) at startup instead of historical balances"
- -- ,flagNone ["cumulative"] (\opts -> setboolopt "cumulative" opts)
+ -- ,flagNone ["cumulative"] (setboolopt "cumulative")
-- "show balance change accumulated across periods (in multicolumn reports)"
- -- ,flagNone ["historical","H"] (\opts -> setboolopt "historical" opts)
+ -- ,flagNone ["historical","H"] (setboolopt "historical")
-- "show historical ending balance in each period (includes postings before report start date)\n "
- ,flagNone ["flat","F"] (\opts -> setboolopt "flat" opts) "show accounts as a list (default)"
- ,flagNone ["tree","T"] (\opts -> setboolopt "tree" opts) "show accounts as a tree"
--- ,flagNone ["present"] (\opts -> setboolopt "present" opts) "exclude transactions dated later than today (default)"
- ,flagNone ["future"] (\opts -> setboolopt "future" opts) "show transactions dated later than today (normally hidden)"
+ ,flagNone ["flat","F"] (setboolopt "flat") "show accounts as a list (default)"
+ ,flagNone ["tree","T"] (setboolopt "tree") "show accounts as a tree"
+-- ,flagNone ["present"] (setboolopt "present") "exclude transactions dated later than today (default)"
+ ,flagNone ["future"] (setboolopt "future") "show transactions dated later than today (normally hidden)"
-- ,flagReq ["drop"] (\s opts -> Right $ setopt "drop" s opts) "N" "with --flat, omit this many leading account name components"
-- ,flagReq ["format"] (\s opts -> Right $ setopt "format" s opts) "FORMATSTR" "use this custom line format"
- -- ,flagNone ["no-elide"] (\opts -> setboolopt "no-elide" opts) "don't compress empty parent accounts on one line"
+ -- ,flagNone ["no-elide"] (setboolopt "no-elide") "don't compress empty parent accounts on one line"
]
--uimode :: Mode [([Char], [Char])]
diff --git a/hledger-ui.1 b/hledger-ui.1
index d494033..cddadc4 100644
--- a/hledger-ui.1
+++ b/hledger-ui.1
@@ -1,5 +1,5 @@
-.TH "hledger\-ui" "1" "February 2019" "hledger\-ui 1.13" "hledger User Manuals"
+.TH "hledger\-ui" "1" "March 2019" "hledger\-ui 1.14" "hledger User Manuals"
diff --git a/hledger-ui.cabal b/hledger-ui.cabal
index aadabf8..6492c61 100644
--- a/hledger-ui.cabal
+++ b/hledger-ui.cabal
@@ -4,10 +4,10 @@ cabal-version: 1.12
--
-- see: https://github.com/sol/hpack
--
--- hash: 4b9a172790149cbb1e235f9c3377412d7cc7a4a61faa2c1f1eada3a18b2a1088
+-- hash: 32ad755bb064842ea131b724ee18e8a276c62b2fec58ccff27540efac91cb374
name: hledger-ui
-version: 1.13.1
+version: 1.14
synopsis: Curses-style user interface for the hledger accounting tool
description: This is hledger's curses-style interface.
It is simpler and more convenient for browsing data than the command-line interface,
@@ -27,7 +27,7 @@ author: Simon Michael <simon@joyful.com>
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
+tested-with: GHC==7.10.3, GHC==8.0.2, GHC==8.2.2, GHC==8.4.3, GHC==8.6.3
build-type: Simple
extra-source-files:
CHANGES.md
@@ -64,7 +64,7 @@ executable hledger-ui
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.13.1"
+ cpp-options: -DVERSION="1.14"
build-depends:
ansi-terminal >=0.6.2.3
, async
@@ -76,8 +76,8 @@ executable hledger-ui
, directory
, filepath
, fsnotify >=0.2.1.2 && <0.4
- , hledger >=1.13 && <1.14
- , hledger-lib >=1.13 && <1.14
+ , hledger >=1.14 && <1.15
+ , hledger-lib >=1.14 && <1.15
, megaparsec >=7.0.0 && <8
, microlens >=0.4
, microlens-platform >=0.2.3.1
diff --git a/hledger-ui.info b/hledger-ui.info
index e96dbeb..2dc82fc 100644
--- a/hledger-ui.info
+++ b/hledger-ui.info
@@ -3,7 +3,7 @@ This is hledger-ui.info, produced by makeinfo version 6.5 from stdin.

File: hledger-ui.info, Node: Top, Next: OPTIONS, Up: (dir)
-hledger-ui(1) hledger-ui 1.13
+hledger-ui(1) hledger-ui 1.14
*****************************
hledger-ui is hledger's curses-style interface, providing an efficient
diff --git a/hledger-ui.txt b/hledger-ui.txt
index a4a13b9..9c9492f 100644
--- a/hledger-ui.txt
+++ b/hledger-ui.txt
@@ -406,4 +406,4 @@ SEE ALSO
-hledger-ui 1.13 February 2019 hledger-ui(1)
+hledger-ui 1.14 March 2019 hledger-ui(1)