From c9f1f5c6638a660b1fdca7150e3ad92d5495102c Mon Sep 17 00:00:00 2001 From: Simon Michael Date: Fri, 23 Sep 2011 14:10:27 +0000 Subject: [PATCH] strip the -- when calling addon commands, so their options work (#64) --- hledger/Hledger/Cli/Main.hs | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/hledger/Hledger/Cli/Main.hs b/hledger/Hledger/Cli/Main.hs index 3b5b6a6b4..7f7cd201d 100644 --- a/hledger/Hledger/Cli/Main.hs +++ b/hledger/Hledger/Cli/Main.hs @@ -88,8 +88,8 @@ main = do showModeHelpOr mode f | "help" `in_` (rawopts_ opts) = putStr $ showModeHelp mode | otherwise = f matchedaddon = headDef "" $ filter (cmd `isPrefixOf`) addons - shellcmd = printf "%s-%s %s" progname matchedaddon (unwords' argswithoutcmd) - argswithoutcmd = args1 ++ drop 1 args2 where (args1,args2) = break (== cmd) args + shellcmd = printf "%s-%s %s" progname matchedaddon (unwords' subcmdargs) + subcmdargs = args1 ++ drop 1 args2 where (args1,args2) = break (== cmd) $ filter (/="--") args {- tests: