detect parse failure where command is somehow empty (wtf?)
This commit is contained in:
parent
90d4ada06e
commit
d5981949e0
1 changed files with 3 additions and 1 deletions
|
@ -124,13 +124,15 @@ runParser' p s paramfile = either failedparse id (parse p "" s)
|
|||
failedparse e = error $
|
||||
(show e) ++
|
||||
"\n<<<\n" ++ s ++ "\n>>>" ++
|
||||
"\nparam file contained: <<<\n" ++ paramfile ++ "\n>>>"
|
||||
"\nparam file contained: >>>\n" ++ paramfile ++ "\n<<<"
|
||||
|
||||
atFile :: FilePath -> String
|
||||
atFile f = '@':f
|
||||
|
||||
runAtFile :: Parser CmdParams -> String -> FilePath -> [String] -> IO (String, Bool)
|
||||
runAtFile p s f extraparams = do
|
||||
when (null $ opts c) $
|
||||
error $ "failed to find any options for " ++ f ++ " in >>>" ++ s ++ "<<<"
|
||||
writeFile f (opts c)
|
||||
out <- getOutput (cmd c) (atFile f:extraparams) (env c)
|
||||
removeFile f
|
||||
|
|
Loading…
Reference in a new issue