This commit is contained in:
Joey Hess 2012-01-10 15:36:54 -04:00
parent 16e7178f20
commit abdacf58ed
8 changed files with 26 additions and 41 deletions

View file

@ -47,7 +47,7 @@ dispatch args cmds commonoptions header getgitrepo = do
- the Command being run, and the remaining parameters for the command. -}
parseCmd :: Params -> [Command] -> [Option] -> String -> (Flags, Command, Params)
parseCmd argv cmds commonoptions header
| name == Nothing = err "missing command"
| isNothing name = err "missing command"
| null matches = err $ "unknown command " ++ fromJust name
| otherwise = check $ getOpt Permute (commonoptions ++ cmdoptions cmd) args
where