From f6abc0f4858d5e9d0966a3c99a44b8f3ebbae2a5 Mon Sep 17 00:00:00 2001 From: Filip Gralinski Date: Sun, 23 Aug 2015 13:18:51 +0200 Subject: [PATCH] creating a challenge continued, fixed a typo --- geval.cabal | 1 + src/GEval/CreateChallenge.hs | 10 ++++++++++ src/GEval/OptionsParser.hs | 9 +++++---- 3 files changed, 16 insertions(+), 4 deletions(-) create mode 100644 src/GEval/CreateChallenge.hs diff --git a/geval.cabal b/geval.cabal index 072abc9..51e9b37 100644 --- a/geval.cabal +++ b/geval.cabal @@ -16,6 +16,7 @@ cabal-version: >=1.10 library hs-source-dirs: src exposed-modules: GEval.Core + GEval.CreateChallenge , GEval.OptionsParser build-depends: base >= 4.7 && < 5 , cond diff --git a/src/GEval/CreateChallenge.hs b/src/GEval/CreateChallenge.hs new file mode 100644 index 0000000..ebf0010 --- /dev/null +++ b/src/GEval/CreateChallenge.hs @@ -0,0 +1,10 @@ +{-# LANGUAGE QuasiQuotes #-} + +module GEval.CreateChallenge + (createChallenge) + where + +import GEval.Core + +createChallenge :: FilePath -> GEvalSpecification -> IO () +createChallenge expectedDirectory spec = putStrLn "creating challange..." diff --git a/src/GEval/OptionsParser.hs b/src/GEval/OptionsParser.hs index f31ce81..0be5556 100644 --- a/src/GEval/OptionsParser.hs +++ b/src/GEval/OptionsParser.hs @@ -13,6 +13,7 @@ import System.IO import Data.String.Here import GEval.Core +import GEval.CreateChallenge fullOptionsParser = info (helper <*> optionsParser) (fullDesc @@ -108,16 +109,16 @@ runGEval''' False spec = do initChallange :: GEvalSpecification -> IO () initChallange spec = case gesExpectedDirectory spec of Nothing -> showInitInstructions - Just expectedDirectory -> initChallange' expectedDirectory spec - -initChallange' :: FilePath -> GEvalSpecification -> IO () -initChallange' expectedDirectory spec = putStrLn "init running..." + Just expectedDirectory -> createChallenge expectedDirectory spec showInitInstructions = do putStrLn [here| Run: geval --init --expected-directory CHALLANGE to create a directory CHALLANGE representing a Gonito challange. + +You can specify a metric with `--metric METRIC-NAME` option. + (Note that `--out-directory` option is not taken into account with `--init` option.) |] exitFailure