cli-builder: Simple project template from stack

[ library, mit, tool ] [ Propose Tags ]

Please see

[Skip to Readme]


  • System
    • CLI
      • System.CLI.Builder
        • System.CLI.Builder.Internal
        • System.CLI.Builder.Option
        • System.CLI.Builder.Types


Manual Flags


Use -f <flag> to enable a flag, or -f -<flag> to disable that flag. More info


Maintainer's Corner

Package maintainers

For package maintainers and hackage trustees


Versions [RSS] 0.1.0
Dependencies base (>=4.7 && <5), either, exceptions (>=, optparse-applicative (>=0.12 && <0.14), transformers (>= && <0.6) [details]
License MIT
Copyright 2016 uecmma
Author uecmma
Category Tool
Home page
Bug tracker
Source repo head: git clone git+
Uploaded by mizunashi_mana at 2016-11-09T09:59:53Z
Reverse Dependencies 1 direct, 0 indirect [details]
Downloads 828 total (5 in the last 30 days)
Rating (no votes yet) [estimated by Bayesian average]
Your Rating
  • λ
  • λ
  • λ
Status Docs not available [build log]
All reported builds failed as of 2016-11-17 [all 2 reports]

Readme for cli-builder-0.1.0

[back to package description]

CLI Builder

This packages contains builders to make cli application easily based optparse-applicative.

Getting Started

Here is a simple example:

{-# LANGUAGE RecordWildCards #-}

import System.CLI.Builder

data Options = Options
  { isSampleOption :: Bool
  } deriving (Eq, Show)

optionsParser :: OptionParser Options
optionsParser = Options
  <$> switch (long "sample" <> help "Sample switch")

cliInfo :: CLIInfo
cliInfo = baseCLIInfo "Simple CLI" "Example for simple CLI"

run :: Options -> IO ()
run Options{..} = do
  putStrLn "Sample application"
  putStrLn $ "Is sample: " ++ show isSampleOption

main :: IO ()
main = buildSimpleCLI cliInfo optionsParser run

This action is such as:

$ sampleApp
Sample application
Is sample: False
$ sampleApp --sample
Sample application
Is sample: True
$ sampleApp --help
Simple CLI

Usage: <interactive> [--help]
  Example for simple CLI

Available options:
  --help                   Show this help text
  --sample                 Sample switch

For more examples, see examples.