diff --git a/src/Data/Language.hs b/src/Data/Language.hs index b1cda7da7..a19a8b52d 100644 --- a/src/Data/Language.hs +++ b/src/Data/Language.hs @@ -143,14 +143,16 @@ textToLanguage = \case _ -> Unknown -newtype PerLanguageModes = PerLanguageModes - { pythonMode :: LanguageMode +data PerLanguageModes = PerLanguageModes + { javaMode :: LanguageMode + , pythonMode :: LanguageMode } deriving (Eq, Ord, Show) defaultLanguageModes :: PerLanguageModes defaultLanguageModes = PerLanguageModes - { pythonMode = ALaCarte + { javaMode = ALaCarte + , pythonMode = ALaCarte } data LanguageMode @@ -160,5 +162,6 @@ data LanguageMode modeForLanguage :: PerLanguageModes -> Language -> LanguageMode modeForLanguage modes = \case + Java -> javaMode modes Python -> pythonMode modes _ -> ALaCarte diff --git a/src/Semantic/CLI.hs b/src/Semantic/CLI.hs index d2c7bda2e..39182acfa 100644 --- a/src/Semantic/CLI.hs +++ b/src/Semantic/CLI.hs @@ -103,7 +103,12 @@ parseCommand = command "parse" (info parseArgumentsParser (progDesc "Generate pa where parseArgumentsParser = do languageModes <- Language.PerLanguageModes - <$> option auto ( long "python-mode" + <$> option auto ( long "java-mode" + <> help "The AST representation to use for Java sources" + <> metavar "ALaCarte|Precise" + <> value Language.ALaCarte + <> showDefault) + <*> option auto ( long "python-mode" <> help "The AST representation to use for Python sources" <> metavar "ALaCarte|Precise" <> value Language.ALaCarte