never executed always true always false
    1 {-# LANGUAGE FlexibleContexts #-}
    2 {-# LANGUAGE LambdaCase #-}
    3 
    4 {-# OPTIONS_HADDOCK hide #-}
    5 
    6 module Command.RecoveryPhrase
    7     ( Cmd (..)
    8     , mod
    9     , run
   10     ) where
   11 
   12 import Prelude hiding
   13     ( mod )
   14 
   15 import Options.Applicative
   16     ( CommandFields, Mod, command, helper, info, progDesc, subparser )
   17 
   18 import qualified Command.RecoveryPhrase.Generate as Generate
   19 
   20 
   21 newtype Cmd
   22     = Generate Generate.Cmd
   23     deriving (Show)
   24 
   25 mod :: (Cmd -> parent) -> Mod CommandFields parent
   26 mod liftCmd = command "recovery-phrase" $
   27     info (helper <*> fmap liftCmd parser) $ mempty
   28         <> progDesc "About recovery phrases"
   29   where
   30     parser = subparser $ mconcat
   31         [ Generate.mod Generate
   32         ]
   33 
   34 run :: Cmd -> IO ()
   35 run = \case
   36     Generate sub -> Generate.run sub