cabal-version:       2.2
name:                butcher
version:             2.0.0.0
synopsis:            Chops a command or program invocation into digestable pieces.
description:         See the <https://github.com/lspitzner/butcher/blob/master/README.md README> (it is properly formatted on github).
license:             BSD-3-Clause
license-file:        LICENSE
author:              Lennart Spitzner
maintainer:          Lennart Spitzner <hexagoxel@hexagoxel.de>
copyright:           Copyright (C) 2016-2020 Lennart Spitzner
category:            UI
build-type:          Simple
Stability:           experimental
extra-source-files: {
  ChangeLog.md
  srcinc/prelude.inc
  README.md
}
homepage:            https://github.com/lspitzner/butcher/
bug-reports:         https://github.com/lspitzner/butcher/issues

source-repository head {
  type: git
  location: https://github.com/lspitzner/butcher.git
}

flag butcher-examples
  description: must be enabled to build examples
  default: False
  manual: True

library
  exposed-modules:     UI.Butcher.Monadic.Types
                       UI.Butcher.Monadic
                       UI.Butcher.Monadic.Command
                       UI.Butcher.Monadic.Param
                       UI.Butcher.Monadic.Flag
                       UI.Butcher.Monadic.Pretty
                       UI.Butcher.Monadic.IO
                       UI.Butcher.Monadic.BuiltinCommands
                       UI.Butcher.Applicative.Command
                       UI.Butcher.Applicative.Param
                       UI.Butcher.Applicative.Flag
                       UI.Butcher.Applicative.Pretty
                       UI.Butcher.Applicative.IO
                       UI.Butcher.Applicative
  other-modules:       UI.Butcher.Internal.CommonTypes
                       UI.Butcher.Internal.MonadicTypes
                       UI.Butcher.Internal.Monadic
                       UI.Butcher.Internal.ApplicativeTypes
                       UI.Butcher.Internal.Applicative
                       UI.Butcher.Internal.BasicStringParser
                       UI.Butcher.Internal.Pretty
                       UI.Butcher.Internal.Interactive
  build-depends:
    { base >=4.11 && <4.17
    , free < 5.2
    , unsafe < 0.1
    , microlens <0.5
    , microlens-th <0.5
    , multistate >=0.7 && <0.9
    , pretty <1.2
    , containers <0.7
    , transformers <0.6
    , mtl <2.3
    , extra <1.8
    , void <0.8
    , bifunctors <5.6
    , deque >=0.3 && <0.5
    , barbies >= 2.0.2.0 && <2.1
    , semigroups
    }
  hs-source-dirs:      src
  default-language:    Haskell2010
  default-extensions: {
    CPP

    NoImplicitPrelude

    GADTs

    FlexibleContexts
    FlexibleInstances
    ScopedTypeVariables
    MonadComprehensions
    LambdaCase
    MultiWayIf
    KindSignatures
  }
  other-extensions: {
    DeriveFunctor
    ExistentialQuantification
    GeneralizedNewtypeDeriving
    StandaloneDeriving
    DataKinds
    TypeOperators
    TemplateHaskell
  }
  ghc-options: {
    -Wall
    -Wcompat
    -fno-spec-constr
    -fno-warn-unused-imports
    -fno-warn-orphans
  }
  include-dirs:
    srcinc

test-suite tests
  type:             exitcode-stdio-1.0
  default-language: Haskell2010
  build-depends:
    { base <999
    , butcher
    , free
    , unsafe
    , microlens
    , microlens-th
    , multistate
    , pretty
    , containers
    , transformers
    , mtl
    , extra
    , deque
    , hspec
    }
  ghc-options:      -Wall -rtsopts
  main-is:          TestMain.hs
  other-modules:    
  hs-source-dirs:   src-tests
  include-dirs:
    srcinc
  default-extensions: {
    CPP

    NoImplicitPrelude

    GADTs

    FlexibleContexts
    FlexibleInstances
    ScopedTypeVariables
    MonadComprehensions
    LambdaCase
    MultiWayIf
    KindSignatures
  }
  ghc-options: {
    -Wall
    -fno-spec-constr
    -fno-warn-unused-imports
    -fno-warn-orphans
  }

common example-base
  default-language: Haskell2010
  hs-source-dirs:   examples
  include-dirs:
    srcinc
  default-extensions: {
    GADTs

    FlexibleContexts
    FlexibleInstances
    ScopedTypeVariables
    MonadComprehensions
    LambdaCase
    MultiWayIf
    KindSignatures
  }
  ghc-options: {
    -Wall
    -rtsopts
    -fno-warn-unused-imports
    -fno-warn-orphans
  }
  if !flag(butcher-examples) {
    buildable: False
  }

executable example01
  import: example-base
  build-depends:
    { base
    , butcher
    }
  main-is:          HelloWorld.hs
  other-modules:    

executable example02
  import: example-base
  build-depends:
    { base
    , butcher
    }
  main-is:          SimpleCommandlineParser.hs

executable example03
  import: example-base
  build-depends:
    { base
    , butcher
    , concurrent-output
    }
  main-is:          InteractiveConcurrentOutput.hs

executable example04
  import: example-base
  build-depends:
    { base
    , butcher
    , barbies
    }
  main-is:          BarbieParsing.hs