module Compare.Options
( CompareArguments (..)
, Compare
, compareArguments
) where
import Control.Monad.Logger
import Control.Monad.Trans.Reader
import Options.Applicative
data CompareArguments = CompareArguments
{ argsNormalize :: Bool
, argsBipartitions :: Bool
, argsNewickIqTree :: Bool
, argsInFiles :: [FilePath] }
type Compare = LoggingT (ReaderT CompareArguments IO)
compareArguments :: Parser CompareArguments
compareArguments = CompareArguments <$>
normalize
<*> bipartitions
<*> newickIqTree
<*> some file
normalize :: Parser Bool
normalize = switch $
long "normalize"
<> short 'n'
<> help "Normalize trees before comparison"
bipartitions :: Parser Bool
bipartitions = switch $
long "bipartitions"
<> short 'b'
<> help "Print common and missing bipartitions"
file :: Parser FilePath
file = strArgument $
metavar "NAME"
<> help "Tree file"
newickIqTree :: Parser Bool
newickIqTree = switch $
long "newick-iqtree"
<> short 'i'
<> help "Use IQ-TREE Newick format (internal node labels are branch support values)"