1
1
mirror of https://github.com/anoma/juvix.git synced 2024-12-15 01:52:11 +03:00
juvix/app/Commands/Dev/Termination/CallGraph/Options.hs
2022-12-20 13:05:40 +01:00

27 lines
681 B
Haskell

module Commands.Dev.Termination.CallGraph.Options where
import CommonOptions
import Data.Text qualified as Text
data CallGraphOptions = CallGraphOptions
{ _graphFunctionNameFilter :: Maybe (NonEmpty Text),
_graphInputFile :: AppPath File
}
deriving stock (Data)
makeLenses ''CallGraphOptions
parseCallGraph :: Parser CallGraphOptions
parseCallGraph = do
_graphFunctionNameFilter <-
fmap msum . optional $
nonEmpty . Text.words
<$> option
str
( long "function"
<> short 'f'
<> help "Only shows the specified function"
)
_graphInputFile <- parseInputJuvixFile
pure CallGraphOptions {..}