mirror of
https://github.com/github/semantic.git
synced 2024-12-28 09:21:35 +03:00
🔥 the ParseArguments' wrappers.
This commit is contained in:
parent
7c5ba48e2f
commit
8941b23246
@ -30,13 +30,6 @@ data ParseArguments where
|
|||||||
|
|
||||||
deriving instance Show ParseArguments
|
deriving instance Show ParseArguments
|
||||||
|
|
||||||
type ParseArguments' = ParseMode -> ParseArguments
|
|
||||||
|
|
||||||
sExpressionParseTree :: ParseArguments'
|
|
||||||
sExpressionParseTree = ParseArguments SExpressionTermRenderer
|
|
||||||
|
|
||||||
jsonParseTree :: ParseArguments'
|
|
||||||
jsonParseTree = ParseArguments JSONTermRenderer
|
|
||||||
|
|
||||||
data ProgramMode = Parse ParseArguments | Diff DiffArguments
|
data ProgramMode = Parse ParseArguments | Diff DiffArguments
|
||||||
deriving Show
|
deriving Show
|
||||||
|
@ -73,8 +73,8 @@ arguments = info (version <*> helper <*> argumentsParser) description
|
|||||||
|
|
||||||
parseCommand = command "parse" (info parseArgumentsParser (progDesc "Print parse trees for path(s)"))
|
parseCommand = command "parse" (info parseArgumentsParser (progDesc "Print parse trees for path(s)"))
|
||||||
parseArgumentsParser = Parse
|
parseArgumentsParser = Parse
|
||||||
<$> ( ( flag sExpressionParseTree sExpressionParseTree (long "sexpression" <> help "Output s-expression parse trees (default)")
|
<$> ( ( flag (ParseArguments SExpressionTermRenderer) (ParseArguments SExpressionTermRenderer) (long "sexpression" <> help "Output s-expression parse trees (default)")
|
||||||
<|> flag' jsonParseTree (long "json" <> help "Output JSON parse trees") )
|
<|> flag' (ParseArguments JSONTermRenderer) (long "json" <> help "Output JSON parse trees") )
|
||||||
<*> ( ParsePaths
|
<*> ( ParsePaths
|
||||||
<$> some (argument filePathReader (metavar "FILES..."))
|
<$> some (argument filePathReader (metavar "FILES..."))
|
||||||
<|> pure ParseStdin ))
|
<|> pure ParseStdin ))
|
||||||
|
Loading…
Reference in New Issue
Block a user