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
 | 
					        showModeHelpOr mode f | "help" `in_` (rawopts_ opts) = putStr $ showModeHelp mode
 | 
				
			||||||
                              | otherwise = f
 | 
					                              | otherwise = f
 | 
				
			||||||
        matchedaddon = headDef "" $ filter (cmd `isPrefixOf`) addons
 | 
					        matchedaddon = headDef "" $ filter (cmd `isPrefixOf`) addons
 | 
				
			||||||
        shellcmd = printf "%s-%s %s" progname matchedaddon (unwords' argswithoutcmd)
 | 
					        shellcmd = printf "%s-%s %s" progname matchedaddon (unwords' subcmdargs)
 | 
				
			||||||
        argswithoutcmd = args1 ++ drop 1 args2 where (args1,args2) = break (== cmd) args
 | 
					        subcmdargs = args1 ++ drop 1 args2 where (args1,args2) = break (== cmd) $ filter (/="--") args
 | 
				
			||||||
 | 
					
 | 
				
			||||||
{- tests:
 | 
					{- tests:
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
				
			|||||||
		Loading…
	
		Reference in New Issue
	
	Block a user