Safe Haskell | None |
---|
A history-aware add command to help with data entry. |
- addmode :: Mode RawOpts
- data EntryState = EntryState {
- esOpts :: CliOpts
- esArgs :: [String]
- esToday :: Day
- esDefDate :: Day
- esJournal :: Journal
- esSimilarTransaction :: Maybe Transaction
- esPostings :: [Posting]
- defEntryState :: EntryState
- data RestartTransactionException = RestartTransactionException
- add :: CliOpts -> Journal -> IO ()
- showHelp :: IO ()
- getAndAddTransactions :: EntryState -> IO ()
- confirmedTransactionWizard :: EntryState -> Wizard Haskeline Transaction
- transactionWizard :: EntryState -> Wizard Haskeline Transaction
- similarTransaction :: EntryState -> String -> Maybe Transaction
- dateAndCodeWizard :: EntryState -> Wizard Haskeline (Day, [Char])
- descriptionAndCommentWizard :: EntryState -> Wizard Haskeline (String, String)
- postingsWizard :: EntryState -> Wizard Haskeline [Posting]
- postingWizard :: EntryState -> Wizard Haskeline (Maybe Posting)
- postingsBalanced :: [Posting] -> Bool
- accountWizard :: EntryState -> Wizard Haskeline [Char]
- amountAndCommentWizard :: EntryState -> Wizard Haskeline (Amount, [Char])
- maybeExit :: Wizard Haskeline [Char] -> Wizard Haskeline [Char]
- maybeRestartTransaction :: Wizard Haskeline [Char] -> Wizard Haskeline [Char]
- dateCompleter :: String -> CompletionFunc IO
- descriptionCompleter :: Journal -> String -> CompletionFunc IO
- accountCompleter :: Journal -> String -> CompletionFunc IO
- amountCompleter :: String -> CompletionFunc IO
- completer :: [String] -> String -> CompletionFunc IO
- defaultTo' :: b -> Wizard Haskeline b -> Wizard Haskeline b
- withCompletion :: :<: WithSettings b => CompletionFunc IO -> Wizard b a -> Wizard b a
- green :: [Char] -> [Char]
- showDefault :: [Char] -> [Char]
- journalAddTransaction :: Journal -> CliOpts -> Transaction -> IO Journal
- appendToJournalFileOrStdout :: FilePath -> String -> IO ()
- ensureOneNewlineTerminated :: String -> String
- registerFromString :: String -> IO String
- capitalize :: String -> String
- transactionsSimilarTo :: Journal -> Query -> String -> [(Double, Transaction)]
- compareDescriptions :: [Char] -> [Char] -> Double
- compareStrings :: String -> String -> Double
- wordLetterPairs :: String -> [[Char]]
- letterPairs :: [t] -> [[t]]
Documentation
data EntryState Source
State used while entering transactions.
EntryState | |
|
add :: CliOpts -> Journal -> IO ()Source
Read multiple transactions from the console, prompting for each field, and append them to the journal file. If the journal came from stdin, this command has no effect.
getAndAddTransactions :: EntryState -> IO ()Source
Loop reading transactions from the console, prompting, validating and appending each one to the journal file, until end of input or ctrl-c (then raise an EOF exception). If provided, command-line arguments are used as defaults; otherwise defaults come from the most similar recent transaction in the journal.
dateAndCodeWizard :: EntryState -> Wizard Haskeline (Day, [Char])Source
postingsBalanced :: [Posting] -> BoolSource
accountWizard :: EntryState -> Wizard Haskeline [Char]Source
amountAndCommentWizard :: EntryState -> Wizard Haskeline (Amount, [Char])Source
accountCompleter :: Journal -> String -> CompletionFunc IOSource
completer :: [String] -> String -> CompletionFunc IOSource
Generate a haskeline completion function from the given completions and default, that case insensitively completes with prefix matches, or infix matches above a minimum length, or completes the null string with the default.
withCompletion :: :<: WithSettings b => CompletionFunc IO -> Wizard b a -> Wizard b aSource
showDefault :: [Char] -> [Char]Source
journalAddTransaction :: Journal -> CliOpts -> Transaction -> IO JournalSource
Append this transaction to the journal's file and transaction list.
appendToJournalFileOrStdout :: FilePath -> String -> IO ()Source
Append a string, typically one or more transactions, to a journal file, or if the file is -, dump it to stdout. Tries to avoid excess whitespace.
ensureOneNewlineTerminated :: String -> StringSource
Replace a string's 0 or more terminating newlines with exactly one.
registerFromString :: String -> IO StringSource
Convert a string of journal data into a register report.
capitalize :: String -> StringSource
transactionsSimilarTo :: Journal -> Query -> String -> [(Double, Transaction)]Source
compareDescriptions :: [Char] -> [Char] -> DoubleSource
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.
wordLetterPairs :: String -> [[Char]]Source
letterPairs :: [t] -> [[t]]Source