From 9acb57cfc56f895711ad13cdd9c16bb2f6d64814 Mon Sep 17 00:00:00 2001 From: Simon Michael Date: Sat, 17 Jul 2010 15:13:16 +0000 Subject: [PATCH] add: allow blank descriptions --- Hledger/Cli/Commands/Add.hs | 2 +- tests/add-blank-description-fails.test | 5 ----- 2 files changed, 1 insertion(+), 6 deletions(-) delete mode 100644 tests/add-blank-description-fails.test diff --git a/Hledger/Cli/Commands/Add.hs b/Hledger/Cli/Commands/Add.hs index ede911b9b..c4b9a3788 100644 --- a/Hledger/Cli/Commands/Add.hs +++ b/Hledger/Cli/Commands/Add.hs @@ -54,7 +54,7 @@ getTransaction j opts args defaultDate = do (Just $ showDate defaultDate) (Just $ \s -> null s || isRight (parse (smartdate >> many spacenonewline >> eof) "" $ lowercase s)) - description <- askFor "description" Nothing (Just $ not . null) + description <- askFor "description" (Just "") Nothing let historymatches = transactionsSimilarTo j args description bestmatch | null historymatches = Nothing | otherwise = Just $ snd $ head historymatches diff --git a/tests/add-blank-description-fails.test b/tests/add-blank-description-fails.test deleted file mode 100644 index f8c833ae6..000000000 --- a/tests/add-blank-description-fails.test +++ /dev/null @@ -1,5 +0,0 @@ -bin/hledger -f nosuch.journal add -<<< - - ->>>2 /date .*: description: description:/