Utilities for top-level modules and ghci. See also Hledger.Read and Hledger.Data.Utils.
- withJournalDo :: [Opt] -> [String] -> String -> ([Opt] -> [String] -> Journal -> IO ()) -> IO ()
- readJournalWithOpts :: [Opt] -> String -> IO Journal
- journalReload :: Journal -> IO (Either String Journal)
- journalReloadIfChanged :: [Opt] -> Journal -> IO (Either String Journal, Bool)
- journalFileIsNewer :: Journal -> IO Bool
- journalFileModificationTime :: Journal -> IO ClockTime
- openBrowserOn :: String -> IO ExitCode
- writeFileWithBackup :: FilePath -> String -> IO ()
- writeFileWithBackupIfChanged :: FilePath -> String -> IO Bool
Parse the user's specified journal file and run a hledger command on it, or throw an error.
Get a journal from the given string and options, or throw an error.
Re-read a journal from its data file, or return an error string.
Re-read a journal from its data file mostly, only if the file has changed since last read (or if there is no file, ie data read from stdin). The provided options are mostly ignored. Return a journal or the error message while reading it, and a flag indicating whether it was re-read or not.
Has the journal's data file changed since last parsed ?
Get the last modified time of the journal's data file (or if there is no file, the current time).
Attempt to open a web browser on the given url, all platforms.
Back up this file with a (incrementing) numbered suffix, then overwrite it with this new text, or give an error.