mirror of
https://github.com/simonmichael/hledger.git
synced 2024-12-29 05:11:33 +03:00
strip the -- when calling addon commands, so their options work (#64)
This commit is contained in:
parent
c274685ce5
commit
c9f1f5c663
@ -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:
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user