Created
August 14, 2019 12:06
-
-
Save tnull/7b5bb77594d5d363e3f559fd14302f8b to your computer and use it in GitHub Desktop.
Optparse
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import qualified Options.Applicative as OA | |
data AppArgs = | |
AppArgs | |
{ inFilePath :: !String | |
, outFilePath :: !String | |
, sampleFilter :: !Int | |
} | |
deriving (Show) | |
main :: IO () | |
main = OA.execParser opts >>= runWithOptions | |
where | |
parser = | |
AppArgs <$> OA.argument OA.str (OA.metavar "inCSV") <*> | |
OA.argument OA.str (OA.metavar "outCSV") <*> | |
OA.option OA.auto (OA.metavar "sample_filter" <> OA.value 0) | |
opts = OA.info parser mempty |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment