From d164e16dc55ab349abd01dc39ab03deeeba443ab Mon Sep 17 00:00:00 2001 From: Rob Rix Date: Mon, 30 Jul 2018 16:29:14 -0400 Subject: [PATCH] Extract tsParseCommand to the top level. --- src/Semantic/CLI.hs | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/src/Semantic/CLI.hs b/src/Semantic/CLI.hs index b4a477025..225cfa5d3 100644 --- a/src/Semantic/CLI.hs +++ b/src/Semantic/CLI.hs @@ -77,7 +77,9 @@ arguments = info (version <*> helper <*> ((,) <$> optionsParser <*> argumentsPar -- Example: semantic parse --symbols --fields=symbol,path,language,kind,line,span symbolFieldsReader = eitherReader (Right . parseSymbolFields) - tsParseCommand = command "ts-parse" (info tsParseArgumentsParser (progDesc "Print specialized tree-sitter ASTs for path(s)")) +tsParseCommand :: Mod CommandFields (Task.TaskEff Builder) +tsParseCommand = command "ts-parse" (info tsParseArgumentsParser (progDesc "Print specialized tree-sitter ASTs for path(s)")) + where tsParseArgumentsParser = do format <- flag AST.SExpression AST.SExpression (long "sexpression" <> help "Output s-expression ASTs (default)") <|> flag' AST.JSON (long "json" <> help "Output JSON ASTs")