From 49e66477fb6f4ca2aed44340a8a1a74413074365 Mon Sep 17 00:00:00 2001 From: Simon Michael Date: Sun, 24 May 2009 05:13:36 +0000 Subject: [PATCH] add: command-line args form description of first transaction only --- Commands/Add.hs | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/Commands/Add.hs b/Commands/Add.hs index 844d48d31..2bcb187fa 100644 --- a/Commands/Add.hs +++ b/Commands/Add.hs @@ -33,14 +33,15 @@ add opts args l -- | Read a number of ledger transactions from the command line, -- prompting, validating, displaying and appending them to the ledger --- file, until end of input. +-- file, until end of input. Any command-line arguments are used as the +-- first transaction's description. getAndAddTransactions :: Ledger -> [String] -> IO [LedgerTransaction] getAndAddTransactions l args = do -- for now, thread the eoi flag throughout rather than muck about with monads (t, eoi) <- getTransaction l args l <- if isJust t then addTransaction l (fromJust t) else return l if eoi then return $ maybe [] (:[]) t - else liftM (fromJust t:) (getAndAddTransactions l args) + else liftM (fromJust t:) (getAndAddTransactions l []) -- | Get a transaction from the command line, if possible, and a flag -- indicating end of input.