Verified Commit 3da60b1d authored by Camil Staps's avatar Camil Staps 🚀

Add option documentation to Gast.CommandLine

parent 69d2a5f4
......@@ -73,7 +73,20 @@ where
optionDescription :: Option Options
optionDescription = WithHelp True $ Options
[ Shorthand "-O" "--option" $ Option
[ Shorthand "-O" "--option" $ AddHelpLines
[ "Tests N: the maximum number of tests to run"
, "Fails N: the maximum number of failing test cases to collect"
, "Args N: ???" // TODO
, "RandomSeed N: a custom random seed"
, "Skew N: 0 for symmetric test generation; positive for right-skewn generation; negative for left-skewn generation"
, "MaxDepth N: the maximum tree depth in generated test cases"
, "Output options:"
, "- Quiet: only show the end result"
, "- Concise: show a test counter"
, "- Verbose: show every test case, then hide it again"
, "- Trace: show every test case"
, "- OutputTestEvents: output JSON test events as in Testing.TestEvents"
] $ Option
// When no runs are given yet, this gives global options
(\opt opts -> parseOpt opt >>= \opt -> case opts.test_options.runs of
......@@ -81,7 +94,7 @@ where
rs -> let r = last rs in
Ok {opts & test_options.runs=init rs ++ [{r & options=r.options ++ [printToString opt]}]})
"Add OPT to the options of the previously added test"
"Add OPT to the options of the previously added test, where OPT is one of:"
, Shorthand "-r" "--run" $ Option
// Remove tests previously added with the same name, to make it possible to add --run after --run-all
......@@ -89,7 +102,7 @@ where
(Ok {opts & test_options.runs=[r` \\ r` <- opts.test_options.runs | r` <> r]++ [{name=r, options=[]}]})
(Error ["No test with the name '" +++ r +++ "' is known."]))
"Run test NAME"
"Run test NAME (see --list for a list of names)"
, Shorthand "-R" "--run-all" $ Flag
// Only add those tests which do not exist yet in the runs list
Markdown is supported
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