module CommandLineOptions ( Sample(..) , getOptions ) where import Options.Applicative data Sample = Sample { hello :: String , quiet :: Bool } getOptions :: IO Sample getOptions = execParser $ info (helper <*> sample) ( fullDesc <> progDesc "Print a greeting for TARGET" <> header "hello - a test for optparse-applicative" ) sample :: Parser Sample sample = Sample <$> strOption ( long "name" <> metavar "TARGET" <> help "Target for the greeting" ) <*> switch ( long "quiet" <> help "Whether to be quiet" )