From b141864b773e2237951c84188b51e0c923adcb39 Mon Sep 17 00:00:00 2001 From: Rob Rix Date: Mon, 14 May 2018 10:13:06 -0400 Subject: [PATCH] Revert "Extract symbolFieldsReader to the top level." This reverts commit b46332df2d2bca571fb83fa0bcaf2567956d8b2b. --- src/Semantic/CLI.hs | 24 +++++++++++------------- 1 file changed, 11 insertions(+), 13 deletions(-) diff --git a/src/Semantic/CLI.hs b/src/Semantic/CLI.hs index 063caa1b8..c062104af 100644 --- a/src/Semantic/CLI.hs +++ b/src/Semantic/CLI.hs @@ -120,16 +120,14 @@ arguments = info (version <*> helper <*> ((,) <$> optionsParser <*> argumentsPar options options fields = option (optionsReader options) (fields <> showDefaultWith (findOption options) <> metavar (intercalate "|" (fmap fst options))) findOption options value = maybe "" fst (find ((== value) . snd) options) - --- Example: semantic parse --symbols --fields=symbol,path,language,kind,line,span -symbolFieldsReader :: ReadM SymbolFields -symbolFieldsReader = eitherReader parseSymbolFields - where parseSymbolFields arg = let fields = splitWhen (== ',') arg in - Right SymbolFields - { symbolFieldsName = "symbol" `elem` fields - , symbolFieldsPath = "path" `elem` fields - , symbolFieldsLang = "language" `elem` fields - , symbolFieldsKind = "kind" `elem` fields - , symbolFieldsLine = "line" `elem` fields - , symbolFieldsSpan = "span" `elem` fields - } + -- Example: semantic parse --symbols --fields=symbol,path,language,kind,line,span + symbolFieldsReader = eitherReader parseSymbolFields + parseSymbolFields arg = let fields = splitWhen (== ',') arg in + Right SymbolFields + { symbolFieldsName = "symbol" `elem` fields + , symbolFieldsPath = "path" `elem` fields + , symbolFieldsLang = "language" `elem` fields + , symbolFieldsKind = "kind" `elem` fields + , symbolFieldsLine = "line" `elem` fields + , symbolFieldsSpan = "span" `elem` fields + }