hledger 0.18.2 → 0.19
raw patch · 7 files changed
+45/−37 lines, 7 filesdep −cabal-file-thdep ~cmdargsdep ~haskelinedep ~hledger-libPVP ok
version bump matches the API change (PVP)
Dependencies removed: cabal-file-th
Dependency ranges changed: cmdargs, haskeline, hledger-lib, split
API changes (from Hackage documentation)
- Hledger.Cli.Version: progname, prognameandversion, version :: String
+ Hledger.Cli.Version: progname :: String
+ Hledger.Cli.Version: prognameandversion :: String
+ Hledger.Cli.Version: version :: String
- Hledger.Cli.Histogram: printDayWith :: (PrintfType t, PrintfArg t1) => (t2 -> t1) -> (DateSpan, t2) -> t
+ Hledger.Cli.Histogram: printDayWith :: PrintfType (t2 -> t) => (t1 -> t2) -> (DateSpan, t1) -> t
Files
- Hledger/Cli.hs +1/−6
- Hledger/Cli/Add.hs +2/−3
- Hledger/Cli/Options.hs +6/−1
- Hledger/Cli/Stats.hs +2/−2
- Hledger/Cli/Utils.hs +16/−3
- Hledger/Cli/Version.hs +4/−6
- hledger.cabal +14/−16
Hledger/Cli.hs view
@@ -133,11 +133,6 @@ ,"show hours" ~: showAmount (hours 1) ~?= "1.0h" - ,"subAccounts" ~: do- let l = journalToLedger Any samplejournal- a = ledgerAccount l "assets"- map aname (ledgerSubAccounts l a) `is` ["assets:bank","assets:cash"]- ] @@ -539,7 +534,7 @@ [] (TOD 0 0) -ledger7 = journalToLedger Any journal7+ledger7 = ledgerFromJournal Any journal7 -- journal8_str = unlines -- ["2008/1/1 test "
Hledger/Cli/Add.hs view
@@ -24,7 +24,6 @@ import System.IO.Error import Text.ParserCombinators.Parsec import Text.Printf-import qualified Data.Foldable as Foldable (find) import qualified Data.Set as Set import Hledger@@ -88,9 +87,9 @@ date = fixSmartDate today $ fromparse $ (parse smartdate "" . lowercase) datestr accept x = x == "." || (not . null) x && if no_new_accounts_ opts- then isJust $ Foldable.find (== x) ant+ then x `elem` existingaccts else True- where (ant,_,_,_) = groupPostings $ journalPostings j+ existingaccts = journalAccountNames j getpostingsandvalidate = do ps <- getPostings (PostingState j accept True bestmatchpostings) [] let t = nulltransaction{tdate=date
Hledger/Cli/Options.hs view
@@ -40,6 +40,7 @@ ,modeValue = [] ,modeCheck = Right ,modeReform = const Nothing+ ,modeExpandAt = True ,modeGroupFlags = toGroup [] ,modeArgs = ([], Nothing) ,modeGroupModes = toGroup []@@ -481,7 +482,11 @@ alias' = case alias of ('=':rest) -> rest _ -> orig -showModeHelp = showText defaultWrap . helpText [] HelpFormatDefault+showModeHelp :: Mode a -> String+showModeHelp =+ (showText defaultWrap :: [Text] -> String)+ .+ (helpText [] HelpFormatDefault :: Mode a -> [Text]) tests_Hledger_Cli_Options = TestList [
Hledger/Cli/Stats.hs view
@@ -25,7 +25,7 @@ stats CliOpts{reportopts_=reportopts_} j = do d <- getCurrentDay let q = queryFromOpts d reportopts_- l = journalToLedger q j+ l = ledgerFromJournal q j reportspan = (ledgerDateSpan l) `orDatesFrom` (queryDateSpan False q) intervalspans = splitSpan (intervalFromOpts reportopts_) reportspan showstats = showLedgerStats l d@@ -58,7 +58,7 @@ -- Days since last transaction : %(recentelapsed)s ] where- j = ledgerJournal l+ j = ljournal l path = journalFilePath j ts = sortBy (comparing tdate) $ filter (spanContainsDate span . tdate) $ jtxns j as = nub $ map paccount $ concatMap tpostings ts
Hledger/Cli/Utils.hs view
@@ -1,4 +1,4 @@-{-# LANGUAGE ScopedTypeVariables #-}+{-# LANGUAGE ScopedTypeVariables, CPP #-} {-| Utilities for top-level modules and ghci. See also Hledger.Read and@@ -34,6 +34,10 @@ import System.Time (ClockTime, getClockTime, diffClockTimes, TimeDiff(TimeDiff)) import Test.HUnit import Text.Printf+#if __GLASGOW_HASKELL__ >= 706+import System.Time (ClockTime(TOD))+import Data.Time.Clock.POSIX (utcTimeToPOSIXSeconds)+#endif import Hledger.Cli.Options import Hledger.Data@@ -98,8 +102,17 @@ fileModificationTime :: FilePath -> IO ClockTime fileModificationTime f | null f = getClockTime- | otherwise = getModificationTime f `C.catch` \(_::C.IOException) -> getClockTime-+ | otherwise = (do+#if __GLASGOW_HASKELL__ < 706+ clo <- getModificationTime f+#else+ utc <- getModificationTime f+ let nom = utcTimeToPOSIXSeconds utc+ let clo = TOD (read $ show nom) 0 -- XXX+#endif+ return clo+ )+ `C.catch` \(_::C.IOException) -> getClockTime -- | Attempt to open a web browser on the given url, all platforms. openBrowserOn :: String -> IO ExitCode openBrowserOn u = trybrowsers browsers u
Hledger/Cli/Version.hs view
@@ -10,7 +10,6 @@ binaryfilename ) where-import Distribution.PackageDescription.TH (packageVariable, package, pkgName, pkgVersion) import System.Info (os, arch) import Text.Printf @@ -19,12 +18,11 @@ -- package name and version from the cabal file progname, version, prognameandversion :: String-#if HADDOCK-progname = ""-version = ""+progname = "hledger"+#ifdef VERSION+version = VERSION #else-progname = $(packageVariable (pkgName . package))-version = $(packageVariable (pkgVersion . package))+version = "" #endif prognameandversion = progname ++ " " ++ version
hledger.cabal view
@@ -1,5 +1,6 @@ name: hledger-version: 0.18.2+-- also in cpp-options below+version: 0.19 category: Finance synopsis: The main command-line interface for the hledger accounting tool. description:@@ -17,7 +18,7 @@ homepage: http://hledger.org bug-reports: http://code.google.com/p/hledger/issues stability: beta-tested-with: GHC==7.0.4, GHC==7.2.2, GHC==7.4.1+tested-with: GHC==7.0.4, GHC==7.2.2, GHC==7.4.1, GHC==7.6.1 cabal-version: >= 1.8 build-type: Simple -- data-dir: data@@ -40,8 +41,7 @@ Default: True library- -- XXX should set patchlevel here as in Makefile- cpp-options: -DPATCHLEVEL=0+ cpp-options: -DVERSION="0.19" ghc-options: -W -- should be the same as below exposed-modules:@@ -62,14 +62,14 @@ Hledger.Cli.Stats -- should be the same as below build-depends:- hledger-lib == 0.18.2+ hledger-lib == 0.19 ,base >= 4.3 && < 5- ,cabal-file-th+ -- ,cabal-file-th ,containers- ,cmdargs >= 0.9.1 && < 0.10+ ,cmdargs >= 0.10 && < 0.11 ,directory ,filepath- ,haskeline == 0.6.*+ ,haskeline >= 0.6 && <= 0.8 ,HUnit ,mtl ,old-locale@@ -79,7 +79,7 @@ ,regexpr >= 0.5.1 ,safe >= 0.2 ,shakespeare-text == 1.0.*- ,split == 0.1.*+ ,split >= 0.1 && < 0.3 ,text == 0.11.* ,time ,utf8-string >= 0.3.5 && < 0.4@@ -110,21 +110,19 @@ Hledger.Cli.Print Hledger.Cli.Register Hledger.Cli.Stats- -- XXX should set patchlevel here as in Makefile- cpp-options: -DPATCHLEVEL=0+ cpp-options: -DVERSION="0.19" ghc-options: -W if flag(threaded) ghc-options: -threaded -- should be the same as above build-depends:- hledger-lib == 0.18.2+ hledger-lib == 0.19 ,base >= 4.3 && < 5- ,cabal-file-th ,containers- ,cmdargs >= 0.9.1 && < 0.10+ ,cmdargs >= 0.10 && < 0.11 ,directory ,filepath- ,haskeline == 0.6.*+ ,haskeline >= 0.6 && <= 0.8 ,HUnit ,mtl ,old-locale@@ -134,7 +132,7 @@ ,regexpr >= 0.5.1 ,safe >= 0.2 ,shakespeare-text == 1.0.*- ,split == 0.1.*+ ,split >= 0.1 && < 0.3 ,text == 0.11.* ,time ,utf8-string >= 0.3.5 && < 0.4