would like to react to --version before --help, cmdargs does it first though

This commit is contained in:
Simon Michael 2011-08-20 19:18:10 +00:00
parent 870c687f31
commit b39c0f8819

View File

@ -82,8 +82,8 @@ main = do
| cmd `isPrefixOf` "binaryfilename" = showModeHelpOr binaryfilenamemode $ putStrLn $ binaryfilename progname
| otherwise = showModeHelpOr mainmode $ optserror $ "command "++cmd++" is not recognized"
showModeHelpOr mode f = do
when ("help" `in_` (rawopts_ opts)) $ printModeHelpAndExit mode
when ("version" `in_` (rawopts_ opts)) $ printVersionAndExit
when ("help" `in_` (rawopts_ opts)) $ printModeHelpAndExit mode
f
{- tests: