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: