1
1
mirror of https://github.com/github/semantic.git synced 2024-11-28 01:47:01 +03:00

express choice between either string or filepath options

This commit is contained in:
Ayman Nadeem 2019-10-15 13:27:20 -04:00
parent d7ce6ef1d3
commit be5f00ee50

View File

@ -27,15 +27,15 @@ parseAST = SemanticAST
<$> option auto <$> option auto
( long "format" ( long "format"
<> help "Specify desired output: show, json, sexpression" ) <> help "Specify desired output: show, json, sexpression" )
<*> option auto <*> (Left <$> strOption
( long "sourcefile" ( long "sourcefile"
<> metavar "FILEPATH" <> metavar "FILEPATH"
<> help "Specify filepath containing source code to parse" ) <> help "Specify filepath containing source code to parse" )
<*> option auto <|> Right <$> strOption
( long "sourceString" (long "sourceString"
<> metavar "STRING" <> metavar "STRING"
<> help "Specify source input to parse" <> help "Specify source input to parse"
) ))
main :: IO () main :: IO ()
main = generateAST =<< execParser opts main = generateAST =<< execParser opts