strip the -- when calling addon commands, so their options work (#64)

This commit is contained in:
Simon Michael 2011-09-23 14:10:27 +00:00
parent c274685ce5
commit c9f1f5c663

View File

@ -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: