1
1
mirror of https://github.com/github/semantic.git synced 2024-12-26 08:25:19 +03:00

🔥 the ParseArguments' wrappers.

This commit is contained in:
Rob Rix 2017-06-16 12:09:22 -04:00
parent 7c5ba48e2f
commit 8941b23246
2 changed files with 2 additions and 9 deletions

View File

@ -30,13 +30,6 @@ data ParseArguments where
deriving instance Show ParseArguments
type ParseArguments' = ParseMode -> ParseArguments
sExpressionParseTree :: ParseArguments'
sExpressionParseTree = ParseArguments SExpressionTermRenderer
jsonParseTree :: ParseArguments'
jsonParseTree = ParseArguments JSONTermRenderer
data ProgramMode = Parse ParseArguments | Diff DiffArguments
deriving Show

View File

@ -73,8 +73,8 @@ arguments = info (version <*> helper <*> argumentsParser) description
parseCommand = command "parse" (info parseArgumentsParser (progDesc "Print parse trees for path(s)"))
parseArgumentsParser = Parse
<$> ( ( flag sExpressionParseTree sExpressionParseTree (long "sexpression" <> help "Output s-expression parse trees (default)")
<|> flag' jsonParseTree (long "json" <> help "Output JSON parse trees") )
<$> ( ( flag (ParseArguments SExpressionTermRenderer) (ParseArguments SExpressionTermRenderer) (long "sexpression" <> help "Output s-expression parse trees (default)")
<|> flag' (ParseArguments JSONTermRenderer) (long "json" <> help "Output JSON parse trees") )
<*> ( ParsePaths
<$> some (argument filePathReader (metavar "FILES..."))
<|> pure ParseStdin ))