module Connect.Options
( ConnectArguments (..)
, Connect
, connectArguments
) where
import Control.Monad.Logger
import Control.Monad.Trans.Reader
import Options.Applicative
data ConnectArguments = ConnectArguments
{ newickIqTreeFlag :: Bool
, constraints :: Maybe FilePath
, inFileA :: FilePath
, inFileB :: FilePath }
type Connect = LoggingT (ReaderT ConnectArguments IO)
connectArguments :: Parser ConnectArguments
connectArguments = ConnectArguments
<$> newickIqTree
<*> constraintsFile
<*> fileA
<*> fileB
newickIqTree :: Parser Bool
newickIqTree = switch $
long "newick-iqtree"
<> short 'i'
<> help "Use IQ-TREE Newick format (internal node labels are branch support values)"
constraintsFile :: Parser (Maybe FilePath)
constraintsFile = optional $ strOption $
metavar "CONSTRAINTS"
<> short 'c'
<> long "contraints"
<> help "File containing one or more Newick trees to be used as constraints"
fileA :: Parser FilePath
fileA = strArgument $
metavar "TREE-FILE-A"
<> help "File containing the first Newick tree"
fileB :: Parser FilePath
fileB = strArgument $
metavar "TREE-FILE-B"
<> help "File containing the second Newick tree"