A history-aware add command to help with data entry.
- add :: [Opt] -> [String] -> Journal -> IO ()
- getAndAddTransactions :: Journal -> [Opt] -> [String] -> Day -> InputT IO ()
- getTransaction :: Journal -> [Opt] -> [String] -> Day -> InputT IO (Transaction, Day)
- getPostings :: JournalContext -> (AccountName -> Bool) -> Maybe [Posting] -> [Posting] -> InputT IO [Posting]
- askFor :: String -> Maybe String -> Maybe (String -> Bool) -> InputT IO String
- journalAddTransaction :: Journal -> [Opt] -> Transaction -> IO Journal
- appendToJournalFile :: FilePath -> String -> IO ()
- registerFromString :: String -> IO String
- compareStrings :: String -> String -> Double
- compareDescriptions :: [Char] -> [Char] -> Double
- transactionsSimilarTo :: Journal -> [String] -> String -> [(Double, Transaction)]
- runInteraction :: Journal -> InputT IO a -> IO a
- type CompletionCache = [AccountName]
- completionCache :: Journal -> CompletionCache
- accountCompletion :: CompletionCache -> CompletionFunc IO
Documentation
add :: [Opt] -> [String] -> Journal -> IO ()Source
Read transactions from the terminal, prompting for each field, and append them to the journal file. If the journal came from stdin, this command has no effect.
getAndAddTransactions :: Journal -> [Opt] -> [String] -> Day -> InputT IO ()Source
Read a number of transactions from the command line, prompting, validating, displaying and appending them to the journal file, until end of input (then raise an EOF exception). Any command-line arguments are used as the first transaction's description.
getTransaction :: Journal -> [Opt] -> [String] -> Day -> InputT IO (Transaction, Day)Source
Read a transaction from the command line, with history-aware prompting.
getPostings :: JournalContext -> (AccountName -> Bool) -> Maybe [Posting] -> [Posting] -> InputT IO [Posting]Source
Read postings from the command line until . is entered, using any provided historical postings and the journal context to guess defaults.
askFor :: String -> Maybe String -> Maybe (String -> Bool) -> InputT IO StringSource
Prompt for and read a string value, optionally with a default value and a validator. A validator causes the prompt to repeat until the input is valid. May also raise an EOF exception if control-d is pressed.
journalAddTransaction :: Journal -> [Opt] -> Transaction -> IO JournalSource
Append this transaction to the journal's file, and to the journal's transaction list.
appendToJournalFile :: FilePath -> String -> IO ()Source
Append data to a journal file; or if the file is -, dump it to stdout.
registerFromString :: String -> IO StringSource
Convert a string of journal data into a register report.
compareStrings :: String -> String -> DoubleSource
Return a similarity measure, from 0 to 1, for two strings. This is Simon White's letter pairs algorithm from http:www.catalysoft.comarticlesStrikeAMatch.html with a modification for short strings.
compareDescriptions :: [Char] -> [Char] -> DoubleSource
transactionsSimilarTo :: Journal -> [String] -> String -> [(Double, Transaction)]Source
type CompletionCache = [AccountName]Source