hledger-1.41: Command-line interface for the hledger accounting system

Safe Haskell | None
Language | Haskell2010

Hledger.Cli.Commands.Add

Description

A history-aware add command to help with data entry. |

Synopsis

- addmode :: Mode RawOpts
- add :: CliOpts -> Journal -> IO ()
- appendToJournalFileOrStdout :: FilePath -> Text -> IO ()
- journalAddTransaction :: Journal -> CliOpts -> Transaction -> IO Journal

# Documentation

addmode :: Mode RawOpts #

add :: CliOpts -> Journal -> IO () #

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.

appendToJournalFileOrStdout :: FilePath -> Text -> IO () #

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.

XXX This writes unix line endings (n), some at least, even if the file uses dos line endings (rn), which could leave mixed line endings in the file. See also writeFileWithBackupIfChanged.

journalAddTransaction :: Journal -> CliOpts -> Transaction -> IO Journal #

Append this transaction to the journal's file and transaction list.