data Command =
Primer PrimerCommand
data Config select = Config
{ dataFile :: select Last FilePath
}
deriving stock (Generic)
newtype Build f a = Build { fromBuild :: f a }
deriving stock (Show, Eq, Ord, Functor, Traversable, Foldable, Generic)
deriving newtype (Semigroup, Monoid)
deriving anyclass (GSemigroup, GMonoid)
newtype Run f a = Run { fromRun :: a }
deriving stock (Show, Eq, Ord, Functor, Traversable, Foldable)
(<>) = gsappenddefault
mempty = memptydefault
Run . f . fromBuild
infix 1 !<-
Config
{ dataFile = fromMaybe (datadir </> "db.json") . getLast !<- dataFile
}
(,) <$> configOpts <*> mainCommand
Config <$> dataFileOpt
Build . Last <$> optional (strOption
(long "data-file"
<> short 'f'
<> metavar "FILE"
<> help "The datafile to read from, if none is given it will default to DATA_HOME of the XDG Base Directory implementation"))
hsubparser
( command "primer" (info (Primer <$> PrimerOptions.commands) (progDesc "Work with AlBhed Primers")))