Commit e892cdfa authored by Iustin Pop's avatar Iustin Pop
Browse files

Simplify htools.hs personality selection

No need to do a boolean-based lookup, we can use the regular
association list lookup.
Signed-off-by: default avatarIustin Pop <>
Reviewed-by: default avatarMichele Tartara <>
parent 559c4a98
......@@ -51,8 +51,7 @@ main = do
binary <- catchJust (guard . isDoesNotExistError)
(getEnv "HTOOLS") (const getProgName)
let name = map toLower binary
boolnames = map (\(x, y) -> (x == name, Just y)) personalities
case select Nothing boolnames of
case name `lookup` personalities of
Nothing -> usage name
Just (fn, options, arguments, _) -> do
cmd_args <- getArgs
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment