Merge branch 'handle-version-option' into 'master'
Added version flag handling, added changelog Closes #7 See merge request filipg/geval!1
This commit is contained in:
commit
e0e06196f0
3
CHANGELOG.md
Normal file
3
CHANGELOG.md
Normal file
@ -0,0 +1,3 @@
|
|||||||
|
## 1.0.0.1
|
||||||
|
|
||||||
|
* Added `--version`, `-v` options handling
|
@ -1,5 +1,5 @@
|
|||||||
name: geval
|
name: geval
|
||||||
version: 1.0.0.0
|
version: 1.0.0.1
|
||||||
synopsis: Machine learning evaluation tools
|
synopsis: Machine learning evaluation tools
|
||||||
description: Please see README.md
|
description: Please see README.md
|
||||||
homepage: http://github.com/name/project
|
homepage: http://github.com/name/project
|
||||||
@ -29,6 +29,7 @@ library
|
|||||||
, GEval.BIO
|
, GEval.BIO
|
||||||
, Data.Conduit.AutoDecompress
|
, Data.Conduit.AutoDecompress
|
||||||
, Data.Conduit.SmartSource
|
, Data.Conduit.SmartSource
|
||||||
|
, Paths_geval
|
||||||
build-depends: base >= 4.7 && < 5
|
build-depends: base >= 4.7 && < 5
|
||||||
, cond
|
, cond
|
||||||
, conduit >= 1.3.0
|
, conduit >= 1.3.0
|
||||||
|
@ -203,7 +203,7 @@ getExpectedDirectory :: GEvalSpecification -> FilePath
|
|||||||
getExpectedDirectory spec = fromMaybe outDirectory $ gesExpectedDirectory spec
|
getExpectedDirectory spec = fromMaybe outDirectory $ gesExpectedDirectory spec
|
||||||
where outDirectory = gesOutDirectory spec
|
where outDirectory = gesOutDirectory spec
|
||||||
|
|
||||||
data GEvalSpecialCommand = Init | LineByLine | Diff FilePath
|
data GEvalSpecialCommand = Init | LineByLine | Diff FilePath | PrintVersion
|
||||||
|
|
||||||
data ResultOrdering = KeepTheOriginalOrder | FirstTheWorst | FirstTheBest
|
data ResultOrdering = KeepTheOriginalOrder | FirstTheWorst | FirstTheBest
|
||||||
|
|
||||||
|
@ -6,6 +6,9 @@ module GEval.OptionsParser
|
|||||||
runGEvalGetOptions,
|
runGEvalGetOptions,
|
||||||
getOptions) where
|
getOptions) where
|
||||||
|
|
||||||
|
import Paths_geval (version)
|
||||||
|
import Data.Version (showVersion)
|
||||||
|
|
||||||
import Options.Applicative
|
import Options.Applicative
|
||||||
import qualified System.Directory as D
|
import qualified System.Directory as D
|
||||||
import System.FilePath
|
import System.FilePath
|
||||||
@ -31,6 +34,11 @@ optionsParser = GEvalOptions
|
|||||||
( long "init"
|
( long "init"
|
||||||
<> help "Init a sample Gonito challenge rather than run an evaluation" ))
|
<> help "Init a sample Gonito challenge rather than run an evaluation" ))
|
||||||
<|>
|
<|>
|
||||||
|
(flag' PrintVersion
|
||||||
|
( long "version"
|
||||||
|
<> short 'v'
|
||||||
|
<> help "Print GEval version" ))
|
||||||
|
<|>
|
||||||
(flag' LineByLine
|
(flag' LineByLine
|
||||||
( long "line-by-line"
|
( long "line-by-line"
|
||||||
<> short 'l'
|
<> short 'l'
|
||||||
@ -178,6 +186,9 @@ runGEval''' Nothing _ spec = do
|
|||||||
runGEval''' (Just Init) _ spec = do
|
runGEval''' (Just Init) _ spec = do
|
||||||
initChallenge spec
|
initChallenge spec
|
||||||
return Nothing
|
return Nothing
|
||||||
|
runGEval''' (Just PrintVersion) _ _ = do
|
||||||
|
putStrLn ("geval " ++ showVersion version)
|
||||||
|
return Nothing
|
||||||
runGEval''' (Just LineByLine) ordering spec = do
|
runGEval''' (Just LineByLine) ordering spec = do
|
||||||
runLineByLine ordering spec
|
runLineByLine ordering spec
|
||||||
return Nothing
|
return Nothing
|
||||||
|
Loading…
Reference in New Issue
Block a user