module Darcs.UI.Options
    ( module Darcs.UI.Options.Core
    , DarcsOption
    , PrimDarcsOption
    , DarcsOptDescr
    , optDescr
    , Config
    , withDashes
    ) where

import Darcs.Prelude

import Data.Functor.Compose ( getCompose )
import System.Console.GetOpt ( OptDescr )

import Darcs.UI.Options.All ( DarcsOption )
import Darcs.UI.Options.Core
import Darcs.UI.Options.Util ( DarcsOptDescr, Flag, PrimDarcsOption, withDashes )
import Darcs.Util.Path ( AbsolutePath )

-- | Instantiate a 'DarcsOptDescr' with an 'AbsolutePath'
optDescr :: AbsolutePath -> DarcsOptDescr f -> OptDescr f
optDescr :: forall f. AbsolutePath -> DarcsOptDescr f -> OptDescr f
optDescr AbsolutePath
path = ((AbsolutePath -> f) -> f)
-> OptDescr (AbsolutePath -> f) -> OptDescr f
forall a b. (a -> b) -> OptDescr a -> OptDescr b
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
fmap ((AbsolutePath -> f) -> AbsolutePath -> f
forall a b. (a -> b) -> a -> b
$ AbsolutePath
path) (OptDescr (AbsolutePath -> f) -> OptDescr f)
-> (DarcsOptDescr f -> OptDescr (AbsolutePath -> f))
-> DarcsOptDescr f
-> OptDescr f
forall b c a. (b -> c) -> (a -> b) -> a -> c
. DarcsOptDescr f -> OptDescr (AbsolutePath -> f)
forall {k1} {k2} (f :: k1 -> *) (g :: k2 -> k1) (a :: k2).
Compose f g a -> f (g a)
getCompose

type Config = [Flag]