Skip to content
Snippets Groups Projects
Commit a5c32cfa authored by Alice Brenon's avatar Alice Brenon
Browse files

Expose the xmlOutput parser separately

parent 9802e63c
Branches output-options
No related tags found
No related merge requests found
......@@ -5,7 +5,8 @@ module GEODE.Options
, Output(..)
, input
, ioConfig
, output ) where
, output
, xmlOutput ) where
import Control.Applicative ((<|>))
import Data.List.NonEmpty (NonEmpty(..))
......@@ -21,24 +22,28 @@ input stdinSemantics =
argument
(File <$> str)
( value StdIn
<> metavar "INPUT_FILE"
<> help (printf "path of the file to process (%s)" stdinSemantics) )
<> metavar "INPUT_FILE"
<> help (printf "path of the file to process (%s)" stdinSemantics) )
data Output = Metadata | TextRoot FilePath | XMLRoot FilePath
xmlOutput :: Parser FilePath
xmlOutput =
strOption
( long "xml-root" <> metavar "DIRECTORY" <> short 'x'
<> help "Root path where to output XML files" )
output :: Parser Output
output =
flag' Metadata ( long "metadata"
<> short 'm'
<> help "Print metadata for splitted files on stdout" )
<> short 'm'
<> help "Print metadata for splitted files on stdout" )
<|> (TextRoot <$> strOption
( long "text-root"
<> short 't'
<> help "Root path where to output text files" ))
<|> (XMLRoot <$> strOption
( long "xml-root"
<> short 'x'
<> help "Root path where to output XML files" ))
<> metavar "DIRECTORY"
<> short 't'
<> help "Root path where to output text files" ))
<|> (XMLRoot <$> xmlOutput)
data IOConfig = IOConfig
{ from :: Input
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment