Commit 239f2dbb authored by Bastian Kauschke's avatar Bastian Kauschke
Browse files

do not allow -i in refine and graph

parent 9666b024
......@@ -116,8 +116,10 @@ subcommand =
)
)
parseConfig :: Parser P.Config
parseConfig = do
data AllowInitialState = AllowInitState | ForbidInitState
parseConfig :: AllowInitialState -> Parser P.Config
parseConfig allowInit = do
functor <- optional
(option
functorReader
......@@ -129,15 +131,16 @@ parseConfig = do
\the input, but can also alternatively be given here."
)
)
initStateName <- optional
(option
str
( long "initial-state"
<> short 'i'
<> metavar "SYMBOL"
<> help "Name of the initial state of the coalgebra."
)
)
initStateName <- case allowInit of
AllowInitState -> optional
(option
str
( long "initial-state"
<> short 'i'
<> metavar "SYMBOL"
<> help "Name of the initial state of the coalgebra."
))
ForbidInitState -> pure Nothing
functorTransforms <- select P.DontApplyTransformations P.ApplyTransformations $ switch
( long "no-functor-transforms"
<> help
......@@ -217,7 +220,7 @@ refineOptions = do
<> help
"Same as --stats, but in json format, suitable for parsing in other programs."
)
refineParseConfig <- parseConfig
refineParseConfig <- parseConfig ForbidInitState
refineEnableOpt <- not <$> switch
( long "disable-optimizations"
<> help "Disable some optimizations. Currently, this is just the \
......@@ -255,7 +258,7 @@ minimizeOptions = do
<> showDefault
)
)
minimizeParseConfig <- parseConfig
minimizeParseConfig <- parseConfig AllowInitState
minimizeStats <- switch
( long "stats"
<> help
......@@ -317,7 +320,7 @@ graphOptions = do
<> showDefault
)
)
graphParseConfig <- parseConfig
graphParseConfig <- parseConfig ForbidInitState
graphDrawPartition <- switch
(long "draw-partition" <> short 'P' <> help
"Calculate partition (see refine) and group nodes accordingly."
......@@ -370,7 +373,7 @@ debugCoalgebraOptions = do
<> showDefault
)
)
debugCoalgebraParseConfig <- parseConfig
debugCoalgebraParseConfig <- parseConfig AllowInitState
pure DebugCoalgebraOptions { .. }
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment