1
1
mirror of https://github.com/github/semantic.git synced 2024-12-01 09:15:01 +03:00

🔥 redundant parens.

This commit is contained in:
Rob Rix 2018-07-30 15:13:39 -04:00
parent 629cd2748d
commit b76f950b06

View File

@ -100,8 +100,8 @@ arguments = info (version <*> helper <*> ((,) <$> optionsParser <*> argumentsPar
excludeDirsOption = many (strOption (long "exclude-dir" <> help "Exclude a directory (e.g. vendor)" <> metavar "DIR"))
filePathReader = eitherReader parseFilePath
parseFilePath arg = case splitWhen (== ':') arg of
[a, b] | (Just lang) <- readMaybe b >>= ensureLanguage -> Right (File a lang)
| (Just lang) <- readMaybe a >>= ensureLanguage -> Right (File b lang)
[a, b] | Just lang <- readMaybe b >>= ensureLanguage -> Right (File a lang)
| Just lang <- readMaybe a >>= ensureLanguage -> Right (File b lang)
[path] -> maybe (Left $ "Cannot identify language for path: " <> path) (Right . File path) (ensureLanguage (languageForFilePath path))
args -> Left ("cannot parse `" <> join args <> "`\nexpecting FILE:LANGUAGE or just FILE")