mirror of
https://github.com/github/semantic.git
synced 2024-12-27 17:05:33 +03:00
Revert "Extract symbolFieldsReader to the top level."
This reverts commit b46332df2d2bca571fb83fa0bcaf2567956d8b2b.
This commit is contained in:
parent
a36c7dc7da
commit
b141864b77
@ -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)))
|
options options fields = option (optionsReader options) (fields <> showDefaultWith (findOption options) <> metavar (intercalate "|" (fmap fst options)))
|
||||||
findOption options value = maybe "" fst (find ((== value) . snd) options)
|
findOption options value = maybe "" fst (find ((== value) . snd) options)
|
||||||
|
|
||||||
|
-- Example: semantic parse --symbols --fields=symbol,path,language,kind,line,span
|
||||||
-- Example: semantic parse --symbols --fields=symbol,path,language,kind,line,span
|
symbolFieldsReader = eitherReader parseSymbolFields
|
||||||
symbolFieldsReader :: ReadM SymbolFields
|
parseSymbolFields arg = let fields = splitWhen (== ',') arg in
|
||||||
symbolFieldsReader = eitherReader parseSymbolFields
|
Right SymbolFields
|
||||||
where parseSymbolFields arg = let fields = splitWhen (== ',') arg in
|
{ symbolFieldsName = "symbol" `elem` fields
|
||||||
Right SymbolFields
|
, symbolFieldsPath = "path" `elem` fields
|
||||||
{ symbolFieldsName = "symbol" `elem` fields
|
, symbolFieldsLang = "language" `elem` fields
|
||||||
, symbolFieldsPath = "path" `elem` fields
|
, symbolFieldsKind = "kind" `elem` fields
|
||||||
, symbolFieldsLang = "language" `elem` fields
|
, symbolFieldsLine = "line" `elem` fields
|
||||||
, symbolFieldsKind = "kind" `elem` fields
|
, symbolFieldsSpan = "span" `elem` fields
|
||||||
, symbolFieldsLine = "line" `elem` fields
|
}
|
||||||
, symbolFieldsSpan = "span" `elem` fields
|
|
||||||
}
|
|
||||||
|
Loading…
Reference in New Issue
Block a user