packages feed

options-0.1: options.cabal

name: options
version: 0.1
license: MIT
license-file: license.txt
author: John Millikin <jmillikin@gmail.com>
maintainer: John Millikin <jmillikin@gmail.com>
build-type: Simple
cabal-version: >= 1.6
category: Console
stability: experimental
homepage: https://john-millikin.com/software/haskell-options/
bug-reports: mailto:jmillikin@gmail.com

synopsis: Parsing command-line options
description:
  The @options@ package lets library and application developers easily work
  with command-line options.
  .
  The following example is a full program that can accept two options,
  @--message@ and @--quiet@:
  .
  @
  &#x7b;-\# LANGUAGE TemplateHaskell \#-&#x7d;
  .
  import Options
  .
  defineOptions \"MainOptions\" $ do
  &#x20;   stringOption \"optMessage\" \"message\" \"Hello world!\"
  &#x20;       \"A message to show the user.\"
  &#x20;   boolOption \"optQuiet\" \"quiet\" False
  &#x20;       \"Whether to be quiet.\"
  &#x20;
  main :: IO ()
  main = runCommand $ \\opts args -> do
  &#x20;   if optQuiet opts
  &#x20;       then return ()
  &#x20;       else putStrLn (optMessage opts)
  @
  .
  >$ ./hello
  >Hello world!
  >$ ./hello --message='ciao mondo'
  >ciao mondo
  >$ ./hello --quiet
  >$
  .
  In addition, this library will automatically create documentation options
  such as @--help@ and @--help-all@:
  .
  >$ ./hello --help
  >Help Options:
  >  -h, --help                  Show option summary.
  >  --help-all                  Show all help options.
  >
  >Application Options:
  >  --message                   A message to show the user.
  >  --quiet                     Whether to be quiet.

extra-source-files:
  cbits/hoehrmann_utf8.c
  cbits/utf8.c
  --
  scripts/common.bash
  scripts/run-coverage
  scripts/run-tests
  --
  tests/options-tests.cabal
  tests/OptionsTests.hs
  tests/OptionsTests/Defaults.hs
  tests/OptionsTests/Help.hs
  tests/OptionsTests/OptionTypes.hs
  tests/OptionsTests/StringParsing.hs
  tests/OptionsTests/Tokenize.hs
  tests/OptionsTests/Util.hs

source-repository head
  type: bazaar
  location: https://john-millikin.com/branches/haskell-options/0.1/

source-repository this
  type: bazaar
  location: https://john-millikin.com/branches/haskell-options/0.1/
  tag: haskell-options_0.1

library
  ghc-options: -Wall -O2
  cc-options: -Wall -O2
  hs-source-dirs: lib

  if os(windows)
      cpp-options: -DCABAL_OS_WINDOWS

  if !os(windows) && impl(ghc < 7.2)
      cpp-options: -DOPTIONS_ENCODING_UTF8
      c-sources: cbits/utf8.c

  build-depends:
      base >= 4.0 && < 5.0
    , transformers >= 0.2 && < 0.3
    , bytestring >= 0.9 && < 0.10
    , containers >= 0.1 && < 0.5
    , monads-tf
    , system-filepath >= 0.4 && < 0.5
    , text >= 0.7 && < 0.12
    , template-haskell

  exposed-modules:
    Options

  other-modules:
    Options.Help
    Options.OptionTypes
    Options.Tokenize
    Options.Types
    Options.Util