# optparse-applicative-dex ## Synopsis Extra functions for working with optparse-applicative ## Description optparse-applicative is a fantastic library My usage of it has often used the same features wrapped in a `parseOpts` function along with a version helper. This package abstracts that code into a re-usable library, minimizing pasting between projects. In most CLI projects I almost always want: - A header consisting of the program name and a short description - A helper parser to provide -h, --help - A version helper to respond to a --version option with shorter output than -h, --help - Some additional usage info below the generated switch usage The parseOpts' and parseOptsWithWidth functions in this library take a parser and arguments for header, footer and the app version as generated by cabal and do all these things automatically. A simple example: {- # LANGUAGE OverloadedStrings #-} import Options.Applicative.Dex import Paths_your_app (version) data Options = Options { optA :: String , optB :: Bool } deriving Show parser :: Parser Options parser = Options <$> option str ( short 'a' <> metavar "STR" <> help "The a option, a string" ) <*> switch ( short 'b' <> help "The b option, a switch") main :: IO () main = do opts <- parseOpts' parser "header-info" "footer-info" version print opts ## Getting source Source code is available from codeberg at the [optparse-applicative-dex](https://codeberg.org/dinofp/optparse-applicative-dex) project page. ## Contact Dino Morelli