{-# LANGUAGE DeriveGeneric #-}
{-# LANGUAGE LambdaCase #-}
{-# LANGUAGE PatternSynonyms #-}
{-# LANGUAGE RankNTypes #-}
{-# LANGUAGE ScopedTypeVariables #-}
module Distribution.Client.Setup
( globalCommand
, GlobalFlags (..)
, defaultGlobalFlags
, RepoContext (..)
, withRepoContext
, configureCommand
, CommonSetupFlags (..)
, ConfigFlags (..)
, configureOptions
, filterCommonFlags
, filterConfigureFlags
, configPackageDB'
, configCompilerAux'
, configureExCommand
, ConfigExFlags (..)
, defaultConfigExFlags
, buildCommand
, BuildFlags (..)
, filterBuildFlags
, filterTestFlags
, replCommand
, filterReplFlags
, testCommand
, benchmarkCommand
, testOptions
, benchmarkOptions
, filterBenchmarkFlags
, configureExOptions
, reconfigureCommand
, installCommand
, InstallFlags (..)
, installOptions
, defaultInstallFlags
, filterHaddockArgs
, filterHaddockFlags
, haddockOptions
, defaultSolver
, defaultMaxBackjumps
, listCommand
, ListFlags (..)
, listNeedsCompiler
, UpdateFlags (..)
, defaultUpdateFlags
, infoCommand
, InfoFlags (..)
, fetchCommand
, FetchFlags (..)
, freezeCommand
, FreezeFlags (..)
, genBoundsCommand
, getCommand
, unpackCommand
, GetFlags (..)
, checkCommand
, CheckFlags (..)
, formatCommand
, uploadCommand
, UploadFlags (..)
, IsCandidate (..)
, reportCommand
, ReportFlags (..)
, runCommand
, initCommand
, initOptions
, IT.InitFlags (..)
, actAsSetupCommand
, ActAsSetupFlags (..)
, userConfigCommand
, UserConfigFlags (..)
, manpageCommand
, haddockCommand
, cleanCommand
, copyCommand
, filterCopyFlags
, registerCommand
, filterRegisterFlags
, liftOptions
, yesNoOpt
) where
import Distribution.Client.Compat.Prelude hiding (get)
import Prelude ()
import Distribution.Client.Types.AllowNewer (AllowNewer (..), AllowOlder (..), RelaxDeps (..))
import Distribution.Client.Types.Credentials (Password (..), Token (..), Username (..))
import Distribution.Client.Types.Repo (LocalRepo (..), RemoteRepo (..))
import Distribution.Client.Types.WriteGhcEnvironmentFilesPolicy
import Distribution.Client.BuildReports.Types
( ReportLevel (..)
)
import Distribution.Client.Dependency.Types
( PreSolver (..)
)
import Distribution.Client.IndexUtils.ActiveRepos
( ActiveRepos
)
import Distribution.Client.IndexUtils.IndexState
( TotalIndexState
, headTotalIndexState
)
import qualified Distribution.Client.Init.Defaults as IT
import qualified Distribution.Client.Init.Types as IT
import Distribution.Client.Targets
( UserConstraint
, readUserConstraint
)
import Distribution.Deprecated.ParseUtils (parseSpaceList, parseTokenQ)
import Distribution.Deprecated.ReadP (readP_to_E)
import Distribution.Utils.NubList
( NubList
, fromNubList
, toNubList
)
import Distribution.Solver.Types.ConstraintSource
import Distribution.Solver.Types.Settings
import Distribution.Client.GlobalFlags
( GlobalFlags (..)
, RepoContext (..)
, defaultGlobalFlags
, withRepoContext
)
import Distribution.Client.ManpageFlags (ManpageFlags, defaultManpageFlags, manpageOptions)
import qualified Distribution.Compat.CharParsing as P
import Distribution.FieldGrammar.Newtypes (SpecVersion (..))
import Distribution.PackageDescription
( BuildType (..)
, Dependency
, LibraryName (..)
, RepoKind (..)
)
import Distribution.PackageDescription.Check (CheckExplanationIDString)
import Distribution.Parsec
( parsecCommaList
)
import Distribution.ReadE
( ReadE (..)
, parsecToReadE
, parsecToReadEErr
, succeedReadE
, unexpectMsgString
)
import Distribution.Simple.Command hiding (boolOpt, boolOpt')
import qualified Distribution.Simple.Command as Command
import Distribution.Simple.Compiler (Compiler, PackageDB, PackageDBStack)
import Distribution.Simple.Configure
( computeEffectiveProfiling
, configCompilerAuxEx
, interpretPackageDbFlags
)
import Distribution.Simple.Flag
( Flag
, flagElim
, flagToList
, flagToMaybe
, fromFlagOrDefault
, maybeToFlag
, mergeListFlag
, toFlag
, pattern Flag
, pattern NoFlag
)
import Distribution.Simple.InstallDirs
( InstallDirs (..)
, PathTemplate
, combinePathTemplate
, fromPathTemplate
, toPathTemplate
)
import Distribution.Simple.Program (ProgramDb, defaultProgramDb)
import Distribution.Simple.Setup
( BenchmarkFlags (benchmarkCommonFlags)
, BooleanFlag (..)
, BuildFlags (..)
, CleanFlags (..)
, CommonSetupFlags (..)
, ConfigFlags (..)
, CopyFlags (..)
, HaddockFlags (..)
, RegisterFlags (..)
, ReplFlags (..)
, TestFlags
, boolOpt
, boolOpt'
, falseArg
, optionVerbosity
, readPackageDbList
, showPackageDbList
, testCommonFlags
, trueArg
)
import qualified Distribution.Simple.Setup as Cabal
import Distribution.Simple.Utils
( wrapText
)
import Distribution.System (Platform)
import Distribution.Types.GivenComponent
( GivenComponent (..)
, PromisedComponent (..)
)
import Distribution.Types.PackageId
import Distribution.Types.PackageVersionConstraint
( PackageVersionConstraint (..)
)
import Distribution.Types.UnqualComponentName
( unqualComponentNameToPackageName
)
import Distribution.Verbosity
( lessVerbose
, normal
, verboseNoFlags
, verboseNoTimestamp
)
import Distribution.Version
( Version
, mkVersion
, nullVersion
)
import Control.Exception
( assert
)
import Data.List
( deleteFirstsBy
)
import System.FilePath
( (</>)
)
globalCommand :: [Command action] -> CommandUI GlobalFlags
globalCommand :: forall action. [Command action] -> CommandUI GlobalFlags
globalCommand [Command action]
commands =
CommandUI
{ commandName :: String
commandName = String
""
, commandSynopsis :: String
commandSynopsis =
String
"Command line interface to the Haskell Cabal infrastructure."
, commandUsage :: String -> String
commandUsage = \String
pname ->
String
"See http://www.haskell.org/cabal/ for more information.\n"
String -> String -> String
forall a. [a] -> [a] -> [a]
++ String
"\n"
String -> String -> String
forall a. [a] -> [a] -> [a]
++ String
"Usage: "
String -> String -> String
forall a. [a] -> [a] -> [a]
++ String
pname
String -> String -> String
forall a. [a] -> [a] -> [a]
++ String
" [GLOBAL FLAGS] [COMMAND [FLAGS]]\n"
, commandDescription :: Maybe (String -> String)
commandDescription = (String -> String) -> Maybe (String -> String)
forall a. a -> Maybe a
Just ((String -> String) -> Maybe (String -> String))
-> (String -> String) -> Maybe (String -> String)
forall a b. (a -> b) -> a -> b
$ \String
pname ->
let
commands' :: [Command action]
commands' = [Command action]
commands [Command action] -> [Command action] -> [Command action]
forall a. [a] -> [a] -> [a]
++ [CommandUI () -> (() -> [String] -> action) -> Command action
forall flags action.
CommandUI flags -> (flags -> [String] -> action) -> Command action
commandAddAction CommandUI ()
helpCommandUI () -> [String] -> action
forall a. HasCallStack => a
undefined]
cmdDescs :: [(String, String)]
cmdDescs = [Command action] -> [(String, String)]
forall action. [Command action] -> [(String, String)]
getNormalCommandDescriptions [Command action]
commands'
otherCmds :: [String]
otherCmds =
(String -> String -> Bool) -> [String] -> [String] -> [String]
forall a. (a -> a -> Bool) -> [a] -> [a] -> [a]
deleteFirstsBy
String -> String -> Bool
forall a. Eq a => a -> a -> Bool
(==)
(((String, String) -> String) -> [(String, String)] -> [String]
forall a b. (a -> b) -> [a] -> [b]
map (String, String) -> String
forall a b. (a, b) -> a
fst [(String, String)]
cmdDescs)
[ String
"help"
, String
"update"
, String
"install"
, String
"fetch"
, String
"list"
, String
"info"
, String
"user-config"
, String
"get"
, String
"unpack"
, String
"init"
, String
"configure"
, String
"target"
, String
"build"
, String
"clean"
, String
"run"
, String
"repl"
, String
"test"
, String
"bench"
, String
"check"
, String
"sdist"
, String
"upload"
, String
"report"
, String
"freeze"
, String
"gen-bounds"
, String
"outdated"
, String
"haddock"
, String
"haddock-project"
, String
"hscolour"
, String
"exec"
, String
"path"
, String
"new-build"
, String
"new-configure"
, String
"new-target"
, String
"new-repl"
, String
"new-freeze"
, String
"new-run"
, String
"new-test"
, String
"new-bench"
, String
"new-haddock"
, String
"new-exec"
, String
"new-update"
, String
"new-install"
, String
"new-clean"
, String
"new-sdist"
, String
"new-haddock-project"
, String
"list-bin"
,
String
"v1-build"
, String
"v1-configure"
, String
"v1-repl"
, String
"v1-freeze"
, String
"v1-run"
, String
"v1-test"
, String
"v1-bench"
, String
"v1-haddock"
, String
"v1-exec"
, String
"v1-update"
, String
"v1-install"
, String
"v1-clean"
, String
"v1-sdist"
, String
"v1-doctest"
, String
"v1-copy"
, String
"v1-register"
, String
"v1-reconfigure"
,
String
"v2-target"
, String
"v2-build"
, String
"v2-configure"
, String
"v2-repl"
, String
"v2-freeze"
, String
"v2-run"
, String
"v2-test"
, String
"v2-bench"
, String
"v2-haddock"
, String
"v2-haddock-project"
, String
"v2-exec"
, String
"v2-update"
, String
"v2-install"
, String
"v2-clean"
, String
"v2-sdist"
]
maxlen :: Int
maxlen = [Int] -> Int
forall a. Ord a => [a] -> a
forall (t :: * -> *) a. (Foldable t, Ord a) => t a -> a
maximum ([Int] -> Int) -> [Int] -> Int
forall a b. (a -> b) -> a -> b
$ [String -> Int
forall a. [a] -> Int
forall (t :: * -> *) a. Foldable t => t a -> Int
length String
name | (String
name, String
_) <- [(String, String)]
cmdDescs]
align :: String -> String
align String
str = String
str String -> String -> String
forall a. [a] -> [a] -> [a]
++ Int -> Char -> String
forall a. Int -> a -> [a]
replicate (Int
maxlen Int -> Int -> Int
forall a. Num a => a -> a -> a
- String -> Int
forall a. [a] -> Int
forall (t :: * -> *) a. Foldable t => t a -> Int
length String
str) Char
' '
startGroup :: String -> String
startGroup String
n = String
" [" String -> String -> String
forall a. [a] -> [a] -> [a]
++ String
n String -> String -> String
forall a. [a] -> [a] -> [a]
++ String
"]"
par :: String
par = String
""
addCmd :: String -> String
addCmd String
n = case String -> [(String, String)] -> Maybe String
forall a b. Eq a => a -> [(a, b)] -> Maybe b
lookup String
n [(String, String)]
cmdDescs of
Maybe String
Nothing -> String
""
Just String
d -> String
" " String -> String -> String
forall a. [a] -> [a] -> [a]
++ String -> String
align String
n String -> String -> String
forall a. [a] -> [a] -> [a]
++ String
" " String -> String -> String
forall a. [a] -> [a] -> [a]
++ String
d
in
String
"Commands:\n"
String -> String -> String
forall a. [a] -> [a] -> [a]
++ [String] -> String
unlines
( [ String -> String
startGroup String
"global"
, String -> String
addCmd String
"user-config"
, String -> String
addCmd String
"help"
, String
par
, String -> String
startGroup String
"package database"
, String -> String
addCmd String
"update"
, String -> String
addCmd String
"list"
, String -> String
addCmd String
"info"
, String
par
, String -> String
startGroup String
"initialization and download"
, String -> String
addCmd String
"init"
, String -> String
addCmd String
"fetch"
, String -> String
addCmd String
"get"
, String
par
, String -> String
startGroup String
"project configuration"
, String -> String
addCmd String
"configure"
, String -> String
addCmd String
"freeze"
, String -> String
addCmd String
"gen-bounds"
, String -> String
addCmd String
"outdated"
, String -> String
addCmd String
"path"
, String -> String
addCmd String
"target"
, String
par
, String -> String
startGroup String
"project building and installing"
, String -> String
addCmd String
"build"
, String -> String
addCmd String
"install"
, String -> String
addCmd String
"haddock"
, String -> String
addCmd String
"haddock-project"
, String -> String
addCmd String
"clean"
, String
par
, String -> String
startGroup String
"running and testing"
, String -> String
addCmd String
"list-bin"
, String -> String
addCmd String
"repl"
, String -> String
addCmd String
"run"
, String -> String
addCmd String
"bench"
, String -> String
addCmd String
"test"
, String -> String
addCmd String
"exec"
, String
par
, String -> String
startGroup String
"sanity checks and shipping"
, String -> String
addCmd String
"check"
, String -> String
addCmd String
"sdist"
, String -> String
addCmd String
"upload"
, String -> String
addCmd String
"report"
, String
par
, String -> String
startGroup String
"deprecated"
, String -> String
addCmd String
"unpack"
, String -> String
addCmd String
"hscolour"
, String
par
, String -> String
startGroup String
"new-style projects (forwards-compatible aliases)"
, String -> String
addCmd String
"v2-target"
, String -> String
addCmd String
"v2-build"
, String -> String
addCmd String
"v2-configure"
, String -> String
addCmd String
"v2-repl"
, String -> String
addCmd String
"v2-run"
, String -> String
addCmd String
"v2-test"
, String -> String
addCmd String
"v2-bench"
, String -> String
addCmd String
"v2-freeze"
, String -> String
addCmd String
"v2-haddock"
, String -> String
addCmd String
"v2-exec"
, String -> String
addCmd String
"v2-update"
, String -> String
addCmd String
"v2-install"
, String -> String
addCmd String
"v2-clean"
, String -> String
addCmd String
"v2-sdist"
, String
par
, String -> String
startGroup String
"legacy command aliases"
, String -> String
addCmd String
"v1-build"
, String -> String
addCmd String
"v1-configure"
, String -> String
addCmd String
"v1-repl"
, String -> String
addCmd String
"v1-run"
, String -> String
addCmd String
"v1-test"
, String -> String
addCmd String
"v1-bench"
, String -> String
addCmd String
"v1-freeze"
, String -> String
addCmd String
"v1-haddock"
, String -> String
addCmd String
"v1-install"
, String -> String
addCmd String
"v1-clean"
, String -> String
addCmd String
"v1-copy"
, String -> String
addCmd String
"v1-register"
, String -> String
addCmd String
"v1-reconfigure"
]
[String] -> [String] -> [String]
forall a. [a] -> [a] -> [a]
++ if [String] -> Bool
forall a. [a] -> Bool
forall (t :: * -> *) a. Foldable t => t a -> Bool
null [String]
otherCmds
then []
else
String
par
String -> [String] -> [String]
forall a. a -> [a] -> [a]
: String -> String
startGroup String
"other"
String -> [String] -> [String]
forall a. a -> [a] -> [a]
: [String -> String
addCmd String
n | String
n <- [String]
otherCmds]
)
String -> String -> String
forall a. [a] -> [a] -> [a]
++ String
"\n"
String -> String -> String
forall a. [a] -> [a] -> [a]
++ String
"For more information about a command use:\n"
String -> String -> String
forall a. [a] -> [a] -> [a]
++ String
" "
String -> String -> String
forall a. [a] -> [a] -> [a]
++ String
pname
String -> String -> String
forall a. [a] -> [a] -> [a]
++ String
" COMMAND --help\n"
String -> String -> String
forall a. [a] -> [a] -> [a]
++ String
"or "
String -> String -> String
forall a. [a] -> [a] -> [a]
++ String
pname
String -> String -> String
forall a. [a] -> [a] -> [a]
++ String
" help COMMAND\n"
String -> String -> String
forall a. [a] -> [a] -> [a]
++ String
"\n"
String -> String -> String
forall a. [a] -> [a] -> [a]
++ String
"To install Cabal packages from hackage use:\n"
String -> String -> String
forall a. [a] -> [a] -> [a]
++ String
" "
String -> String -> String
forall a. [a] -> [a] -> [a]
++ String
pname
String -> String -> String
forall a. [a] -> [a] -> [a]
++ String
" install foo [--dry-run]\n"
String -> String -> String
forall a. [a] -> [a] -> [a]
++ String
"\n"
String -> String -> String
forall a. [a] -> [a] -> [a]
++ String
"Occasionally you need to update the list of available packages:\n"
String -> String -> String
forall a. [a] -> [a] -> [a]
++ String
" "
String -> String -> String
forall a. [a] -> [a] -> [a]
++ String
pname
String -> String -> String
forall a. [a] -> [a] -> [a]
++ String
" update\n"
, commandNotes :: Maybe (String -> String)
commandNotes = Maybe (String -> String)
forall a. Maybe a
Nothing
, commandDefaultFlags :: GlobalFlags
commandDefaultFlags = GlobalFlags
forall a. Monoid a => a
mempty
, commandOptions :: ShowOrParseArgs -> [OptionField GlobalFlags]
commandOptions = ShowOrParseArgs -> [OptionField GlobalFlags]
args
}
where
args :: ShowOrParseArgs -> [OptionField GlobalFlags]
args :: ShowOrParseArgs -> [OptionField GlobalFlags]
args ShowOrParseArgs
ShowArgs = [OptionField GlobalFlags]
argsShown
args ShowOrParseArgs
ParseArgs = [OptionField GlobalFlags]
argsShown [OptionField GlobalFlags]
-> [OptionField GlobalFlags] -> [OptionField GlobalFlags]
forall a. [a] -> [a] -> [a]
++ [OptionField GlobalFlags]
argsNotShown
argsShown :: [OptionField GlobalFlags]
argsShown :: [OptionField GlobalFlags]
argsShown =
[ String
-> [String]
-> String
-> (GlobalFlags -> Last Bool)
-> (Last Bool -> GlobalFlags -> GlobalFlags)
-> MkOptDescr
(GlobalFlags -> Last Bool)
(Last Bool -> GlobalFlags -> GlobalFlags)
GlobalFlags
-> OptionField GlobalFlags
forall get set a.
String
-> [String]
-> String
-> get
-> set
-> MkOptDescr get set a
-> OptionField a
option
[Char
'V']
[String
"version"]
String
"Print version information"
GlobalFlags -> Last Bool
globalVersion
(\Last Bool
v GlobalFlags
flags -> GlobalFlags
flags{globalVersion = v})
MkOptDescr
(GlobalFlags -> Last Bool)
(Last Bool -> GlobalFlags -> GlobalFlags)
GlobalFlags
forall a. MkOptDescr (a -> Last Bool) (Last Bool -> a -> a) a
trueArg
, String
-> [String]
-> String
-> (GlobalFlags -> Last Bool)
-> (Last Bool -> GlobalFlags -> GlobalFlags)
-> MkOptDescr
(GlobalFlags -> Last Bool)
(Last Bool -> GlobalFlags -> GlobalFlags)
GlobalFlags
-> OptionField GlobalFlags
forall get set a.
String
-> [String]
-> String
-> get
-> set
-> MkOptDescr get set a
-> OptionField a
option
[]
[String
"numeric-version"]
String
"Print just the version number"
GlobalFlags -> Last Bool
globalNumericVersion
(\Last Bool
v GlobalFlags
flags -> GlobalFlags
flags{globalNumericVersion = v})
MkOptDescr
(GlobalFlags -> Last Bool)
(Last Bool -> GlobalFlags -> GlobalFlags)
GlobalFlags
forall a. MkOptDescr (a -> Last Bool) (Last Bool -> a -> a) a
trueArg
, String
-> [String]
-> String
-> (GlobalFlags -> Last String)
-> (Last String -> GlobalFlags -> GlobalFlags)
-> MkOptDescr
(GlobalFlags -> Last String)
(Last String -> GlobalFlags -> GlobalFlags)
GlobalFlags
-> OptionField GlobalFlags
forall get set a.
String
-> [String]
-> String
-> get
-> set
-> MkOptDescr get set a
-> OptionField a
option
[]
[String
"config-file"]
String
"Set an alternate location for the config file"
GlobalFlags -> Last String
globalConfigFile
(\Last String
v GlobalFlags
flags -> GlobalFlags
flags{globalConfigFile = v})
(String
-> MkOptDescr
(GlobalFlags -> Last String)
(Last String -> GlobalFlags -> GlobalFlags)
GlobalFlags
forall b.
String -> MkOptDescr (b -> Last String) (Last String -> b -> b) b
reqArgFlag String
"FILE")
, String
-> [String]
-> String
-> (GlobalFlags -> Last Bool)
-> (Last Bool -> GlobalFlags -> GlobalFlags)
-> MkOptDescr
(GlobalFlags -> Last Bool)
(Last Bool -> GlobalFlags -> GlobalFlags)
GlobalFlags
-> OptionField GlobalFlags
forall get set a.
String
-> [String]
-> String
-> get
-> set
-> MkOptDescr get set a
-> OptionField a
option
[]
[String
"ignore-expiry"]
String
"Ignore expiry dates on signed metadata (use only in exceptional circumstances)"
GlobalFlags -> Last Bool
globalIgnoreExpiry
(\Last Bool
v GlobalFlags
flags -> GlobalFlags
flags{globalIgnoreExpiry = v})
MkOptDescr
(GlobalFlags -> Last Bool)
(Last Bool -> GlobalFlags -> GlobalFlags)
GlobalFlags
forall a. MkOptDescr (a -> Last Bool) (Last Bool -> a -> a) a
trueArg
, String
-> [String]
-> String
-> (GlobalFlags -> Last String)
-> (Last String -> GlobalFlags -> GlobalFlags)
-> MkOptDescr
(GlobalFlags -> Last String)
(Last String -> GlobalFlags -> GlobalFlags)
GlobalFlags
-> OptionField GlobalFlags
forall get set a.
String
-> [String]
-> String
-> get
-> set
-> MkOptDescr get set a
-> OptionField a
option
[]
[String
"http-transport"]
String
"Set a transport for http(s) requests. Accepts 'curl', 'wget', 'powershell', and 'plain-http'. (default: 'curl')"
GlobalFlags -> Last String
globalHttpTransport
(\Last String
v GlobalFlags
flags -> GlobalFlags
flags{globalHttpTransport = v})
(String
-> MkOptDescr
(GlobalFlags -> Last String)
(Last String -> GlobalFlags -> GlobalFlags)
GlobalFlags
forall b.
String -> MkOptDescr (b -> Last String) (Last String -> b -> b) b
reqArgFlag String
"HttpTransport")
, String
-> (GlobalFlags -> Last Bool)
-> (Last Bool -> GlobalFlags -> GlobalFlags)
-> [(GlobalFlags -> Last Bool)
-> (Last Bool -> GlobalFlags -> GlobalFlags)
-> OptDescr GlobalFlags]
-> OptionField GlobalFlags
forall get set a.
String -> get -> set -> [get -> set -> OptDescr a] -> OptionField a
multiOption
String
"nix"
GlobalFlags -> Last Bool
globalNix
(\Last Bool
v GlobalFlags
flags -> GlobalFlags
flags{globalNix = v})
[ String
-> (Maybe String -> Last Bool)
-> (Last Bool -> [Maybe String])
-> MkOptDescr
(GlobalFlags -> Last Bool)
(Last Bool -> GlobalFlags -> GlobalFlags)
GlobalFlags
forall b a.
Monoid b =>
String
-> (Maybe String -> b)
-> (b -> [Maybe String])
-> MkOptDescr (a -> b) (b -> a -> a) a
optArg'
String
"(True or False)"
(Maybe Bool -> Last Bool
forall a. Maybe a -> Flag a
maybeToFlag (Maybe Bool -> Last Bool)
-> (Maybe String -> Maybe Bool) -> Maybe String -> Last Bool
forall b c a. (b -> c) -> (a -> b) -> a -> c
. (String -> Maybe Bool
forall a. Read a => String -> Maybe a
readMaybe (String -> Maybe Bool) -> Maybe String -> Maybe Bool
forall (m :: * -> *) a b. Monad m => (a -> m b) -> m a -> m b
=<<))
( \case
Flag Bool
True -> [String -> Maybe String
forall a. a -> Maybe a
Just String
"enable"]
Flag Bool
False -> [String -> Maybe String
forall a. a -> Maybe a
Just String
"disable"]
Last Bool
NoFlag -> []
)
String
""
[String
"nix"]
String
"[DEPRECATED] Nix integration: run commands through nix-shell if a 'shell.nix' file exists (default is False)"
, Last Bool
-> MkOptDescr
(GlobalFlags -> Last Bool)
(Last Bool -> GlobalFlags -> GlobalFlags)
GlobalFlags
forall b a. Eq b => b -> MkOptDescr (a -> b) (b -> a -> a) a
noArg
(Bool -> Last Bool
forall a. a -> Last a
Flag Bool
True)
[]
[String
"enable-nix"]
String
"[DEPRECATED] Enable Nix integration: run commands through nix-shell if a 'shell.nix' file exists"
, Last Bool
-> MkOptDescr
(GlobalFlags -> Last Bool)
(Last Bool -> GlobalFlags -> GlobalFlags)
GlobalFlags
forall b a. Eq b => b -> MkOptDescr (a -> b) (b -> a -> a) a
noArg
(Bool -> Last Bool
forall a. a -> Last a
Flag Bool
False)
[]
[String
"disable-nix"]
String
"[DEPRECATED] Disable Nix integration"
]
, String
-> [String]
-> String
-> (GlobalFlags -> Last String)
-> (Last String -> GlobalFlags -> GlobalFlags)
-> MkOptDescr
(GlobalFlags -> Last String)
(Last String -> GlobalFlags -> GlobalFlags)
GlobalFlags
-> OptionField GlobalFlags
forall get set a.
String
-> [String]
-> String
-> get
-> set
-> MkOptDescr get set a
-> OptionField a
option
[]
[String
"store-dir", String
"storedir"]
String
"The location of the build store"
GlobalFlags -> Last String
globalStoreDir
(\Last String
v GlobalFlags
flags -> GlobalFlags
flags{globalStoreDir = v})
(String
-> MkOptDescr
(GlobalFlags -> Last String)
(Last String -> GlobalFlags -> GlobalFlags)
GlobalFlags
forall b.
String -> MkOptDescr (b -> Last String) (Last String -> b -> b) b
reqArgFlag String
"DIR")
, String
-> [String]
-> String
-> (GlobalFlags -> Last ActiveRepos)
-> (Last ActiveRepos -> GlobalFlags -> GlobalFlags)
-> MkOptDescr
(GlobalFlags -> Last ActiveRepos)
(Last ActiveRepos -> GlobalFlags -> GlobalFlags)
GlobalFlags
-> OptionField GlobalFlags
forall get set a.
String
-> [String]
-> String
-> get
-> set
-> MkOptDescr get set a
-> OptionField a
option
[]
[String
"active-repositories"]
String
"The active package repositories (set to ':none' to disable all repositories)"
GlobalFlags -> Last ActiveRepos
globalActiveRepos
(\Last ActiveRepos
v GlobalFlags
flags -> GlobalFlags
flags{globalActiveRepos = v})
( String
-> ReadE (Last ActiveRepos)
-> (Last ActiveRepos -> [String])
-> MkOptDescr
(GlobalFlags -> Last ActiveRepos)
(Last ActiveRepos -> GlobalFlags -> GlobalFlags)
GlobalFlags
forall b a.
Monoid b =>
String
-> ReadE b
-> (b -> [String])
-> MkOptDescr (a -> b) (b -> a -> a) a
reqArg
String
"REPOS"
( (String -> String)
-> ParsecParser (Last ActiveRepos) -> ReadE (Last ActiveRepos)
forall a. (String -> String) -> ParsecParser a -> ReadE a
parsecToReadE
(\String
err -> String
"Error parsing active-repositories: " String -> String -> String
forall a. [a] -> [a] -> [a]
++ String
err)
(ActiveRepos -> Last ActiveRepos
forall a. a -> Last a
toFlag (ActiveRepos -> Last ActiveRepos)
-> ParsecParser ActiveRepos -> ParsecParser (Last ActiveRepos)
forall a b. (a -> b) -> ParsecParser a -> ParsecParser b
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
`fmap` ParsecParser ActiveRepos
forall a (m :: * -> *). (Parsec a, CabalParsing m) => m a
forall (m :: * -> *). CabalParsing m => m ActiveRepos
parsec)
)
((ActiveRepos -> String) -> [ActiveRepos] -> [String]
forall a b. (a -> b) -> [a] -> [b]
map ActiveRepos -> String
forall a. Pretty a => a -> String
prettyShow ([ActiveRepos] -> [String])
-> (Last ActiveRepos -> [ActiveRepos])
-> Last ActiveRepos
-> [String]
forall b c a. (b -> c) -> (a -> b) -> a -> c
. Last ActiveRepos -> [ActiveRepos]
forall a. Flag a -> [a]
flagToList)
)
]
argsNotShown :: [OptionField GlobalFlags]
argsNotShown :: [OptionField GlobalFlags]
argsNotShown =
[ String
-> [String]
-> String
-> (GlobalFlags -> NubList RemoteRepo)
-> (NubList RemoteRepo -> GlobalFlags -> GlobalFlags)
-> MkOptDescr
(GlobalFlags -> NubList RemoteRepo)
(NubList RemoteRepo -> GlobalFlags -> GlobalFlags)
GlobalFlags
-> OptionField GlobalFlags
forall get set a.
String
-> [String]
-> String
-> get
-> set
-> MkOptDescr get set a
-> OptionField a
option
[]
[String
"remote-repo"]
String
"The name and url for a remote repository"
GlobalFlags -> NubList RemoteRepo
globalRemoteRepos
(\NubList RemoteRepo
v GlobalFlags
flags -> GlobalFlags
flags{globalRemoteRepos = v})
(String
-> (String -> NubList RemoteRepo)
-> (NubList RemoteRepo -> [String])
-> MkOptDescr
(GlobalFlags -> NubList RemoteRepo)
(NubList RemoteRepo -> GlobalFlags -> GlobalFlags)
GlobalFlags
forall b a.
Monoid b =>
String
-> (String -> b)
-> (b -> [String])
-> MkOptDescr (a -> b) (b -> a -> a) a
reqArg' String
"NAME:URL" ([RemoteRepo] -> NubList RemoteRepo
forall a. Ord a => [a] -> NubList a
toNubList ([RemoteRepo] -> NubList RemoteRepo)
-> (String -> [RemoteRepo]) -> String -> NubList RemoteRepo
forall b c a. (b -> c) -> (a -> b) -> a -> c
. Maybe RemoteRepo -> [RemoteRepo]
forall a. Maybe a -> [a]
maybeToList (Maybe RemoteRepo -> [RemoteRepo])
-> (String -> Maybe RemoteRepo) -> String -> [RemoteRepo]
forall b c a. (b -> c) -> (a -> b) -> a -> c
. String -> Maybe RemoteRepo
readRemoteRepo) ((RemoteRepo -> String) -> [RemoteRepo] -> [String]
forall a b. (a -> b) -> [a] -> [b]
map RemoteRepo -> String
showRemoteRepo ([RemoteRepo] -> [String])
-> (NubList RemoteRepo -> [RemoteRepo])
-> NubList RemoteRepo
-> [String]
forall b c a. (b -> c) -> (a -> b) -> a -> c
. NubList RemoteRepo -> [RemoteRepo]
forall a. NubList a -> [a]
fromNubList))
, String
-> [String]
-> String
-> (GlobalFlags -> NubList LocalRepo)
-> (NubList LocalRepo -> GlobalFlags -> GlobalFlags)
-> MkOptDescr
(GlobalFlags -> NubList LocalRepo)
(NubList LocalRepo -> GlobalFlags -> GlobalFlags)
GlobalFlags
-> OptionField GlobalFlags
forall get set a.
String
-> [String]
-> String
-> get
-> set
-> MkOptDescr get set a
-> OptionField a
option
[]
[String
"local-no-index-repo"]
String
"The name and a path for a local no-index repository"
GlobalFlags -> NubList LocalRepo
globalLocalNoIndexRepos
(\NubList LocalRepo
v GlobalFlags
flags -> GlobalFlags
flags{globalLocalNoIndexRepos = v})
(String
-> (String -> NubList LocalRepo)
-> (NubList LocalRepo -> [String])
-> MkOptDescr
(GlobalFlags -> NubList LocalRepo)
(NubList LocalRepo -> GlobalFlags -> GlobalFlags)
GlobalFlags
forall b a.
Monoid b =>
String
-> (String -> b)
-> (b -> [String])
-> MkOptDescr (a -> b) (b -> a -> a) a
reqArg' String
"NAME:PATH" ([LocalRepo] -> NubList LocalRepo
forall a. Ord a => [a] -> NubList a
toNubList ([LocalRepo] -> NubList LocalRepo)
-> (String -> [LocalRepo]) -> String -> NubList LocalRepo
forall b c a. (b -> c) -> (a -> b) -> a -> c
. Maybe LocalRepo -> [LocalRepo]
forall a. Maybe a -> [a]
maybeToList (Maybe LocalRepo -> [LocalRepo])
-> (String -> Maybe LocalRepo) -> String -> [LocalRepo]
forall b c a. (b -> c) -> (a -> b) -> a -> c
. String -> Maybe LocalRepo
readLocalRepo) ((LocalRepo -> String) -> [LocalRepo] -> [String]
forall a b. (a -> b) -> [a] -> [b]
map LocalRepo -> String
showLocalRepo ([LocalRepo] -> [String])
-> (NubList LocalRepo -> [LocalRepo])
-> NubList LocalRepo
-> [String]
forall b c a. (b -> c) -> (a -> b) -> a -> c
. NubList LocalRepo -> [LocalRepo]
forall a. NubList a -> [a]
fromNubList))
, String
-> [String]
-> String
-> (GlobalFlags -> Last String)
-> (Last String -> GlobalFlags -> GlobalFlags)
-> MkOptDescr
(GlobalFlags -> Last String)
(Last String -> GlobalFlags -> GlobalFlags)
GlobalFlags
-> OptionField GlobalFlags
forall get set a.
String
-> [String]
-> String
-> get
-> set
-> MkOptDescr get set a
-> OptionField a
option
[]
[String
"remote-repo-cache"]
String
"The location where downloads from all remote repos are cached"
GlobalFlags -> Last String
globalCacheDir
(\Last String
v GlobalFlags
flags -> GlobalFlags
flags{globalCacheDir = v})
(String
-> MkOptDescr
(GlobalFlags -> Last String)
(Last String -> GlobalFlags -> GlobalFlags)
GlobalFlags
forall b.
String -> MkOptDescr (b -> Last String) (Last String -> b -> b) b
reqArgFlag String
"DIR")
, String
-> [String]
-> String
-> (GlobalFlags -> Last String)
-> (Last String -> GlobalFlags -> GlobalFlags)
-> MkOptDescr
(GlobalFlags -> Last String)
(Last String -> GlobalFlags -> GlobalFlags)
GlobalFlags
-> OptionField GlobalFlags
forall get set a.
String
-> [String]
-> String
-> get
-> set
-> MkOptDescr get set a
-> OptionField a
option
[]
[String
"logs-dir", String
"logsdir"]
String
"The location to put log files"
GlobalFlags -> Last String
globalLogsDir
(\Last String
v GlobalFlags
flags -> GlobalFlags
flags{globalLogsDir = v})
(String
-> MkOptDescr
(GlobalFlags -> Last String)
(Last String -> GlobalFlags -> GlobalFlags)
GlobalFlags
forall b.
String -> MkOptDescr (b -> Last String) (Last String -> b -> b) b
reqArgFlag String
"DIR")
, String
-> [String]
-> String
-> (GlobalFlags -> Last String)
-> (Last String -> GlobalFlags -> GlobalFlags)
-> MkOptDescr
(GlobalFlags -> Last String)
(Last String -> GlobalFlags -> GlobalFlags)
GlobalFlags
-> OptionField GlobalFlags
forall get set a.
String
-> [String]
-> String
-> get
-> set
-> MkOptDescr get set a
-> OptionField a
option
[]
[String
"default-user-config"]
String
"Set a location for a cabal.config file for projects without their own cabal.config freeze file."
GlobalFlags -> Last String
globalConstraintsFile
(\Last String
v GlobalFlags
flags -> GlobalFlags
flags{globalConstraintsFile = v})
(String
-> MkOptDescr
(GlobalFlags -> Last String)
(Last String -> GlobalFlags -> GlobalFlags)
GlobalFlags
forall b.
String -> MkOptDescr (b -> Last String) (Last String -> b -> b) b
reqArgFlag String
"FILE")
]
configureCommand :: CommandUI ConfigFlags
configureCommand :: CommandUI ConfigFlags
configureCommand =
CommandUI ConfigFlags
c
{ commandName = "configure"
, commandDefaultFlags = mempty
, commandDescription = Just $ \String
_ ->
String -> String
wrapText (String -> String) -> String -> String
forall a b. (a -> b) -> a -> b
$
String
"Configure how the package is built by setting "
String -> String -> String
forall a. [a] -> [a] -> [a]
++ String
"package (and other) flags.\n"
String -> String -> String
forall a. [a] -> [a] -> [a]
++ String
"\n"
String -> String -> String
forall a. [a] -> [a] -> [a]
++ String
"The configuration affects several other commands, "
String -> String -> String
forall a. [a] -> [a] -> [a]
++ String
"including v1-build, v1-test, v1-bench, v1-run, v1-repl.\n"
, commandUsage = \String
pname ->
String
"Usage: " String -> String -> String
forall a. [a] -> [a] -> [a]
++ String
pname String -> String -> String
forall a. [a] -> [a] -> [a]
++ String
" v1-configure [FLAGS]\n"
, commandNotes = Just $ \String
pname ->
(ProgramDb -> String
Cabal.programFlagsDescription ProgramDb
defaultProgramDb String -> String -> String
forall a. [a] -> [a] -> [a]
++ String
"\n")
String -> String -> String
forall a. [a] -> [a] -> [a]
++ String
"Examples:\n"
String -> String -> String
forall a. [a] -> [a] -> [a]
++ String
" "
String -> String -> String
forall a. [a] -> [a] -> [a]
++ String
pname
String -> String -> String
forall a. [a] -> [a] -> [a]
++ String
" v1-configure\n"
String -> String -> String
forall a. [a] -> [a] -> [a]
++ String
" Configure with defaults;\n"
String -> String -> String
forall a. [a] -> [a] -> [a]
++ String
" "
String -> String -> String
forall a. [a] -> [a] -> [a]
++ String
pname
String -> String -> String
forall a. [a] -> [a] -> [a]
++ String
" v1-configure --enable-tests -fcustomflag\n"
String -> String -> String
forall a. [a] -> [a] -> [a]
++ String
" Configure building package including tests,\n"
String -> String -> String
forall a. [a] -> [a] -> [a]
++ String
" with some package-specific flag.\n"
}
where
c :: CommandUI ConfigFlags
c = ProgramDb -> CommandUI ConfigFlags
Cabal.configureCommand ProgramDb
defaultProgramDb
configureOptions :: ShowOrParseArgs -> [OptionField ConfigFlags]
configureOptions :: ShowOrParseArgs -> [OptionField ConfigFlags]
configureOptions = CommandUI ConfigFlags
-> ShowOrParseArgs -> [OptionField ConfigFlags]
forall flags.
CommandUI flags -> ShowOrParseArgs -> [OptionField flags]
commandOptions CommandUI ConfigFlags
configureCommand
filterCommonFlags :: CommonSetupFlags -> Version -> CommonSetupFlags
filterCommonFlags :: CommonSetupFlags -> Version -> CommonSetupFlags
filterCommonFlags CommonSetupFlags
flags Version
cabalLibVersion
| Version
cabalLibVersion Version -> Version -> Bool
forall a. Ord a => a -> a -> Bool
>= [Int] -> Version
mkVersion [Int
3, Int
13, Int
0] = CommonSetupFlags
flags_latest
| Version
cabalLibVersion Version -> Version -> Bool
forall a. Ord a => a -> a -> Bool
< [Int] -> Version
mkVersion [Int
1, Int
2, Int
5] = CommonSetupFlags
flags_1_2_5
| Version
cabalLibVersion Version -> Version -> Bool
forall a. Ord a => a -> a -> Bool
< [Int] -> Version
mkVersion [Int
2, Int
1, Int
0] = CommonSetupFlags
flags_2_1_0
| Version
cabalLibVersion Version -> Version -> Bool
forall a. Ord a => a -> a -> Bool
< [Int] -> Version
mkVersion [Int
3, Int
13, Int
0] = CommonSetupFlags
flags_3_13_0
| Bool
otherwise = String -> CommonSetupFlags
forall a. HasCallStack => String -> a
error String
"the impossible just happened"
where
flags_latest :: CommonSetupFlags
flags_latest = CommonSetupFlags
flags
flags_3_13_0 :: CommonSetupFlags
flags_3_13_0 =
CommonSetupFlags
flags_latest
{
setupWorkingDir = NoFlag
,
setupKeepTempFiles = NoFlag
}
flags_2_1_0 :: CommonSetupFlags
flags_2_1_0 =
CommonSetupFlags
flags_3_13_0
{
setupVerbosity = fmap verboseNoTimestamp (setupVerbosity flags_3_13_0)
}
flags_1_2_5 :: CommonSetupFlags
flags_1_2_5 =
CommonSetupFlags
flags_2_1_0
{
setupVerbosity =
fmap verboseNoFlags (setupVerbosity flags_2_1_0)
}
filterConfigureFlags :: ConfigFlags -> Version -> ConfigFlags
filterConfigureFlags :: ConfigFlags -> Version -> ConfigFlags
filterConfigureFlags ConfigFlags
flags Version
cabalLibVersion =
let flags' :: ConfigFlags
flags' = ConfigFlags -> Version -> ConfigFlags
filterConfigureFlags' ConfigFlags
flags Version
cabalLibVersion
in ConfigFlags
flags'
{ configCommonFlags =
filterCommonFlags (configCommonFlags flags') cabalLibVersion
}
filterConfigureFlags' :: ConfigFlags -> Version -> ConfigFlags
filterConfigureFlags' :: ConfigFlags -> Version -> ConfigFlags
filterConfigureFlags' ConfigFlags
flags Version
cabalLibVersion
| Version
cabalLibVersion Version -> Version -> Bool
forall a. Ord a => a -> a -> Bool
>= [Int] -> Version
mkVersion [Int
3, Int
13, Int
0] = ConfigFlags
flags_latest
| Version
cabalLibVersion Version -> Version -> Bool
forall a. Ord a => a -> a -> Bool
< [Int] -> Version
mkVersion [Int
1, Int
3, Int
10] = ConfigFlags
flags_1_3_10
| Version
cabalLibVersion Version -> Version -> Bool
forall a. Ord a => a -> a -> Bool
< [Int] -> Version
mkVersion [Int
1, Int
10, Int
0] = ConfigFlags
flags_1_10_0
| Version
cabalLibVersion Version -> Version -> Bool
forall a. Ord a => a -> a -> Bool
< [Int] -> Version
mkVersion [Int
1, Int
12, Int
0] = ConfigFlags
flags_1_12_0
| Version
cabalLibVersion Version -> Version -> Bool
forall a. Ord a => a -> a -> Bool
< [Int] -> Version
mkVersion [Int
1, Int
14, Int
0] = ConfigFlags
flags_1_14_0
| Version
cabalLibVersion Version -> Version -> Bool
forall a. Ord a => a -> a -> Bool
< [Int] -> Version
mkVersion [Int
1, Int
18, Int
0] = ConfigFlags
flags_1_18_0
| Version
cabalLibVersion Version -> Version -> Bool
forall a. Ord a => a -> a -> Bool
< [Int] -> Version
mkVersion [Int
1, Int
19, Int
1] = ConfigFlags
flags_1_19_1
| Version
cabalLibVersion Version -> Version -> Bool
forall a. Ord a => a -> a -> Bool
< [Int] -> Version
mkVersion [Int
1, Int
19, Int
2] = ConfigFlags
flags_1_19_2
| Version
cabalLibVersion Version -> Version -> Bool
forall a. Ord a => a -> a -> Bool
< [Int] -> Version
mkVersion [Int
1, Int
21, Int
1] = ConfigFlags
flags_1_21_1
| Version
cabalLibVersion Version -> Version -> Bool
forall a. Ord a => a -> a -> Bool
< [Int] -> Version
mkVersion [Int
1, Int
22, Int
0] = ConfigFlags
flags_1_22_0
| Version
cabalLibVersion Version -> Version -> Bool
forall a. Ord a => a -> a -> Bool
< [Int] -> Version
mkVersion [Int
1, Int
22, Int
1] = ConfigFlags
flags_1_22_1
| Version
cabalLibVersion Version -> Version -> Bool
forall a. Ord a => a -> a -> Bool
< [Int] -> Version
mkVersion [Int
1, Int
23, Int
0] = ConfigFlags
flags_1_23_0
| Version
cabalLibVersion Version -> Version -> Bool
forall a. Ord a => a -> a -> Bool
< [Int] -> Version
mkVersion [Int
1, Int
25, Int
0] = ConfigFlags
flags_1_25_0
| Version
cabalLibVersion Version -> Version -> Bool
forall a. Ord a => a -> a -> Bool
< [Int] -> Version
mkVersion [Int
2, Int
1, Int
0] = ConfigFlags
flags_2_1_0
| Version
cabalLibVersion Version -> Version -> Bool
forall a. Ord a => a -> a -> Bool
< [Int] -> Version
mkVersion [Int
2, Int
5, Int
0] = ConfigFlags
flags_2_5_0
| Version
cabalLibVersion Version -> Version -> Bool
forall a. Ord a => a -> a -> Bool
< [Int] -> Version
mkVersion [Int
3, Int
7, Int
0] = ConfigFlags
flags_3_7_0
| Version
cabalLibVersion Version -> Version -> Bool
forall a. Ord a => a -> a -> Bool
< [Int] -> Version
mkVersion [Int
3, Int
11, Int
0] = ConfigFlags
flags_3_11_0
| Version
cabalLibVersion Version -> Version -> Bool
forall a. Ord a => a -> a -> Bool
< [Int] -> Version
mkVersion [Int
3, Int
13, Int
0] = ConfigFlags
flags_3_13_0
| Bool
otherwise = String -> ConfigFlags
forall a. HasCallStack => String -> a
error String
"the impossible just happened"
where
flags_latest :: ConfigFlags
flags_latest =
ConfigFlags
flags
{
configConstraints = []
}
flags_3_13_0 :: ConfigFlags
flags_3_13_0 =
let scrubVersion :: PromisedComponent -> PromisedComponent
scrubVersion PromisedComponent
pc =
PromisedComponent
pc
{ promisedComponentPackage =
(promisedComponentPackage pc){pkgVersion = nullVersion}
}
in
ConfigFlags
flags_latest
{
configProfShared = NoFlag
, configIgnoreBuildTools = NoFlag
,
configPromisedDependencies =
map scrubVersion (configPromisedDependencies flags)
}
flags_3_11_0 :: ConfigFlags
flags_3_11_0 =
ConfigFlags
flags_3_13_0
{
configPromisedDependencies = assert (null $ configPromisedDependencies flags) []
,
configCoverageFor = NoFlag
}
flags_3_7_0 :: ConfigFlags
flags_3_7_0 =
ConfigFlags
flags_3_11_0
{
configExtraLibDirsStatic = []
,
configDumpBuildInfo = NoFlag
}
flags_2_5_0 :: ConfigFlags
flags_2_5_0 =
ConfigFlags
flags_3_7_0
{
configDependencies =
let convertToLegacyInternalDep (GivenComponent PackageName
_ (LSubLibName UnqualComponentName
cn) ComponentId
cid) =
GivenComponent -> Maybe GivenComponent
forall a. a -> Maybe a
Just (GivenComponent -> Maybe GivenComponent)
-> GivenComponent -> Maybe GivenComponent
forall a b. (a -> b) -> a -> b
$
PackageName -> LibraryName -> ComponentId -> GivenComponent
GivenComponent
(UnqualComponentName -> PackageName
unqualComponentNameToPackageName UnqualComponentName
cn)
LibraryName
LMainLibName
ComponentId
cid
convertToLegacyInternalDep (GivenComponent PackageName
pn LibraryName
LMainLibName ComponentId
cid) =
GivenComponent -> Maybe GivenComponent
forall a. a -> Maybe a
Just (GivenComponent -> Maybe GivenComponent)
-> GivenComponent -> Maybe GivenComponent
forall a b. (a -> b) -> a -> b
$ PackageName -> LibraryName -> ComponentId -> GivenComponent
GivenComponent PackageName
pn LibraryName
LMainLibName ComponentId
cid
in catMaybes $ convertToLegacyInternalDep <$> configDependencies flags
,
configAllowDependingOnPrivateLibs = NoFlag
,
configFullyStaticExe = NoFlag
}
flags_2_1_0 :: ConfigFlags
flags_2_1_0 =
ConfigFlags
flags_2_5_0
{
configStaticLib = NoFlag
, configSplitSections = NoFlag
}
flags_1_25_0 :: ConfigFlags
flags_1_25_0 =
ConfigFlags
flags_2_1_0
{
configInstallDirs = configInstallDirs_1_25_0
,
configDeterministic = mempty
}
configInstallDirs_1_25_0 :: InstallDirs (Last PathTemplate)
configInstallDirs_1_25_0 =
let dirs :: InstallDirs (Last PathTemplate)
dirs = ConfigFlags -> InstallDirs (Last PathTemplate)
configInstallDirs ConfigFlags
flags
in InstallDirs (Last PathTemplate)
dirs
{ dynlibdir = NoFlag
, libexecsubdir = NoFlag
, libexecdir =
maybeToFlag $
combinePathTemplate
<$> flagToMaybe (libexecdir dirs)
<*> flagToMaybe (libexecsubdir dirs)
}
(Bool
tryLibProfiling, Bool
_tryLibProfilingShared, Bool
tryExeProfiling) = ConfigFlags -> (Bool, Bool, Bool)
computeEffectiveProfiling ConfigFlags
flags
flags_1_23_0 :: ConfigFlags
flags_1_23_0 =
ConfigFlags
flags_1_25_0
{ configProfDetail = NoFlag
, configProfLibDetail = NoFlag
, configIPID = NoFlag
, configProf = NoFlag
, configProfExe = Flag tryExeProfiling
, configProfLib = Flag tryLibProfiling
}
flags_1_22_1 :: ConfigFlags
flags_1_22_1 =
ConfigFlags
flags_1_23_0
{ configDebugInfo = NoFlag
, configProfExe = NoFlag
}
flags_1_22_0 :: ConfigFlags
flags_1_22_0 = ConfigFlags
flags_1_23_0{configDebugInfo = NoFlag}
flags_1_21_1 :: ConfigFlags
flags_1_21_1 =
ConfigFlags
flags_1_22_0
{ configRelocatable = NoFlag
, configCoverage = NoFlag
, configLibCoverage = configCoverage flags
}
flags_1_19_2 :: ConfigFlags
flags_1_19_2 =
ConfigFlags
flags_1_21_1
{ configExactConfiguration = NoFlag
, configStripLibs = NoFlag
}
flags_1_19_1 :: ConfigFlags
flags_1_19_1 =
ConfigFlags
flags_1_19_2
{ configDependencies = []
, configConstraints = configConstraints flags
}
flags_1_18_0 :: ConfigFlags
flags_1_18_0 =
ConfigFlags
flags_1_19_1
{ configProgramPathExtra = toNubList []
, configInstallDirs = configInstallDirs_1_18_0
}
configInstallDirs_1_18_0 :: InstallDirs (Last PathTemplate)
configInstallDirs_1_18_0 = (ConfigFlags -> InstallDirs (Last PathTemplate)
configInstallDirs ConfigFlags
flags_1_19_1){sysconfdir = NoFlag}
flags_1_14_0 :: ConfigFlags
flags_1_14_0 = ConfigFlags
flags_1_18_0{configBenchmarks = NoFlag}
flags_1_12_0 :: ConfigFlags
flags_1_12_0 =
ConfigFlags
flags_1_14_0
{ configLibCoverage = NoFlag
, configDynExe = NoFlag
}
flags_1_10_0 :: ConfigFlags
flags_1_10_0 = ConfigFlags
flags_1_12_0{configTests = NoFlag}
flags_1_3_10 :: ConfigFlags
flags_1_3_10 = ConfigFlags
flags_1_10_0{configConstraints = []}
configPackageDB' :: ConfigFlags -> PackageDBStack
configPackageDB' :: ConfigFlags -> PackageDBStack
configPackageDB' ConfigFlags
cfg =
Bool -> [Maybe PackageDB] -> PackageDBStack
forall fp. Bool -> [Maybe (PackageDBX fp)] -> PackageDBStackX fp
interpretPackageDbFlags Bool
userInstall (ConfigFlags -> [Maybe PackageDB]
configPackageDBs ConfigFlags
cfg)
where
userInstall :: Bool
userInstall = Bool -> Last Bool -> Bool
forall a. a -> Flag a -> a
Cabal.fromFlagOrDefault Bool
True (ConfigFlags -> Last Bool
configUserInstall ConfigFlags
cfg)
configCompilerAux' :: ConfigFlags -> IO (Compiler, Platform, ProgramDb)
configCompilerAux' :: ConfigFlags -> IO (Compiler, Platform, ProgramDb)
configCompilerAux' ConfigFlags
configFlags = do
let commonFlags :: CommonSetupFlags
commonFlags = ConfigFlags -> CommonSetupFlags
configCommonFlags ConfigFlags
configFlags
ConfigFlags -> IO (Compiler, Platform, ProgramDb)
configCompilerAuxEx
ConfigFlags
configFlags
{
configCommonFlags =
commonFlags
{ setupVerbosity = fmap lessVerbose (setupVerbosity commonFlags)
}
}
data ConfigExFlags = ConfigExFlags
{ ConfigExFlags -> Last Version
configCabalVersion :: Flag Version
, ConfigExFlags -> Last Bool
configAppend :: Flag Bool
, ConfigExFlags -> Last Bool
configBackup :: Flag Bool
, ConfigExFlags -> [(UserConstraint, ConstraintSource)]
configExConstraints :: [(UserConstraint, ConstraintSource)]
, ConfigExFlags -> [PackageVersionConstraint]
configPreferences :: [PackageVersionConstraint]
, ConfigExFlags -> Flag PreSolver
configSolver :: Flag PreSolver
, ConfigExFlags -> Maybe AllowNewer
configAllowNewer :: Maybe AllowNewer
, ConfigExFlags -> Maybe AllowOlder
configAllowOlder :: Maybe AllowOlder
, ConfigExFlags -> Last WriteGhcEnvironmentFilesPolicy
configWriteGhcEnvironmentFilesPolicy
:: Flag WriteGhcEnvironmentFilesPolicy
}
deriving (ConfigExFlags -> ConfigExFlags -> Bool
(ConfigExFlags -> ConfigExFlags -> Bool)
-> (ConfigExFlags -> ConfigExFlags -> Bool) -> Eq ConfigExFlags
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
$c== :: ConfigExFlags -> ConfigExFlags -> Bool
== :: ConfigExFlags -> ConfigExFlags -> Bool
$c/= :: ConfigExFlags -> ConfigExFlags -> Bool
/= :: ConfigExFlags -> ConfigExFlags -> Bool
Eq, Int -> ConfigExFlags -> String -> String
[ConfigExFlags] -> String -> String
ConfigExFlags -> String
(Int -> ConfigExFlags -> String -> String)
-> (ConfigExFlags -> String)
-> ([ConfigExFlags] -> String -> String)
-> Show ConfigExFlags
forall a.
(Int -> a -> String -> String)
-> (a -> String) -> ([a] -> String -> String) -> Show a
$cshowsPrec :: Int -> ConfigExFlags -> String -> String
showsPrec :: Int -> ConfigExFlags -> String -> String
$cshow :: ConfigExFlags -> String
show :: ConfigExFlags -> String
$cshowList :: [ConfigExFlags] -> String -> String
showList :: [ConfigExFlags] -> String -> String
Show, (forall x. ConfigExFlags -> Rep ConfigExFlags x)
-> (forall x. Rep ConfigExFlags x -> ConfigExFlags)
-> Generic ConfigExFlags
forall x. Rep ConfigExFlags x -> ConfigExFlags
forall x. ConfigExFlags -> Rep ConfigExFlags x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cfrom :: forall x. ConfigExFlags -> Rep ConfigExFlags x
from :: forall x. ConfigExFlags -> Rep ConfigExFlags x
$cto :: forall x. Rep ConfigExFlags x -> ConfigExFlags
to :: forall x. Rep ConfigExFlags x -> ConfigExFlags
Generic)
defaultConfigExFlags :: ConfigExFlags
defaultConfigExFlags :: ConfigExFlags
defaultConfigExFlags = ConfigExFlags
forall a. Monoid a => a
mempty{configSolver = Flag defaultSolver}
configureExCommand :: CommandUI (ConfigFlags, ConfigExFlags)
configureExCommand :: CommandUI (ConfigFlags, ConfigExFlags)
configureExCommand =
CommandUI ConfigFlags
configureCommand
{ commandDefaultFlags = (mempty, defaultConfigExFlags)
, commandOptions = \ShowOrParseArgs
showOrParseArgs ->
((ConfigFlags, ConfigExFlags) -> ConfigFlags)
-> (ConfigFlags
-> (ConfigFlags, ConfigExFlags) -> (ConfigFlags, ConfigExFlags))
-> [OptionField ConfigFlags]
-> [OptionField (ConfigFlags, ConfigExFlags)]
forall b a.
(b -> a) -> (a -> b -> b) -> [OptionField a] -> [OptionField b]
liftOptions
(ConfigFlags, ConfigExFlags) -> ConfigFlags
forall a b. (a, b) -> a
fst
ConfigFlags
-> (ConfigFlags, ConfigExFlags) -> (ConfigFlags, ConfigExFlags)
forall {a} {a} {b}. a -> (a, b) -> (a, b)
setFst
( (OptionField ConfigFlags -> Bool)
-> [OptionField ConfigFlags] -> [OptionField ConfigFlags]
forall a. (a -> Bool) -> [a] -> [a]
filter
( (String -> [String] -> Bool
forall (t :: * -> *) a. (Foldable t, Eq a) => a -> t a -> Bool
`notElem` [String
"constraint", String
"dependency", String
"promised-dependency", String
"exact-configuration"])
(String -> Bool)
-> (OptionField ConfigFlags -> String)
-> OptionField ConfigFlags
-> Bool
forall b c a. (b -> c) -> (a -> b) -> a -> c
. OptionField ConfigFlags -> String
forall a. OptionField a -> String
optionName
)
([OptionField ConfigFlags] -> [OptionField ConfigFlags])
-> [OptionField ConfigFlags] -> [OptionField ConfigFlags]
forall a b. (a -> b) -> a -> b
$ ShowOrParseArgs -> [OptionField ConfigFlags]
configureOptions ShowOrParseArgs
showOrParseArgs
)
[OptionField (ConfigFlags, ConfigExFlags)]
-> [OptionField (ConfigFlags, ConfigExFlags)]
-> [OptionField (ConfigFlags, ConfigExFlags)]
forall a. [a] -> [a] -> [a]
++ ((ConfigFlags, ConfigExFlags) -> ConfigExFlags)
-> (ConfigExFlags
-> (ConfigFlags, ConfigExFlags) -> (ConfigFlags, ConfigExFlags))
-> [OptionField ConfigExFlags]
-> [OptionField (ConfigFlags, ConfigExFlags)]
forall b a.
(b -> a) -> (a -> b -> b) -> [OptionField a] -> [OptionField b]
liftOptions
(ConfigFlags, ConfigExFlags) -> ConfigExFlags
forall a b. (a, b) -> b
snd
ConfigExFlags
-> (ConfigFlags, ConfigExFlags) -> (ConfigFlags, ConfigExFlags)
forall {b} {a} {b}. b -> (a, b) -> (a, b)
setSnd
(ShowOrParseArgs -> ConstraintSource -> [OptionField ConfigExFlags]
configureExOptions ShowOrParseArgs
showOrParseArgs ConstraintSource
ConstraintSourceCommandlineFlag)
}
where
setFst :: a -> (a, b) -> (a, b)
setFst a
a (a
_, b
b) = (a
a, b
b)
setSnd :: b -> (a, b) -> (a, b)
setSnd b
b (a
a, b
_) = (a
a, b
b)
configureExOptions
:: ShowOrParseArgs
-> ConstraintSource
-> [OptionField ConfigExFlags]
configureExOptions :: ShowOrParseArgs -> ConstraintSource -> [OptionField ConfigExFlags]
configureExOptions ShowOrParseArgs
_showOrParseArgs ConstraintSource
src =
[ String
-> [String]
-> String
-> (ConfigExFlags -> Last Version)
-> (Last Version -> ConfigExFlags -> ConfigExFlags)
-> MkOptDescr
(ConfigExFlags -> Last Version)
(Last Version -> ConfigExFlags -> ConfigExFlags)
ConfigExFlags
-> OptionField ConfigExFlags
forall get set a.
String
-> [String]
-> String
-> get
-> set
-> MkOptDescr get set a
-> OptionField a
option
[]
[String
"cabal-lib-version"]
( String
"Select which version of the Cabal lib to use to build packages "
String -> String -> String
forall a. [a] -> [a] -> [a]
++ String
"(useful for testing)."
)
ConfigExFlags -> Last Version
configCabalVersion
(\Last Version
v ConfigExFlags
flags -> ConfigExFlags
flags{configCabalVersion = v})
( String
-> ReadE (Last Version)
-> (Last Version -> [String])
-> MkOptDescr
(ConfigExFlags -> Last Version)
(Last Version -> ConfigExFlags -> ConfigExFlags)
ConfigExFlags
forall b a.
Monoid b =>
String
-> ReadE b
-> (b -> [String])
-> MkOptDescr (a -> b) (b -> a -> a) a
reqArg
String
"VERSION"
( (String -> String)
-> ParsecParser (Last Version) -> ReadE (Last Version)
forall a. (String -> String) -> ParsecParser a -> ReadE a
parsecToReadE
(String
"Cannot parse cabal lib version: " String -> String -> String
forall a. [a] -> [a] -> [a]
++)
((Version -> Last Version)
-> ParsecParser Version -> ParsecParser (Last Version)
forall a b. (a -> b) -> ParsecParser a -> ParsecParser b
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
fmap Version -> Last Version
forall a. a -> Last a
toFlag ParsecParser Version
forall a (m :: * -> *). (Parsec a, CabalParsing m) => m a
forall (m :: * -> *). CabalParsing m => m Version
parsec)
)
((Version -> String) -> [Version] -> [String]
forall a b. (a -> b) -> [a] -> [b]
map Version -> String
forall a. Pretty a => a -> String
prettyShow ([Version] -> [String])
-> (Last Version -> [Version]) -> Last Version -> [String]
forall b c a. (b -> c) -> (a -> b) -> a -> c
. Last Version -> [Version]
forall a. Flag a -> [a]
flagToList)
)
, String
-> [String]
-> String
-> (ConfigExFlags -> Last Bool)
-> (Last Bool -> ConfigExFlags -> ConfigExFlags)
-> MkOptDescr
(ConfigExFlags -> Last Bool)
(Last Bool -> ConfigExFlags -> ConfigExFlags)
ConfigExFlags
-> OptionField ConfigExFlags
forall get set a.
String
-> [String]
-> String
-> get
-> set
-> MkOptDescr get set a
-> OptionField a
option
String
""
[String
"append"]
String
"appending the new config to the old config file"
ConfigExFlags -> Last Bool
configAppend
(\Last Bool
v ConfigExFlags
flags -> ConfigExFlags
flags{configAppend = v})
(String
-> String
-> MkOptDescr
(ConfigExFlags -> Last Bool)
(Last Bool -> ConfigExFlags -> ConfigExFlags)
ConfigExFlags
forall a.
String
-> String -> MkOptDescr (a -> Last Bool) (Last Bool -> a -> a) a
boolOpt [] [])
, String
-> [String]
-> String
-> (ConfigExFlags -> Last Bool)
-> (Last Bool -> ConfigExFlags -> ConfigExFlags)
-> MkOptDescr
(ConfigExFlags -> Last Bool)
(Last Bool -> ConfigExFlags -> ConfigExFlags)
ConfigExFlags
-> OptionField ConfigExFlags
forall get set a.
String
-> [String]
-> String
-> get
-> set
-> MkOptDescr get set a
-> OptionField a
option
String
""
[String
"backup"]
String
"the backup of the config file before any alterations"
ConfigExFlags -> Last Bool
configBackup
(\Last Bool
v ConfigExFlags
flags -> ConfigExFlags
flags{configBackup = v})
(String
-> String
-> MkOptDescr
(ConfigExFlags -> Last Bool)
(Last Bool -> ConfigExFlags -> ConfigExFlags)
ConfigExFlags
forall a.
String
-> String -> MkOptDescr (a -> Last Bool) (Last Bool -> a -> a) a
boolOpt [] [])
, String
-> [String]
-> String
-> (ConfigExFlags -> [(UserConstraint, ConstraintSource)])
-> ([(UserConstraint, ConstraintSource)]
-> ConfigExFlags -> ConfigExFlags)
-> MkOptDescr
(ConfigExFlags -> [(UserConstraint, ConstraintSource)])
([(UserConstraint, ConstraintSource)]
-> ConfigExFlags -> ConfigExFlags)
ConfigExFlags
-> OptionField ConfigExFlags
forall get set a.
String
-> [String]
-> String
-> get
-> set
-> MkOptDescr get set a
-> OptionField a
option
String
"c"
[String
"constraint"]
String
"Specify constraints on a package (version, installed/source, flags)"
ConfigExFlags -> [(UserConstraint, ConstraintSource)]
configExConstraints
(\[(UserConstraint, ConstraintSource)]
v ConfigExFlags
flags -> ConfigExFlags
flags{configExConstraints = v})
( String
-> ReadE [(UserConstraint, ConstraintSource)]
-> ([(UserConstraint, ConstraintSource)] -> [String])
-> MkOptDescr
(ConfigExFlags -> [(UserConstraint, ConstraintSource)])
([(UserConstraint, ConstraintSource)]
-> ConfigExFlags -> ConfigExFlags)
ConfigExFlags
forall b a.
Monoid b =>
String
-> ReadE b
-> (b -> [String])
-> MkOptDescr (a -> b) (b -> a -> a) a
reqArg
String
"CONSTRAINT"
((\UserConstraint
x -> [(UserConstraint
x, ConstraintSource
src)]) (UserConstraint -> [(UserConstraint, ConstraintSource)])
-> ReadE UserConstraint
-> ReadE [(UserConstraint, ConstraintSource)]
forall a b. (a -> b) -> ReadE a -> ReadE b
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
`fmap` (String -> Either String UserConstraint) -> ReadE UserConstraint
forall a. (String -> Either String a) -> ReadE a
ReadE String -> Either String UserConstraint
readUserConstraint)
(((UserConstraint, ConstraintSource) -> String)
-> [(UserConstraint, ConstraintSource)] -> [String]
forall a b. (a -> b) -> [a] -> [b]
map (((UserConstraint, ConstraintSource) -> String)
-> [(UserConstraint, ConstraintSource)] -> [String])
-> ((UserConstraint, ConstraintSource) -> String)
-> [(UserConstraint, ConstraintSource)]
-> [String]
forall a b. (a -> b) -> a -> b
$ UserConstraint -> String
forall a. Pretty a => a -> String
prettyShow (UserConstraint -> String)
-> ((UserConstraint, ConstraintSource) -> UserConstraint)
-> (UserConstraint, ConstraintSource)
-> String
forall b c a. (b -> c) -> (a -> b) -> a -> c
. (UserConstraint, ConstraintSource) -> UserConstraint
forall a b. (a, b) -> a
fst)
)
, String
-> [String]
-> String
-> (ConfigExFlags -> [PackageVersionConstraint])
-> ([PackageVersionConstraint] -> ConfigExFlags -> ConfigExFlags)
-> MkOptDescr
(ConfigExFlags -> [PackageVersionConstraint])
([PackageVersionConstraint] -> ConfigExFlags -> ConfigExFlags)
ConfigExFlags
-> OptionField ConfigExFlags
forall get set a.
String
-> [String]
-> String
-> get
-> set
-> MkOptDescr get set a
-> OptionField a
option
[]
[String
"preference"]
String
"Specify preferences (soft constraints) on the version of a package"
ConfigExFlags -> [PackageVersionConstraint]
configPreferences
(\[PackageVersionConstraint]
v ConfigExFlags
flags -> ConfigExFlags
flags{configPreferences = v})
( String
-> ReadE [PackageVersionConstraint]
-> ([PackageVersionConstraint] -> [String])
-> MkOptDescr
(ConfigExFlags -> [PackageVersionConstraint])
([PackageVersionConstraint] -> ConfigExFlags -> ConfigExFlags)
ConfigExFlags
forall b a.
Monoid b =>
String
-> ReadE b
-> (b -> [String])
-> MkOptDescr (a -> b) (b -> a -> a) a
reqArg
String
"CONSTRAINT"
( (String -> String)
-> ParsecParser [PackageVersionConstraint]
-> ReadE [PackageVersionConstraint]
forall a. (String -> String) -> ParsecParser a -> ReadE a
parsecToReadE
(String -> String -> String
forall a b. a -> b -> a
const String
"dependency expected")
((PackageVersionConstraint -> [PackageVersionConstraint])
-> ParsecParser PackageVersionConstraint
-> ParsecParser [PackageVersionConstraint]
forall a b. (a -> b) -> ParsecParser a -> ParsecParser b
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
fmap (\PackageVersionConstraint
x -> [PackageVersionConstraint
x]) ParsecParser PackageVersionConstraint
forall a (m :: * -> *). (Parsec a, CabalParsing m) => m a
forall (m :: * -> *). CabalParsing m => m PackageVersionConstraint
parsec)
)
((PackageVersionConstraint -> String)
-> [PackageVersionConstraint] -> [String]
forall a b. (a -> b) -> [a] -> [b]
map PackageVersionConstraint -> String
forall a. Pretty a => a -> String
prettyShow)
)
, (ConfigExFlags -> Flag PreSolver)
-> (Flag PreSolver -> ConfigExFlags -> ConfigExFlags)
-> OptionField ConfigExFlags
forall flags.
(flags -> Flag PreSolver)
-> (Flag PreSolver -> flags -> flags) -> OptionField flags
optionSolver ConfigExFlags -> Flag PreSolver
configSolver (\Flag PreSolver
v ConfigExFlags
flags -> ConfigExFlags
flags{configSolver = v})
, String
-> [String]
-> String
-> (ConfigExFlags -> Maybe RelaxDeps)
-> (Maybe RelaxDeps -> ConfigExFlags -> ConfigExFlags)
-> MkOptDescr
(ConfigExFlags -> Maybe RelaxDeps)
(Maybe RelaxDeps -> ConfigExFlags -> ConfigExFlags)
ConfigExFlags
-> OptionField ConfigExFlags
forall get set a.
String
-> [String]
-> String
-> get
-> set
-> MkOptDescr get set a
-> OptionField a
option
[]
[String
"allow-older"]
(String
"Ignore lower bounds in all dependencies or DEPS")
((AllowOlder -> RelaxDeps) -> Maybe AllowOlder -> Maybe RelaxDeps
forall a b. (a -> b) -> Maybe a -> Maybe b
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
fmap AllowOlder -> RelaxDeps
unAllowOlder (Maybe AllowOlder -> Maybe RelaxDeps)
-> (ConfigExFlags -> Maybe AllowOlder)
-> ConfigExFlags
-> Maybe RelaxDeps
forall b c a. (b -> c) -> (a -> b) -> a -> c
. ConfigExFlags -> Maybe AllowOlder
configAllowOlder)
(\Maybe RelaxDeps
v ConfigExFlags
flags -> ConfigExFlags
flags{configAllowOlder = fmap AllowOlder v})
( String
-> ReadE (Maybe RelaxDeps)
-> (String, Maybe RelaxDeps)
-> (Maybe RelaxDeps -> [Maybe String])
-> MkOptDescr
(ConfigExFlags -> Maybe RelaxDeps)
(Maybe RelaxDeps -> ConfigExFlags -> ConfigExFlags)
ConfigExFlags
forall b a.
Monoid b =>
String
-> ReadE b
-> (String, b)
-> (b -> [Maybe String])
-> MkOptDescr (a -> b) (b -> a -> a) a
optArg
String
"DEPS"
((ParseError -> String)
-> ParsecParser (Maybe RelaxDeps) -> ReadE (Maybe RelaxDeps)
forall a. (ParseError -> String) -> ParsecParser a -> ReadE a
parsecToReadEErr ParseError -> String
unexpectMsgString ParsecParser (Maybe RelaxDeps)
forall (m :: * -> *). CabalParsing m => m (Maybe RelaxDeps)
relaxDepsParser)
(RelaxDeps -> String
forall a. Show a => a -> String
show RelaxDeps
RelaxDepsAll, RelaxDeps -> Maybe RelaxDeps
forall a. a -> Maybe a
Just RelaxDeps
RelaxDepsAll)
Maybe RelaxDeps -> [Maybe String]
relaxDepsPrinter
)
, String
-> [String]
-> String
-> (ConfigExFlags -> Maybe RelaxDeps)
-> (Maybe RelaxDeps -> ConfigExFlags -> ConfigExFlags)
-> MkOptDescr
(ConfigExFlags -> Maybe RelaxDeps)
(Maybe RelaxDeps -> ConfigExFlags -> ConfigExFlags)
ConfigExFlags
-> OptionField ConfigExFlags
forall get set a.
String
-> [String]
-> String
-> get
-> set
-> MkOptDescr get set a
-> OptionField a
option
[]
[String
"allow-newer"]
(String
"Ignore upper bounds in all dependencies or DEPS")
((AllowNewer -> RelaxDeps) -> Maybe AllowNewer -> Maybe RelaxDeps
forall a b. (a -> b) -> Maybe a -> Maybe b
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
fmap AllowNewer -> RelaxDeps
unAllowNewer (Maybe AllowNewer -> Maybe RelaxDeps)
-> (ConfigExFlags -> Maybe AllowNewer)
-> ConfigExFlags
-> Maybe RelaxDeps
forall b c a. (b -> c) -> (a -> b) -> a -> c
. ConfigExFlags -> Maybe AllowNewer
configAllowNewer)
(\Maybe RelaxDeps
v ConfigExFlags
flags -> ConfigExFlags
flags{configAllowNewer = fmap AllowNewer v})
( String
-> ReadE (Maybe RelaxDeps)
-> (String, Maybe RelaxDeps)
-> (Maybe RelaxDeps -> [Maybe String])
-> MkOptDescr
(ConfigExFlags -> Maybe RelaxDeps)
(Maybe RelaxDeps -> ConfigExFlags -> ConfigExFlags)
ConfigExFlags
forall b a.
Monoid b =>
String
-> ReadE b
-> (String, b)
-> (b -> [Maybe String])
-> MkOptDescr (a -> b) (b -> a -> a) a
optArg
String
"DEPS"
((ParseError -> String)
-> ParsecParser (Maybe RelaxDeps) -> ReadE (Maybe RelaxDeps)
forall a. (ParseError -> String) -> ParsecParser a -> ReadE a
parsecToReadEErr ParseError -> String
unexpectMsgString ParsecParser (Maybe RelaxDeps)
forall (m :: * -> *). CabalParsing m => m (Maybe RelaxDeps)
relaxDepsParser)
(RelaxDeps -> String
forall a. Show a => a -> String
show RelaxDeps
RelaxDepsAll, RelaxDeps -> Maybe RelaxDeps
forall a. a -> Maybe a
Just RelaxDeps
RelaxDepsAll)
Maybe RelaxDeps -> [Maybe String]
relaxDepsPrinter
)
, String
-> [String]
-> String
-> (ConfigExFlags -> Last WriteGhcEnvironmentFilesPolicy)
-> (Last WriteGhcEnvironmentFilesPolicy
-> ConfigExFlags -> ConfigExFlags)
-> MkOptDescr
(ConfigExFlags -> Last WriteGhcEnvironmentFilesPolicy)
(Last WriteGhcEnvironmentFilesPolicy
-> ConfigExFlags -> ConfigExFlags)
ConfigExFlags
-> OptionField ConfigExFlags
forall get set a.
String
-> [String]
-> String
-> get
-> set
-> MkOptDescr get set a
-> OptionField a
option
[]
[String
"write-ghc-environment-files"]
( String
"Whether to create a .ghc.environment file after a successful build"
String -> String -> String
forall a. [a] -> [a] -> [a]
++ String
" (v2-build only)"
)
ConfigExFlags -> Last WriteGhcEnvironmentFilesPolicy
configWriteGhcEnvironmentFilesPolicy
(\Last WriteGhcEnvironmentFilesPolicy
v ConfigExFlags
flags -> ConfigExFlags
flags{configWriteGhcEnvironmentFilesPolicy = v})
( String
-> ReadE (Last WriteGhcEnvironmentFilesPolicy)
-> (Last WriteGhcEnvironmentFilesPolicy -> [String])
-> MkOptDescr
(ConfigExFlags -> Last WriteGhcEnvironmentFilesPolicy)
(Last WriteGhcEnvironmentFilesPolicy
-> ConfigExFlags -> ConfigExFlags)
ConfigExFlags
forall b a.
Monoid b =>
String
-> ReadE b
-> (b -> [String])
-> MkOptDescr (a -> b) (b -> a -> a) a
reqArg
String
"always|never|ghc8.4.4+"
ReadE (Last WriteGhcEnvironmentFilesPolicy)
writeGhcEnvironmentFilesPolicyParser
Last WriteGhcEnvironmentFilesPolicy -> [String]
writeGhcEnvironmentFilesPolicyPrinter
)
]
writeGhcEnvironmentFilesPolicyParser :: ReadE (Flag WriteGhcEnvironmentFilesPolicy)
writeGhcEnvironmentFilesPolicyParser :: ReadE (Last WriteGhcEnvironmentFilesPolicy)
writeGhcEnvironmentFilesPolicyParser = (String -> Either String (Last WriteGhcEnvironmentFilesPolicy))
-> ReadE (Last WriteGhcEnvironmentFilesPolicy)
forall a. (String -> Either String a) -> ReadE a
ReadE ((String -> Either String (Last WriteGhcEnvironmentFilesPolicy))
-> ReadE (Last WriteGhcEnvironmentFilesPolicy))
-> (String -> Either String (Last WriteGhcEnvironmentFilesPolicy))
-> ReadE (Last WriteGhcEnvironmentFilesPolicy)
forall a b. (a -> b) -> a -> b
$ \case
String
"always" -> Last WriteGhcEnvironmentFilesPolicy
-> Either String (Last WriteGhcEnvironmentFilesPolicy)
forall a b. b -> Either a b
Right (Last WriteGhcEnvironmentFilesPolicy
-> Either String (Last WriteGhcEnvironmentFilesPolicy))
-> Last WriteGhcEnvironmentFilesPolicy
-> Either String (Last WriteGhcEnvironmentFilesPolicy)
forall a b. (a -> b) -> a -> b
$ WriteGhcEnvironmentFilesPolicy
-> Last WriteGhcEnvironmentFilesPolicy
forall a. a -> Last a
Flag WriteGhcEnvironmentFilesPolicy
AlwaysWriteGhcEnvironmentFiles
String
"never" -> Last WriteGhcEnvironmentFilesPolicy
-> Either String (Last WriteGhcEnvironmentFilesPolicy)
forall a b. b -> Either a b
Right (Last WriteGhcEnvironmentFilesPolicy
-> Either String (Last WriteGhcEnvironmentFilesPolicy))
-> Last WriteGhcEnvironmentFilesPolicy
-> Either String (Last WriteGhcEnvironmentFilesPolicy)
forall a b. (a -> b) -> a -> b
$ WriteGhcEnvironmentFilesPolicy
-> Last WriteGhcEnvironmentFilesPolicy
forall a. a -> Last a
Flag WriteGhcEnvironmentFilesPolicy
NeverWriteGhcEnvironmentFiles
String
"ghc8.4.4+" -> Last WriteGhcEnvironmentFilesPolicy
-> Either String (Last WriteGhcEnvironmentFilesPolicy)
forall a b. b -> Either a b
Right (Last WriteGhcEnvironmentFilesPolicy
-> Either String (Last WriteGhcEnvironmentFilesPolicy))
-> Last WriteGhcEnvironmentFilesPolicy
-> Either String (Last WriteGhcEnvironmentFilesPolicy)
forall a b. (a -> b) -> a -> b
$ WriteGhcEnvironmentFilesPolicy
-> Last WriteGhcEnvironmentFilesPolicy
forall a. a -> Last a
Flag WriteGhcEnvironmentFilesPolicy
WriteGhcEnvironmentFilesOnlyForGhc844AndNewer
String
policy ->
String -> Either String (Last WriteGhcEnvironmentFilesPolicy)
forall a b. a -> Either a b
Left (String -> Either String (Last WriteGhcEnvironmentFilesPolicy))
-> String -> Either String (Last WriteGhcEnvironmentFilesPolicy)
forall a b. (a -> b) -> a -> b
$
String
"Cannot parse the GHC environment file write policy '"
String -> String -> String
forall a. Semigroup a => a -> a -> a
<> String
policy
String -> String -> String
forall a. Semigroup a => a -> a -> a
<> String
"'"
writeGhcEnvironmentFilesPolicyPrinter
:: Flag WriteGhcEnvironmentFilesPolicy -> [String]
writeGhcEnvironmentFilesPolicyPrinter :: Last WriteGhcEnvironmentFilesPolicy -> [String]
writeGhcEnvironmentFilesPolicyPrinter = \case
(Flag WriteGhcEnvironmentFilesPolicy
AlwaysWriteGhcEnvironmentFiles) -> [String
"always"]
(Flag WriteGhcEnvironmentFilesPolicy
NeverWriteGhcEnvironmentFiles) -> [String
"never"]
(Flag WriteGhcEnvironmentFilesPolicy
WriteGhcEnvironmentFilesOnlyForGhc844AndNewer) -> [String
"ghc8.4.4+"]
Last WriteGhcEnvironmentFilesPolicy
NoFlag -> []
relaxDepsParser :: CabalParsing m => m (Maybe RelaxDeps)
relaxDepsParser :: forall (m :: * -> *). CabalParsing m => m (Maybe RelaxDeps)
relaxDepsParser = do
rs <- m RelaxedDep -> m Char -> m [RelaxedDep]
forall (m :: * -> *) a sep. Alternative m => m a -> m sep -> m [a]
P.sepBy m RelaxedDep
forall a (m :: * -> *). (Parsec a, CabalParsing m) => m a
forall (m :: * -> *). CabalParsing m => m RelaxedDep
parsec (Char -> m Char
forall (m :: * -> *). CharParsing m => Char -> m Char
P.char Char
',')
if null rs
then
fail $
"empty argument list is not allowed. "
++ "Note: use --allow-newer without the equals sign to permit all "
++ "packages to use newer versions."
else return . Just . RelaxDepsSome . toList $ rs
relaxDepsPrinter :: (Maybe RelaxDeps) -> [Maybe String]
relaxDepsPrinter :: Maybe RelaxDeps -> [Maybe String]
relaxDepsPrinter Maybe RelaxDeps
Nothing = []
relaxDepsPrinter (Just RelaxDeps
RelaxDepsAll) = [Maybe String
forall a. Maybe a
Nothing]
relaxDepsPrinter (Just (RelaxDepsSome [RelaxedDep]
pkgs)) = (RelaxedDep -> Maybe String) -> [RelaxedDep] -> [Maybe String]
forall a b. (a -> b) -> [a] -> [b]
map (String -> Maybe String
forall a. a -> Maybe a
Just (String -> Maybe String)
-> (RelaxedDep -> String) -> RelaxedDep -> Maybe String
forall b c a. (b -> c) -> (a -> b) -> a -> c
. RelaxedDep -> String
forall a. Pretty a => a -> String
prettyShow) ([RelaxedDep] -> [Maybe String]) -> [RelaxedDep] -> [Maybe String]
forall a b. (a -> b) -> a -> b
$ [RelaxedDep]
pkgs
instance Monoid ConfigExFlags where
mempty :: ConfigExFlags
mempty = ConfigExFlags
forall a. (Generic a, GMonoid (Rep a)) => a
gmempty
mappend :: ConfigExFlags -> ConfigExFlags -> ConfigExFlags
mappend = ConfigExFlags -> ConfigExFlags -> ConfigExFlags
forall a. Semigroup a => a -> a -> a
(<>)
instance Semigroup ConfigExFlags where
<> :: ConfigExFlags -> ConfigExFlags -> ConfigExFlags
(<>) = ConfigExFlags -> ConfigExFlags -> ConfigExFlags
forall a. (Generic a, GSemigroup (Rep a)) => a -> a -> a
gmappend
reconfigureCommand :: CommandUI (ConfigFlags, ConfigExFlags)
reconfigureCommand :: CommandUI (ConfigFlags, ConfigExFlags)
reconfigureCommand =
CommandUI (ConfigFlags, ConfigExFlags)
configureExCommand
{ commandName = "reconfigure"
, commandSynopsis = "Reconfigure the package if necessary."
, commandDescription = Just $ \String
pname ->
String -> String
wrapText (String -> String) -> String -> String
forall a b. (a -> b) -> a -> b
$
String
"Run `configure` with the most recently used flags, or append FLAGS "
String -> String -> String
forall a. [a] -> [a] -> [a]
++ String
"to the most recently used configuration. "
String -> String -> String
forall a. [a] -> [a] -> [a]
++ String
"Accepts the same flags as `"
String -> String -> String
forall a. [a] -> [a] -> [a]
++ String
pname
String -> String -> String
forall a. [a] -> [a] -> [a]
++ String
" v1-configure'. "
String -> String -> String
forall a. [a] -> [a] -> [a]
++ String
"If the package has never been configured, the default flags are "
String -> String -> String
forall a. [a] -> [a] -> [a]
++ String
"used."
, commandNotes = Just $ \String
pname ->
String
"Examples:\n"
String -> String -> String
forall a. [a] -> [a] -> [a]
++ String
" "
String -> String -> String
forall a. [a] -> [a] -> [a]
++ String
pname
String -> String -> String
forall a. [a] -> [a] -> [a]
++ String
" v1-reconfigure\n"
String -> String -> String
forall a. [a] -> [a] -> [a]
++ String
" Configure with the most recently used flags.\n"
String -> String -> String
forall a. [a] -> [a] -> [a]
++ String
" "
String -> String -> String
forall a. [a] -> [a] -> [a]
++ String
pname
String -> String -> String
forall a. [a] -> [a] -> [a]
++ String
" v1-reconfigure -w PATH\n"
String -> String -> String
forall a. [a] -> [a] -> [a]
++ String
" Reconfigure with the most recently used flags,\n"
String -> String -> String
forall a. [a] -> [a] -> [a]
++ String
" but use the compiler at PATH.\n\n"
, commandUsage = usageAlternatives "v1-reconfigure" ["[FLAGS]"]
, commandDefaultFlags = mempty
}
buildCommand :: CommandUI BuildFlags
buildCommand :: CommandUI BuildFlags
buildCommand =
CommandUI BuildFlags
parent
{ commandName = "build"
, commandDescription = Just $ \String
_ ->
String -> String
wrapText (String -> String) -> String -> String
forall a b. (a -> b) -> a -> b
$
String
"Components encompass executables, tests, and benchmarks.\n"
String -> String -> String
forall a. [a] -> [a] -> [a]
++ String
"\n"
String -> String -> String
forall a. [a] -> [a] -> [a]
++ String
"Affected by configuration options, see `v1-configure`.\n"
, commandDefaultFlags = commandDefaultFlags parent
, commandUsage =
usageAlternatives "v1-build" $
["[FLAGS]", "COMPONENTS [FLAGS]"]
, commandOptions = commandOptions parent
, commandNotes = Just $ \String
pname ->
String
"Examples:\n"
String -> String -> String
forall a. [a] -> [a] -> [a]
++ String
" "
String -> String -> String
forall a. [a] -> [a] -> [a]
++ String
pname
String -> String -> String
forall a. [a] -> [a] -> [a]
++ String
" v1-build "
String -> String -> String
forall a. [a] -> [a] -> [a]
++ String
" All the components in the package\n"
String -> String -> String
forall a. [a] -> [a] -> [a]
++ String
" "
String -> String -> String
forall a. [a] -> [a] -> [a]
++ String
pname
String -> String -> String
forall a. [a] -> [a] -> [a]
++ String
" v1-build foo "
String -> String -> String
forall a. [a] -> [a] -> [a]
++ String
" A component (i.e. lib, exe, test suite)\n\n"
String -> String -> String
forall a. [a] -> [a] -> [a]
++ ProgramDb -> String
Cabal.programFlagsDescription ProgramDb
defaultProgramDb
}
where
parent :: CommandUI BuildFlags
parent = ProgramDb -> CommandUI BuildFlags
Cabal.buildCommand ProgramDb
defaultProgramDb
filterBuildFlags :: BuildFlags -> Version -> BuildFlags
filterBuildFlags :: BuildFlags -> Version -> BuildFlags
filterBuildFlags BuildFlags
flags Version
cabalLibVersion =
BuildFlags
flags
{ buildCommonFlags =
filterCommonFlags (buildCommonFlags flags) cabalLibVersion
}
filterTestFlags :: TestFlags -> Version -> TestFlags
filterTestFlags :: TestFlags -> Version -> TestFlags
filterTestFlags TestFlags
flags Version
cabalLibVersion =
let flags' :: TestFlags
flags' = TestFlags -> Version -> TestFlags
filterTestFlags' TestFlags
flags Version
cabalLibVersion
in TestFlags
flags'
{ testCommonFlags =
filterCommonFlags (testCommonFlags flags') cabalLibVersion
}
filterTestFlags' :: TestFlags -> Version -> TestFlags
filterTestFlags' :: TestFlags -> Version -> TestFlags
filterTestFlags' TestFlags
flags Version
cabalLibVersion
| Version
cabalLibVersion Version -> Version -> Bool
forall a. Ord a => a -> a -> Bool
>= [Int] -> Version
mkVersion [Int
3, Int
0, Int
0] = TestFlags
flags_latest
| Version
cabalLibVersion Version -> Version -> Bool
forall a. Ord a => a -> a -> Bool
< [Int] -> Version
mkVersion [Int
3, Int
0, Int
0] = TestFlags
flags_3_0_0
| Bool
otherwise = String -> TestFlags
forall a. HasCallStack => String -> a
error String
"the impossible just happened"
where
flags_latest :: TestFlags
flags_latest = TestFlags
flags
flags_3_0_0 :: TestFlags
flags_3_0_0 =
TestFlags
flags_latest
{
Cabal.testWrapper = NoFlag
}
replCommand :: CommandUI ReplFlags
replCommand :: CommandUI ReplFlags
replCommand =
CommandUI ReplFlags
parent
{ commandName = "repl"
, commandDescription = Just $ \String
pname ->
String -> String
wrapText (String -> String) -> String -> String
forall a b. (a -> b) -> a -> b
$
String
"If the current directory contains no package, ignores COMPONENT "
String -> String -> String
forall a. [a] -> [a] -> [a]
++ String
"parameters and opens an interactive interpreter session;\n"
String -> String -> String
forall a. [a] -> [a] -> [a]
++ String
"\n"
String -> String -> String
forall a. [a] -> [a] -> [a]
++ String
"Otherwise, (re)configures with the given or default flags, and "
String -> String -> String
forall a. [a] -> [a] -> [a]
++ String
"loads the interpreter with the relevant modules. For executables, "
String -> String -> String
forall a. [a] -> [a] -> [a]
++ String
"tests and benchmarks, loads the main module (and its "
String -> String -> String
forall a. [a] -> [a] -> [a]
++ String
"dependencies); for libraries all exposed/other modules.\n"
String -> String -> String
forall a. [a] -> [a] -> [a]
++ String
"\n"
String -> String -> String
forall a. [a] -> [a] -> [a]
++ String
"The default component is the library itself, or the executable "
String -> String -> String
forall a. [a] -> [a] -> [a]
++ String
"if that is the only component.\n"
String -> String -> String
forall a. [a] -> [a] -> [a]
++ String
"\n"
String -> String -> String
forall a. [a] -> [a] -> [a]
++ String
"Support for loading specific modules is planned but not "
String -> String -> String
forall a. [a] -> [a] -> [a]
++ String
"implemented yet. For certain scenarios, `"
String -> String -> String
forall a. [a] -> [a] -> [a]
++ String
pname
String -> String -> String
forall a. [a] -> [a] -> [a]
++ String
" v1-exec -- ghci :l Foo` may be used instead. Note that `v1-exec` will "
String -> String -> String
forall a. [a] -> [a] -> [a]
++ String
"not (re)configure and you will have to specify the location of "
String -> String -> String
forall a. [a] -> [a] -> [a]
++ String
"other modules, if required.\n"
, commandUsage = \String
pname -> String
"Usage: " String -> String -> String
forall a. [a] -> [a] -> [a]
++ String
pname String -> String -> String
forall a. [a] -> [a] -> [a]
++ String
" v1-repl [COMPONENT] [FLAGS]\n"
, commandDefaultFlags = commandDefaultFlags parent
, commandOptions = commandOptions parent
, commandNotes = Just $ \String
pname ->
String
"Examples:\n"
String -> String -> String
forall a. [a] -> [a] -> [a]
++ String
" "
String -> String -> String
forall a. [a] -> [a] -> [a]
++ String
pname
String -> String -> String
forall a. [a] -> [a] -> [a]
++ String
" v1-repl "
String -> String -> String
forall a. [a] -> [a] -> [a]
++ String
" The first component in the package\n"
String -> String -> String
forall a. [a] -> [a] -> [a]
++ String
" "
String -> String -> String
forall a. [a] -> [a] -> [a]
++ String
pname
String -> String -> String
forall a. [a] -> [a] -> [a]
++ String
" v1-repl foo "
String -> String -> String
forall a. [a] -> [a] -> [a]
++ String
" A named component (i.e. lib, exe, test suite)\n"
String -> String -> String
forall a. [a] -> [a] -> [a]
++ String
" "
String -> String -> String
forall a. [a] -> [a] -> [a]
++ String
pname
String -> String -> String
forall a. [a] -> [a] -> [a]
++ String
" v1-repl --ghc-options=\"-lstdc++\""
String -> String -> String
forall a. [a] -> [a] -> [a]
++ String
" Specifying flags for interpreter\n"
}
where
parent :: CommandUI ReplFlags
parent = ProgramDb -> CommandUI ReplFlags
Cabal.replCommand ProgramDb
defaultProgramDb
filterReplFlags :: ReplFlags -> Version -> ReplFlags
filterReplFlags :: ReplFlags -> Version -> ReplFlags
filterReplFlags ReplFlags
flags Version
cabalLibVersion =
ReplFlags
flags
{ replCommonFlags =
(filterCommonFlags (replCommonFlags flags) cabalLibVersion)
{
setupKeepTempFiles = setupKeepTempFiles (replCommonFlags flags)
}
}
testCommand :: CommandUI (BuildFlags, TestFlags)
testCommand :: CommandUI (BuildFlags, TestFlags)
testCommand =
CommandUI TestFlags
parent
{ commandName = "test"
, commandDescription = Just $ \String
pname ->
String -> String
wrapText (String -> String) -> String -> String
forall a b. (a -> b) -> a -> b
$
String
"If necessary (re)configures with `--enable-tests` flag and builds"
String -> String -> String
forall a. [a] -> [a] -> [a]
++ String
" the test suite.\n"
String -> String -> String
forall a. [a] -> [a] -> [a]
++ String
"\n"
String -> String -> String
forall a. [a] -> [a] -> [a]
++ String
"Remember that the tests' dependencies must be installed if there"
String -> String -> String
forall a. [a] -> [a] -> [a]
++ String
" are additional ones; e.g. with `"
String -> String -> String
forall a. [a] -> [a] -> [a]
++ String
pname
String -> String -> String
forall a. [a] -> [a] -> [a]
++ String
" v1-install --only-dependencies --enable-tests`.\n"
String -> String -> String
forall a. [a] -> [a] -> [a]
++ String
"\n"
String -> String -> String
forall a. [a] -> [a] -> [a]
++ String
"By defining UserHooks in a custom Setup.hs, the package can"
String -> String -> String
forall a. [a] -> [a] -> [a]
++ String
" define actions to be executed before and after running tests.\n"
, commandUsage =
usageAlternatives
"v1-test"
["[FLAGS]", "TESTCOMPONENTS [FLAGS]"]
, commandDefaultFlags = (Cabal.defaultBuildFlags, commandDefaultFlags parent)
, commandOptions =
\ShowOrParseArgs
showOrParseArgs ->
((BuildFlags, TestFlags) -> BuildFlags)
-> (BuildFlags
-> (BuildFlags, TestFlags) -> (BuildFlags, TestFlags))
-> [OptionField BuildFlags]
-> [OptionField (BuildFlags, TestFlags)]
forall b a.
(b -> a) -> (a -> b -> b) -> [OptionField a] -> [OptionField b]
liftOptions
(BuildFlags, TestFlags) -> BuildFlags
forall a b. (a, b) -> a
get1
BuildFlags -> (BuildFlags, TestFlags) -> (BuildFlags, TestFlags)
forall {a} {a} {b}. a -> (a, b) -> (a, b)
set1
(ProgramDb -> ShowOrParseArgs -> [OptionField BuildFlags]
Cabal.buildOptions ProgramDb
progDb ShowOrParseArgs
showOrParseArgs)
[OptionField (BuildFlags, TestFlags)]
-> [OptionField (BuildFlags, TestFlags)]
-> [OptionField (BuildFlags, TestFlags)]
forall a. [a] -> [a] -> [a]
++ ((BuildFlags, TestFlags) -> TestFlags)
-> (TestFlags
-> (BuildFlags, TestFlags) -> (BuildFlags, TestFlags))
-> [OptionField TestFlags]
-> [OptionField (BuildFlags, TestFlags)]
forall b a.
(b -> a) -> (a -> b -> b) -> [OptionField a] -> [OptionField b]
liftOptions
(BuildFlags, TestFlags) -> TestFlags
forall a b. (a, b) -> b
get2
TestFlags -> (BuildFlags, TestFlags) -> (BuildFlags, TestFlags)
forall {b} {a} {b}. b -> (a, b) -> (a, b)
set2
(CommandUI TestFlags -> ShowOrParseArgs -> [OptionField TestFlags]
forall flags.
CommandUI flags -> ShowOrParseArgs -> [OptionField flags]
commandOptions CommandUI TestFlags
parent ShowOrParseArgs
showOrParseArgs)
}
where
get1 :: (a, b) -> a
get1 (a
a, b
_) = a
a
set1 :: a -> (a, b) -> (a, b)
set1 a
a (a
_, b
b) = (a
a, b
b)
get2 :: (a, b) -> b
get2 (a
_, b
b) = b
b
set2 :: b -> (a, b) -> (a, b)
set2 b
b (a
a, b
_) = (a
a, b
b)
parent :: CommandUI TestFlags
parent = CommandUI TestFlags
Cabal.testCommand
progDb :: ProgramDb
progDb = ProgramDb
defaultProgramDb
benchmarkCommand :: CommandUI (BuildFlags, BenchmarkFlags)
benchmarkCommand :: CommandUI (BuildFlags, BenchmarkFlags)
benchmarkCommand =
CommandUI BenchmarkFlags
parent
{ commandName = "bench"
, commandUsage =
usageAlternatives
"v1-bench"
["[FLAGS]", "BENCHCOMPONENTS [FLAGS]"]
, commandDescription = Just $ \String
pname ->
String -> String
wrapText (String -> String) -> String -> String
forall a b. (a -> b) -> a -> b
$
String
"If necessary (re)configures with `--enable-benchmarks` flag and"
String -> String -> String
forall a. [a] -> [a] -> [a]
++ String
" builds the benchmarks.\n"
String -> String -> String
forall a. [a] -> [a] -> [a]
++ String
"\n"
String -> String -> String
forall a. [a] -> [a] -> [a]
++ String
"Remember that the benchmarks' dependencies must be installed if"
String -> String -> String
forall a. [a] -> [a] -> [a]
++ String
" there are additional ones; e.g. with `"
String -> String -> String
forall a. [a] -> [a] -> [a]
++ String
pname
String -> String -> String
forall a. [a] -> [a] -> [a]
++ String
" v1-install --only-dependencies --enable-benchmarks`.\n"
String -> String -> String
forall a. [a] -> [a] -> [a]
++ String
"\n"
String -> String -> String
forall a. [a] -> [a] -> [a]
++ String
"By defining UserHooks in a custom Setup.hs, the package can"
String -> String -> String
forall a. [a] -> [a] -> [a]
++ String
" define actions to be executed before and after running"
String -> String -> String
forall a. [a] -> [a] -> [a]
++ String
" benchmarks.\n"
, commandDefaultFlags = (Cabal.defaultBuildFlags, commandDefaultFlags parent)
, commandOptions =
\ShowOrParseArgs
showOrParseArgs ->
((BuildFlags, BenchmarkFlags) -> BuildFlags)
-> (BuildFlags
-> (BuildFlags, BenchmarkFlags) -> (BuildFlags, BenchmarkFlags))
-> [OptionField BuildFlags]
-> [OptionField (BuildFlags, BenchmarkFlags)]
forall b a.
(b -> a) -> (a -> b -> b) -> [OptionField a] -> [OptionField b]
liftOptions
(BuildFlags, BenchmarkFlags) -> BuildFlags
forall a b. (a, b) -> a
get1
BuildFlags
-> (BuildFlags, BenchmarkFlags) -> (BuildFlags, BenchmarkFlags)
forall {a} {a} {b}. a -> (a, b) -> (a, b)
set1
(ProgramDb -> ShowOrParseArgs -> [OptionField BuildFlags]
Cabal.buildOptions ProgramDb
progDb ShowOrParseArgs
showOrParseArgs)
[OptionField (BuildFlags, BenchmarkFlags)]
-> [OptionField (BuildFlags, BenchmarkFlags)]
-> [OptionField (BuildFlags, BenchmarkFlags)]
forall a. [a] -> [a] -> [a]
++ ((BuildFlags, BenchmarkFlags) -> BenchmarkFlags)
-> (BenchmarkFlags
-> (BuildFlags, BenchmarkFlags) -> (BuildFlags, BenchmarkFlags))
-> [OptionField BenchmarkFlags]
-> [OptionField (BuildFlags, BenchmarkFlags)]
forall b a.
(b -> a) -> (a -> b -> b) -> [OptionField a] -> [OptionField b]
liftOptions
(BuildFlags, BenchmarkFlags) -> BenchmarkFlags
forall a b. (a, b) -> b
get2
BenchmarkFlags
-> (BuildFlags, BenchmarkFlags) -> (BuildFlags, BenchmarkFlags)
forall {b} {a} {b}. b -> (a, b) -> (a, b)
set2
(CommandUI BenchmarkFlags
-> ShowOrParseArgs -> [OptionField BenchmarkFlags]
forall flags.
CommandUI flags -> ShowOrParseArgs -> [OptionField flags]
commandOptions CommandUI BenchmarkFlags
parent ShowOrParseArgs
showOrParseArgs)
}
where
get1 :: (a, b) -> a
get1 (a
a, b
_) = a
a
set1 :: a -> (a, b) -> (a, b)
set1 a
a (a
_, b
b) = (a
a, b
b)
get2 :: (a, b) -> b
get2 (a
_, b
b) = b
b
set2 :: b -> (a, b) -> (a, b)
set2 b
b (a
a, b
_) = (a
a, b
b)
parent :: CommandUI BenchmarkFlags
parent = CommandUI BenchmarkFlags
Cabal.benchmarkCommand
progDb :: ProgramDb
progDb = ProgramDb
defaultProgramDb
filterBenchmarkFlags :: BenchmarkFlags -> Version -> BenchmarkFlags
filterBenchmarkFlags :: BenchmarkFlags -> Version -> BenchmarkFlags
filterBenchmarkFlags BenchmarkFlags
flags Version
cabalLibVersion =
BenchmarkFlags
flags
{ benchmarkCommonFlags =
filterCommonFlags (benchmarkCommonFlags flags) cabalLibVersion
}
data FetchFlags = FetchFlags
{
FetchFlags -> Last Bool
fetchDeps :: Flag Bool
, FetchFlags -> Last Bool
fetchDryRun :: Flag Bool
, FetchFlags -> Flag PreSolver
fetchSolver :: Flag PreSolver
, FetchFlags -> Flag Int
fetchMaxBackjumps :: Flag Int
, FetchFlags -> Flag ReorderGoals
fetchReorderGoals :: Flag ReorderGoals
, FetchFlags -> Flag CountConflicts
fetchCountConflicts :: Flag CountConflicts
, FetchFlags -> Flag FineGrainedConflicts
fetchFineGrainedConflicts :: Flag FineGrainedConflicts
, FetchFlags -> Flag MinimizeConflictSet
fetchMinimizeConflictSet :: Flag MinimizeConflictSet
, FetchFlags -> Flag IndependentGoals
fetchIndependentGoals :: Flag IndependentGoals
, FetchFlags -> Flag PreferOldest
fetchPreferOldest :: Flag PreferOldest
, FetchFlags -> Flag ShadowPkgs
fetchShadowPkgs :: Flag ShadowPkgs
, FetchFlags -> Flag StrongFlags
fetchStrongFlags :: Flag StrongFlags
, FetchFlags -> Flag AllowBootLibInstalls
fetchAllowBootLibInstalls :: Flag AllowBootLibInstalls
, FetchFlags -> Flag OnlyConstrained
fetchOnlyConstrained :: Flag OnlyConstrained
, FetchFlags -> Last Bool
fetchTests :: Flag Bool
, FetchFlags -> Last Bool
fetchBenchmarks :: Flag Bool
, FetchFlags -> Last Verbosity
fetchVerbosity :: Flag Verbosity
}
defaultFetchFlags :: FetchFlags
defaultFetchFlags :: FetchFlags
defaultFetchFlags =
FetchFlags
{
fetchDeps :: Last Bool
fetchDeps = Bool -> Last Bool
forall a. a -> Last a
toFlag Bool
True
, fetchDryRun :: Last Bool
fetchDryRun = Bool -> Last Bool
forall a. a -> Last a
toFlag Bool
False
, fetchSolver :: Flag PreSolver
fetchSolver = PreSolver -> Flag PreSolver
forall a. a -> Last a
Flag PreSolver
defaultSolver
, fetchMaxBackjumps :: Flag Int
fetchMaxBackjumps = Int -> Flag Int
forall a. a -> Last a
Flag Int
defaultMaxBackjumps
, fetchReorderGoals :: Flag ReorderGoals
fetchReorderGoals = ReorderGoals -> Flag ReorderGoals
forall a. a -> Last a
Flag (Bool -> ReorderGoals
ReorderGoals Bool
False)
, fetchCountConflicts :: Flag CountConflicts
fetchCountConflicts = CountConflicts -> Flag CountConflicts
forall a. a -> Last a
Flag (Bool -> CountConflicts
CountConflicts Bool
True)
, fetchFineGrainedConflicts :: Flag FineGrainedConflicts
fetchFineGrainedConflicts = FineGrainedConflicts -> Flag FineGrainedConflicts
forall a. a -> Last a
Flag (Bool -> FineGrainedConflicts
FineGrainedConflicts Bool
True)
, fetchMinimizeConflictSet :: Flag MinimizeConflictSet
fetchMinimizeConflictSet = MinimizeConflictSet -> Flag MinimizeConflictSet
forall a. a -> Last a
Flag (Bool -> MinimizeConflictSet
MinimizeConflictSet Bool
False)
, fetchIndependentGoals :: Flag IndependentGoals
fetchIndependentGoals = IndependentGoals -> Flag IndependentGoals
forall a. a -> Last a
Flag (Bool -> IndependentGoals
IndependentGoals Bool
False)
, fetchPreferOldest :: Flag PreferOldest
fetchPreferOldest = PreferOldest -> Flag PreferOldest
forall a. a -> Last a
Flag (Bool -> PreferOldest
PreferOldest Bool
False)
, fetchShadowPkgs :: Flag ShadowPkgs
fetchShadowPkgs = ShadowPkgs -> Flag ShadowPkgs
forall a. a -> Last a
Flag (Bool -> ShadowPkgs
ShadowPkgs Bool
False)
, fetchStrongFlags :: Flag StrongFlags
fetchStrongFlags = StrongFlags -> Flag StrongFlags
forall a. a -> Last a
Flag (Bool -> StrongFlags
StrongFlags Bool
False)
, fetchAllowBootLibInstalls :: Flag AllowBootLibInstalls
fetchAllowBootLibInstalls = AllowBootLibInstalls -> Flag AllowBootLibInstalls
forall a. a -> Last a
Flag (Bool -> AllowBootLibInstalls
AllowBootLibInstalls Bool
False)
, fetchOnlyConstrained :: Flag OnlyConstrained
fetchOnlyConstrained = OnlyConstrained -> Flag OnlyConstrained
forall a. a -> Last a
Flag OnlyConstrained
OnlyConstrainedNone
, fetchTests :: Last Bool
fetchTests = Bool -> Last Bool
forall a. a -> Last a
toFlag Bool
False
, fetchBenchmarks :: Last Bool
fetchBenchmarks = Bool -> Last Bool
forall a. a -> Last a
toFlag Bool
False
, fetchVerbosity :: Last Verbosity
fetchVerbosity = Verbosity -> Last Verbosity
forall a. a -> Last a
toFlag Verbosity
normal
}
fetchCommand :: CommandUI FetchFlags
fetchCommand :: CommandUI FetchFlags
fetchCommand =
CommandUI
{ commandName :: String
commandName = String
"fetch"
, commandSynopsis :: String
commandSynopsis = String
"Downloads packages for later installation."
, commandUsage :: String -> String
commandUsage =
String -> [String] -> String -> String
usageAlternatives
String
"fetch"
[ String
"[FLAGS] PACKAGES"
]
, commandDescription :: Maybe (String -> String)
commandDescription = (String -> String) -> Maybe (String -> String)
forall a. a -> Maybe a
Just ((String -> String) -> Maybe (String -> String))
-> (String -> String) -> Maybe (String -> String)
forall a b. (a -> b) -> a -> b
$ \String
_ ->
String
"Note that it currently is not possible to fetch the dependencies for a\n"
String -> String -> String
forall a. [a] -> [a] -> [a]
++ String
"package in the current directory.\n"
, commandNotes :: Maybe (String -> String)
commandNotes = Maybe (String -> String)
forall a. Maybe a
Nothing
, commandDefaultFlags :: FetchFlags
commandDefaultFlags = FetchFlags
defaultFetchFlags
, commandOptions :: ShowOrParseArgs -> [OptionField FetchFlags]
commandOptions = \ShowOrParseArgs
showOrParseArgs ->
[ (FetchFlags -> Last Verbosity)
-> (Last Verbosity -> FetchFlags -> FetchFlags)
-> OptionField FetchFlags
forall flags.
(flags -> Last Verbosity)
-> (Last Verbosity -> flags -> flags) -> OptionField flags
optionVerbosity FetchFlags -> Last Verbosity
fetchVerbosity (\Last Verbosity
v FetchFlags
flags -> FetchFlags
flags{fetchVerbosity = v})
,
String
-> [String]
-> String
-> (FetchFlags -> Last Bool)
-> (Last Bool -> FetchFlags -> FetchFlags)
-> MkOptDescr
(FetchFlags -> Last Bool)
(Last Bool -> FetchFlags -> FetchFlags)
FetchFlags
-> OptionField FetchFlags
forall get set a.
String
-> [String]
-> String
-> get
-> set
-> MkOptDescr get set a
-> OptionField a
option
[]
[String
"dependencies", String
"deps"]
String
"Resolve and fetch dependencies (default)"
FetchFlags -> Last Bool
fetchDeps
(\Last Bool
v FetchFlags
flags -> FetchFlags
flags{fetchDeps = v})
MkOptDescr
(FetchFlags -> Last Bool)
(Last Bool -> FetchFlags -> FetchFlags)
FetchFlags
forall a. MkOptDescr (a -> Last Bool) (Last Bool -> a -> a) a
trueArg
, String
-> [String]
-> String
-> (FetchFlags -> Last Bool)
-> (Last Bool -> FetchFlags -> FetchFlags)
-> MkOptDescr
(FetchFlags -> Last Bool)
(Last Bool -> FetchFlags -> FetchFlags)
FetchFlags
-> OptionField FetchFlags
forall get set a.
String
-> [String]
-> String
-> get
-> set
-> MkOptDescr get set a
-> OptionField a
option
[]
[String
"no-dependencies", String
"no-deps"]
String
"Ignore dependencies"
FetchFlags -> Last Bool
fetchDeps
(\Last Bool
v FetchFlags
flags -> FetchFlags
flags{fetchDeps = v})
MkOptDescr
(FetchFlags -> Last Bool)
(Last Bool -> FetchFlags -> FetchFlags)
FetchFlags
forall a. MkOptDescr (a -> Last Bool) (Last Bool -> a -> a) a
falseArg
, String
-> [String]
-> String
-> (FetchFlags -> Last Bool)
-> (Last Bool -> FetchFlags -> FetchFlags)
-> MkOptDescr
(FetchFlags -> Last Bool)
(Last Bool -> FetchFlags -> FetchFlags)
FetchFlags
-> OptionField FetchFlags
forall get set a.
String
-> [String]
-> String
-> get
-> set
-> MkOptDescr get set a
-> OptionField a
option
[]
[String
"dry-run"]
String
"Do not install anything, only print what would be installed."
FetchFlags -> Last Bool
fetchDryRun
(\Last Bool
v FetchFlags
flags -> FetchFlags
flags{fetchDryRun = v})
MkOptDescr
(FetchFlags -> Last Bool)
(Last Bool -> FetchFlags -> FetchFlags)
FetchFlags
forall a. MkOptDescr (a -> Last Bool) (Last Bool -> a -> a) a
trueArg
, String
-> [String]
-> String
-> (FetchFlags -> Last Bool)
-> (Last Bool -> FetchFlags -> FetchFlags)
-> MkOptDescr
(FetchFlags -> Last Bool)
(Last Bool -> FetchFlags -> FetchFlags)
FetchFlags
-> OptionField FetchFlags
forall get set a.
String
-> [String]
-> String
-> get
-> set
-> MkOptDescr get set a
-> OptionField a
option
String
""
[String
"tests"]
String
"dependency checking and compilation for test suites listed in the package description file."
FetchFlags -> Last Bool
fetchTests
(\Last Bool
v FetchFlags
flags -> FetchFlags
flags{fetchTests = v})
(String
-> String
-> MkOptDescr
(FetchFlags -> Last Bool)
(Last Bool -> FetchFlags -> FetchFlags)
FetchFlags
forall a.
String
-> String -> MkOptDescr (a -> Last Bool) (Last Bool -> a -> a) a
boolOpt [] [])
, String
-> [String]
-> String
-> (FetchFlags -> Last Bool)
-> (Last Bool -> FetchFlags -> FetchFlags)
-> MkOptDescr
(FetchFlags -> Last Bool)
(Last Bool -> FetchFlags -> FetchFlags)
FetchFlags
-> OptionField FetchFlags
forall get set a.
String
-> [String]
-> String
-> get
-> set
-> MkOptDescr get set a
-> OptionField a
option
String
""
[String
"benchmarks"]
String
"dependency checking and compilation for benchmarks listed in the package description file."
FetchFlags -> Last Bool
fetchBenchmarks
(\Last Bool
v FetchFlags
flags -> FetchFlags
flags{fetchBenchmarks = v})
(String
-> String
-> MkOptDescr
(FetchFlags -> Last Bool)
(Last Bool -> FetchFlags -> FetchFlags)
FetchFlags
forall a.
String
-> String -> MkOptDescr (a -> Last Bool) (Last Bool -> a -> a) a
boolOpt [] [])
]
[OptionField FetchFlags]
-> [OptionField FetchFlags] -> [OptionField FetchFlags]
forall a. [a] -> [a] -> [a]
++ (FetchFlags -> Flag PreSolver)
-> (Flag PreSolver -> FetchFlags -> FetchFlags)
-> OptionField FetchFlags
forall flags.
(flags -> Flag PreSolver)
-> (Flag PreSolver -> flags -> flags) -> OptionField flags
optionSolver FetchFlags -> Flag PreSolver
fetchSolver (\Flag PreSolver
v FetchFlags
flags -> FetchFlags
flags{fetchSolver = v})
OptionField FetchFlags
-> [OptionField FetchFlags] -> [OptionField FetchFlags]
forall a. a -> [a] -> [a]
: ShowOrParseArgs
-> (FetchFlags -> Flag Int)
-> (Flag Int -> FetchFlags -> FetchFlags)
-> (FetchFlags -> Flag ReorderGoals)
-> (Flag ReorderGoals -> FetchFlags -> FetchFlags)
-> (FetchFlags -> Flag CountConflicts)
-> (Flag CountConflicts -> FetchFlags -> FetchFlags)
-> (FetchFlags -> Flag FineGrainedConflicts)
-> (Flag FineGrainedConflicts -> FetchFlags -> FetchFlags)
-> (FetchFlags -> Flag MinimizeConflictSet)
-> (Flag MinimizeConflictSet -> FetchFlags -> FetchFlags)
-> (FetchFlags -> Flag IndependentGoals)
-> (Flag IndependentGoals -> FetchFlags -> FetchFlags)
-> (FetchFlags -> Flag PreferOldest)
-> (Flag PreferOldest -> FetchFlags -> FetchFlags)
-> (FetchFlags -> Flag ShadowPkgs)
-> (Flag ShadowPkgs -> FetchFlags -> FetchFlags)
-> (FetchFlags -> Flag StrongFlags)
-> (Flag StrongFlags -> FetchFlags -> FetchFlags)
-> (FetchFlags -> Flag AllowBootLibInstalls)
-> (Flag AllowBootLibInstalls -> FetchFlags -> FetchFlags)
-> (FetchFlags -> Flag OnlyConstrained)
-> (Flag OnlyConstrained -> FetchFlags -> FetchFlags)
-> [OptionField FetchFlags]
forall flags.
ShowOrParseArgs
-> (flags -> Flag Int)
-> (Flag Int -> flags -> flags)
-> (flags -> Flag ReorderGoals)
-> (Flag ReorderGoals -> flags -> flags)
-> (flags -> Flag CountConflicts)
-> (Flag CountConflicts -> flags -> flags)
-> (flags -> Flag FineGrainedConflicts)
-> (Flag FineGrainedConflicts -> flags -> flags)
-> (flags -> Flag MinimizeConflictSet)
-> (Flag MinimizeConflictSet -> flags -> flags)
-> (flags -> Flag IndependentGoals)
-> (Flag IndependentGoals -> flags -> flags)
-> (flags -> Flag PreferOldest)
-> (Flag PreferOldest -> flags -> flags)
-> (flags -> Flag ShadowPkgs)
-> (Flag ShadowPkgs -> flags -> flags)
-> (flags -> Flag StrongFlags)
-> (Flag StrongFlags -> flags -> flags)
-> (flags -> Flag AllowBootLibInstalls)
-> (Flag AllowBootLibInstalls -> flags -> flags)
-> (flags -> Flag OnlyConstrained)
-> (Flag OnlyConstrained -> flags -> flags)
-> [OptionField flags]
optionSolverFlags
ShowOrParseArgs
showOrParseArgs
FetchFlags -> Flag Int
fetchMaxBackjumps
(\Flag Int
v FetchFlags
flags -> FetchFlags
flags{fetchMaxBackjumps = v})
FetchFlags -> Flag ReorderGoals
fetchReorderGoals
(\Flag ReorderGoals
v FetchFlags
flags -> FetchFlags
flags{fetchReorderGoals = v})
FetchFlags -> Flag CountConflicts
fetchCountConflicts
(\Flag CountConflicts
v FetchFlags
flags -> FetchFlags
flags{fetchCountConflicts = v})
FetchFlags -> Flag FineGrainedConflicts
fetchFineGrainedConflicts
(\Flag FineGrainedConflicts
v FetchFlags
flags -> FetchFlags
flags{fetchFineGrainedConflicts = v})
FetchFlags -> Flag MinimizeConflictSet
fetchMinimizeConflictSet
(\Flag MinimizeConflictSet
v FetchFlags
flags -> FetchFlags
flags{fetchMinimizeConflictSet = v})
FetchFlags -> Flag IndependentGoals
fetchIndependentGoals
(\Flag IndependentGoals
v FetchFlags
flags -> FetchFlags
flags{fetchIndependentGoals = v})
FetchFlags -> Flag PreferOldest
fetchPreferOldest
(\Flag PreferOldest
v FetchFlags
flags -> FetchFlags
flags{fetchPreferOldest = v})
FetchFlags -> Flag ShadowPkgs
fetchShadowPkgs
(\Flag ShadowPkgs
v FetchFlags
flags -> FetchFlags
flags{fetchShadowPkgs = v})
FetchFlags -> Flag StrongFlags
fetchStrongFlags
(\Flag StrongFlags
v FetchFlags
flags -> FetchFlags
flags{fetchStrongFlags = v})
FetchFlags -> Flag AllowBootLibInstalls
fetchAllowBootLibInstalls
(\Flag AllowBootLibInstalls
v FetchFlags
flags -> FetchFlags
flags{fetchAllowBootLibInstalls = v})
FetchFlags -> Flag OnlyConstrained
fetchOnlyConstrained
(\Flag OnlyConstrained
v FetchFlags
flags -> FetchFlags
flags{fetchOnlyConstrained = v})
}
data FreezeFlags = FreezeFlags
{ FreezeFlags -> Last Bool
freezeDryRun :: Flag Bool
, FreezeFlags -> Last Bool
freezeTests :: Flag Bool
, FreezeFlags -> Last Bool
freezeBenchmarks :: Flag Bool
, FreezeFlags -> Flag PreSolver
freezeSolver :: Flag PreSolver
, FreezeFlags -> Flag Int
freezeMaxBackjumps :: Flag Int
, FreezeFlags -> Flag ReorderGoals
freezeReorderGoals :: Flag ReorderGoals
, FreezeFlags -> Flag CountConflicts
freezeCountConflicts :: Flag CountConflicts
, FreezeFlags -> Flag FineGrainedConflicts
freezeFineGrainedConflicts :: Flag FineGrainedConflicts
, FreezeFlags -> Flag MinimizeConflictSet
freezeMinimizeConflictSet :: Flag MinimizeConflictSet
, FreezeFlags -> Flag IndependentGoals
freezeIndependentGoals :: Flag IndependentGoals
, FreezeFlags -> Flag PreferOldest
freezePreferOldest :: Flag PreferOldest
, FreezeFlags -> Flag ShadowPkgs
freezeShadowPkgs :: Flag ShadowPkgs
, FreezeFlags -> Flag StrongFlags
freezeStrongFlags :: Flag StrongFlags
, FreezeFlags -> Flag AllowBootLibInstalls
freezeAllowBootLibInstalls :: Flag AllowBootLibInstalls
, FreezeFlags -> Flag OnlyConstrained
freezeOnlyConstrained :: Flag OnlyConstrained
, FreezeFlags -> Last Verbosity
freezeVerbosity :: Flag Verbosity
}
defaultFreezeFlags :: FreezeFlags
defaultFreezeFlags :: FreezeFlags
defaultFreezeFlags =
FreezeFlags
{ freezeDryRun :: Last Bool
freezeDryRun = Bool -> Last Bool
forall a. a -> Last a
toFlag Bool
False
, freezeTests :: Last Bool
freezeTests = Bool -> Last Bool
forall a. a -> Last a
toFlag Bool
False
, freezeBenchmarks :: Last Bool
freezeBenchmarks = Bool -> Last Bool
forall a. a -> Last a
toFlag Bool
False
, freezeSolver :: Flag PreSolver
freezeSolver = PreSolver -> Flag PreSolver
forall a. a -> Last a
Flag PreSolver
defaultSolver
, freezeMaxBackjumps :: Flag Int
freezeMaxBackjumps = Int -> Flag Int
forall a. a -> Last a
Flag Int
defaultMaxBackjumps
, freezeReorderGoals :: Flag ReorderGoals
freezeReorderGoals = ReorderGoals -> Flag ReorderGoals
forall a. a -> Last a
Flag (Bool -> ReorderGoals
ReorderGoals Bool
False)
, freezeCountConflicts :: Flag CountConflicts
freezeCountConflicts = CountConflicts -> Flag CountConflicts
forall a. a -> Last a
Flag (Bool -> CountConflicts
CountConflicts Bool
True)
, freezeFineGrainedConflicts :: Flag FineGrainedConflicts
freezeFineGrainedConflicts = FineGrainedConflicts -> Flag FineGrainedConflicts
forall a. a -> Last a
Flag (Bool -> FineGrainedConflicts
FineGrainedConflicts Bool
True)
, freezeMinimizeConflictSet :: Flag MinimizeConflictSet
freezeMinimizeConflictSet = MinimizeConflictSet -> Flag MinimizeConflictSet
forall a. a -> Last a
Flag (Bool -> MinimizeConflictSet
MinimizeConflictSet Bool
False)
, freezeIndependentGoals :: Flag IndependentGoals
freezeIndependentGoals = IndependentGoals -> Flag IndependentGoals
forall a. a -> Last a
Flag (Bool -> IndependentGoals
IndependentGoals Bool
False)
, freezePreferOldest :: Flag PreferOldest
freezePreferOldest = PreferOldest -> Flag PreferOldest
forall a. a -> Last a
Flag (Bool -> PreferOldest
PreferOldest Bool
False)
, freezeShadowPkgs :: Flag ShadowPkgs
freezeShadowPkgs = ShadowPkgs -> Flag ShadowPkgs
forall a. a -> Last a
Flag (Bool -> ShadowPkgs
ShadowPkgs Bool
False)
, freezeStrongFlags :: Flag StrongFlags
freezeStrongFlags = StrongFlags -> Flag StrongFlags
forall a. a -> Last a
Flag (Bool -> StrongFlags
StrongFlags Bool
False)
, freezeAllowBootLibInstalls :: Flag AllowBootLibInstalls
freezeAllowBootLibInstalls = AllowBootLibInstalls -> Flag AllowBootLibInstalls
forall a. a -> Last a
Flag (Bool -> AllowBootLibInstalls
AllowBootLibInstalls Bool
False)
, freezeOnlyConstrained :: Flag OnlyConstrained
freezeOnlyConstrained = OnlyConstrained -> Flag OnlyConstrained
forall a. a -> Last a
Flag OnlyConstrained
OnlyConstrainedNone
, freezeVerbosity :: Last Verbosity
freezeVerbosity = Verbosity -> Last Verbosity
forall a. a -> Last a
toFlag Verbosity
normal
}
freezeCommand :: CommandUI FreezeFlags
freezeCommand :: CommandUI FreezeFlags
freezeCommand =
CommandUI
{ commandName :: String
commandName = String
"freeze"
, commandSynopsis :: String
commandSynopsis = String
"Freeze dependencies."
, commandDescription :: Maybe (String -> String)
commandDescription = (String -> String) -> Maybe (String -> String)
forall a. a -> Maybe a
Just ((String -> String) -> Maybe (String -> String))
-> (String -> String) -> Maybe (String -> String)
forall a b. (a -> b) -> a -> b
$ \String
_ ->
String -> String
wrapText (String -> String) -> String -> String
forall a b. (a -> b) -> a -> b
$
String
"Calculates a valid set of dependencies and their exact versions. "
String -> String -> String
forall a. [a] -> [a] -> [a]
++ String
"If successful, saves the result to the file `cabal.config`.\n"
String -> String -> String
forall a. [a] -> [a] -> [a]
++ String
"\n"
String -> String -> String
forall a. [a] -> [a] -> [a]
++ String
"The package versions specified in `cabal.config` will be used for "
String -> String -> String
forall a. [a] -> [a] -> [a]
++ String
"any future installs.\n"
String -> String -> String
forall a. [a] -> [a] -> [a]
++ String
"\n"
String -> String -> String
forall a. [a] -> [a] -> [a]
++ String
"An existing `cabal.config` is ignored and overwritten.\n"
, commandNotes :: Maybe (String -> String)
commandNotes = Maybe (String -> String)
forall a. Maybe a
Nothing
, commandUsage :: String -> String
commandUsage = String -> String -> String
usageFlags String
"freeze"
, commandDefaultFlags :: FreezeFlags
commandDefaultFlags = FreezeFlags
defaultFreezeFlags
, commandOptions :: ShowOrParseArgs -> [OptionField FreezeFlags]
commandOptions = \ShowOrParseArgs
showOrParseArgs ->
[ (FreezeFlags -> Last Verbosity)
-> (Last Verbosity -> FreezeFlags -> FreezeFlags)
-> OptionField FreezeFlags
forall flags.
(flags -> Last Verbosity)
-> (Last Verbosity -> flags -> flags) -> OptionField flags
optionVerbosity
FreezeFlags -> Last Verbosity
freezeVerbosity
(\Last Verbosity
v FreezeFlags
flags -> FreezeFlags
flags{freezeVerbosity = v})
, String
-> [String]
-> String
-> (FreezeFlags -> Last Bool)
-> (Last Bool -> FreezeFlags -> FreezeFlags)
-> MkOptDescr
(FreezeFlags -> Last Bool)
(Last Bool -> FreezeFlags -> FreezeFlags)
FreezeFlags
-> OptionField FreezeFlags
forall get set a.
String
-> [String]
-> String
-> get
-> set
-> MkOptDescr get set a
-> OptionField a
option
[]
[String
"dry-run"]
String
"Do not freeze anything, only print what would be frozen"
FreezeFlags -> Last Bool
freezeDryRun
(\Last Bool
v FreezeFlags
flags -> FreezeFlags
flags{freezeDryRun = v})
MkOptDescr
(FreezeFlags -> Last Bool)
(Last Bool -> FreezeFlags -> FreezeFlags)
FreezeFlags
forall a. MkOptDescr (a -> Last Bool) (Last Bool -> a -> a) a
trueArg
, String
-> [String]
-> String
-> (FreezeFlags -> Last Bool)
-> (Last Bool -> FreezeFlags -> FreezeFlags)
-> MkOptDescr
(FreezeFlags -> Last Bool)
(Last Bool -> FreezeFlags -> FreezeFlags)
FreezeFlags
-> OptionField FreezeFlags
forall get set a.
String
-> [String]
-> String
-> get
-> set
-> MkOptDescr get set a
-> OptionField a
option
[]
[String
"tests"]
( String
"freezing of the dependencies of any tests suites "
String -> String -> String
forall a. [a] -> [a] -> [a]
++ String
"in the package description file."
)
FreezeFlags -> Last Bool
freezeTests
(\Last Bool
v FreezeFlags
flags -> FreezeFlags
flags{freezeTests = v})
(String
-> String
-> MkOptDescr
(FreezeFlags -> Last Bool)
(Last Bool -> FreezeFlags -> FreezeFlags)
FreezeFlags
forall a.
String
-> String -> MkOptDescr (a -> Last Bool) (Last Bool -> a -> a) a
boolOpt [] [])
, String
-> [String]
-> String
-> (FreezeFlags -> Last Bool)
-> (Last Bool -> FreezeFlags -> FreezeFlags)
-> MkOptDescr
(FreezeFlags -> Last Bool)
(Last Bool -> FreezeFlags -> FreezeFlags)
FreezeFlags
-> OptionField FreezeFlags
forall get set a.
String
-> [String]
-> String
-> get
-> set
-> MkOptDescr get set a
-> OptionField a
option
[]
[String
"benchmarks"]
( String
"freezing of the dependencies of any benchmarks suites "
String -> String -> String
forall a. [a] -> [a] -> [a]
++ String
"in the package description file."
)
FreezeFlags -> Last Bool
freezeBenchmarks
(\Last Bool
v FreezeFlags
flags -> FreezeFlags
flags{freezeBenchmarks = v})
(String
-> String
-> MkOptDescr
(FreezeFlags -> Last Bool)
(Last Bool -> FreezeFlags -> FreezeFlags)
FreezeFlags
forall a.
String
-> String -> MkOptDescr (a -> Last Bool) (Last Bool -> a -> a) a
boolOpt [] [])
]
[OptionField FreezeFlags]
-> [OptionField FreezeFlags] -> [OptionField FreezeFlags]
forall a. [a] -> [a] -> [a]
++ (FreezeFlags -> Flag PreSolver)
-> (Flag PreSolver -> FreezeFlags -> FreezeFlags)
-> OptionField FreezeFlags
forall flags.
(flags -> Flag PreSolver)
-> (Flag PreSolver -> flags -> flags) -> OptionField flags
optionSolver
FreezeFlags -> Flag PreSolver
freezeSolver
(\Flag PreSolver
v FreezeFlags
flags -> FreezeFlags
flags{freezeSolver = v})
OptionField FreezeFlags
-> [OptionField FreezeFlags] -> [OptionField FreezeFlags]
forall a. a -> [a] -> [a]
: ShowOrParseArgs
-> (FreezeFlags -> Flag Int)
-> (Flag Int -> FreezeFlags -> FreezeFlags)
-> (FreezeFlags -> Flag ReorderGoals)
-> (Flag ReorderGoals -> FreezeFlags -> FreezeFlags)
-> (FreezeFlags -> Flag CountConflicts)
-> (Flag CountConflicts -> FreezeFlags -> FreezeFlags)
-> (FreezeFlags -> Flag FineGrainedConflicts)
-> (Flag FineGrainedConflicts -> FreezeFlags -> FreezeFlags)
-> (FreezeFlags -> Flag MinimizeConflictSet)
-> (Flag MinimizeConflictSet -> FreezeFlags -> FreezeFlags)
-> (FreezeFlags -> Flag IndependentGoals)
-> (Flag IndependentGoals -> FreezeFlags -> FreezeFlags)
-> (FreezeFlags -> Flag PreferOldest)
-> (Flag PreferOldest -> FreezeFlags -> FreezeFlags)
-> (FreezeFlags -> Flag ShadowPkgs)
-> (Flag ShadowPkgs -> FreezeFlags -> FreezeFlags)
-> (FreezeFlags -> Flag StrongFlags)
-> (Flag StrongFlags -> FreezeFlags -> FreezeFlags)
-> (FreezeFlags -> Flag AllowBootLibInstalls)
-> (Flag AllowBootLibInstalls -> FreezeFlags -> FreezeFlags)
-> (FreezeFlags -> Flag OnlyConstrained)
-> (Flag OnlyConstrained -> FreezeFlags -> FreezeFlags)
-> [OptionField FreezeFlags]
forall flags.
ShowOrParseArgs
-> (flags -> Flag Int)
-> (Flag Int -> flags -> flags)
-> (flags -> Flag ReorderGoals)
-> (Flag ReorderGoals -> flags -> flags)
-> (flags -> Flag CountConflicts)
-> (Flag CountConflicts -> flags -> flags)
-> (flags -> Flag FineGrainedConflicts)
-> (Flag FineGrainedConflicts -> flags -> flags)
-> (flags -> Flag MinimizeConflictSet)
-> (Flag MinimizeConflictSet -> flags -> flags)
-> (flags -> Flag IndependentGoals)
-> (Flag IndependentGoals -> flags -> flags)
-> (flags -> Flag PreferOldest)
-> (Flag PreferOldest -> flags -> flags)
-> (flags -> Flag ShadowPkgs)
-> (Flag ShadowPkgs -> flags -> flags)
-> (flags -> Flag StrongFlags)
-> (Flag StrongFlags -> flags -> flags)
-> (flags -> Flag AllowBootLibInstalls)
-> (Flag AllowBootLibInstalls -> flags -> flags)
-> (flags -> Flag OnlyConstrained)
-> (Flag OnlyConstrained -> flags -> flags)
-> [OptionField flags]
optionSolverFlags
ShowOrParseArgs
showOrParseArgs
FreezeFlags -> Flag Int
freezeMaxBackjumps
(\Flag Int
v FreezeFlags
flags -> FreezeFlags
flags{freezeMaxBackjumps = v})
FreezeFlags -> Flag ReorderGoals
freezeReorderGoals
(\Flag ReorderGoals
v FreezeFlags
flags -> FreezeFlags
flags{freezeReorderGoals = v})
FreezeFlags -> Flag CountConflicts
freezeCountConflicts
(\Flag CountConflicts
v FreezeFlags
flags -> FreezeFlags
flags{freezeCountConflicts = v})
FreezeFlags -> Flag FineGrainedConflicts
freezeFineGrainedConflicts
(\Flag FineGrainedConflicts
v FreezeFlags
flags -> FreezeFlags
flags{freezeFineGrainedConflicts = v})
FreezeFlags -> Flag MinimizeConflictSet
freezeMinimizeConflictSet
(\Flag MinimizeConflictSet
v FreezeFlags
flags -> FreezeFlags
flags{freezeMinimizeConflictSet = v})
FreezeFlags -> Flag IndependentGoals
freezeIndependentGoals
(\Flag IndependentGoals
v FreezeFlags
flags -> FreezeFlags
flags{freezeIndependentGoals = v})
FreezeFlags -> Flag PreferOldest
freezePreferOldest
(\Flag PreferOldest
v FreezeFlags
flags -> FreezeFlags
flags{freezePreferOldest = v})
FreezeFlags -> Flag ShadowPkgs
freezeShadowPkgs
(\Flag ShadowPkgs
v FreezeFlags
flags -> FreezeFlags
flags{freezeShadowPkgs = v})
FreezeFlags -> Flag StrongFlags
freezeStrongFlags
(\Flag StrongFlags
v FreezeFlags
flags -> FreezeFlags
flags{freezeStrongFlags = v})
FreezeFlags -> Flag AllowBootLibInstalls
freezeAllowBootLibInstalls
(\Flag AllowBootLibInstalls
v FreezeFlags
flags -> FreezeFlags
flags{freezeAllowBootLibInstalls = v})
FreezeFlags -> Flag OnlyConstrained
freezeOnlyConstrained
(\Flag OnlyConstrained
v FreezeFlags
flags -> FreezeFlags
flags{freezeOnlyConstrained = v})
}
genBoundsCommand :: CommandUI FreezeFlags
genBoundsCommand :: CommandUI FreezeFlags
genBoundsCommand =
CommandUI
{ commandName :: String
commandName = String
"gen-bounds"
, commandSynopsis :: String
commandSynopsis = String
"Generate dependency bounds."
, commandDescription :: Maybe (String -> String)
commandDescription = (String -> String) -> Maybe (String -> String)
forall a. a -> Maybe a
Just ((String -> String) -> Maybe (String -> String))
-> (String -> String) -> Maybe (String -> String)
forall a b. (a -> b) -> a -> b
$ \String
_ ->
String -> String
wrapText (String -> String) -> String -> String
forall a b. (a -> b) -> a -> b
$
String
"Generates bounds for all dependencies that do not currently have them. "
String -> String -> String
forall a. [a] -> [a] -> [a]
++ String
"Generated bounds are printed to stdout. "
String -> String -> String
forall a. [a] -> [a] -> [a]
++ String
"You can then paste them into your .cabal file.\n"
String -> String -> String
forall a. [a] -> [a] -> [a]
++ String
"\n"
, commandNotes :: Maybe (String -> String)
commandNotes = Maybe (String -> String)
forall a. Maybe a
Nothing
, commandUsage :: String -> String
commandUsage = String -> String -> String
usageFlags String
"gen-bounds"
, commandDefaultFlags :: FreezeFlags
commandDefaultFlags = FreezeFlags
defaultFreezeFlags
, commandOptions :: ShowOrParseArgs -> [OptionField FreezeFlags]
commandOptions = \ShowOrParseArgs
_ ->
[ (FreezeFlags -> Last Verbosity)
-> (Last Verbosity -> FreezeFlags -> FreezeFlags)
-> OptionField FreezeFlags
forall flags.
(flags -> Last Verbosity)
-> (Last Verbosity -> flags -> flags) -> OptionField flags
optionVerbosity FreezeFlags -> Last Verbosity
freezeVerbosity (\Last Verbosity
v FreezeFlags
flags -> FreezeFlags
flags{freezeVerbosity = v})
]
}
data CheckFlags = CheckFlags
{ CheckFlags -> Last Verbosity
checkVerbosity :: Flag Verbosity
, CheckFlags -> [String]
checkIgnore :: [CheckExplanationIDString]
}
deriving (Int -> CheckFlags -> String -> String
[CheckFlags] -> String -> String
CheckFlags -> String
(Int -> CheckFlags -> String -> String)
-> (CheckFlags -> String)
-> ([CheckFlags] -> String -> String)
-> Show CheckFlags
forall a.
(Int -> a -> String -> String)
-> (a -> String) -> ([a] -> String -> String) -> Show a
$cshowsPrec :: Int -> CheckFlags -> String -> String
showsPrec :: Int -> CheckFlags -> String -> String
$cshow :: CheckFlags -> String
show :: CheckFlags -> String
$cshowList :: [CheckFlags] -> String -> String
showList :: [CheckFlags] -> String -> String
Show)
defaultCheckFlags :: CheckFlags
defaultCheckFlags :: CheckFlags
defaultCheckFlags =
CheckFlags
{ checkVerbosity :: Last Verbosity
checkVerbosity = Verbosity -> Last Verbosity
forall a. a -> Last a
Flag Verbosity
normal
, checkIgnore :: [String]
checkIgnore = []
}
checkCommand :: CommandUI CheckFlags
checkCommand :: CommandUI CheckFlags
checkCommand =
CommandUI
{ commandName :: String
commandName = String
"check"
, commandSynopsis :: String
commandSynopsis = String
"Check the package for common mistakes."
, commandDescription :: Maybe (String -> String)
commandDescription = (String -> String) -> Maybe (String -> String)
forall a. a -> Maybe a
Just ((String -> String) -> Maybe (String -> String))
-> (String -> String) -> Maybe (String -> String)
forall a b. (a -> b) -> a -> b
$ \String
_ ->
String -> String
wrapText (String -> String) -> String -> String
forall a b. (a -> b) -> a -> b
$
String
"Expects a .cabal package file in the current directory.\n"
String -> String -> String
forall a. [a] -> [a] -> [a]
++ String
"\n"
String -> String -> String
forall a. [a] -> [a] -> [a]
++ String
"Some checks correspond to the requirements to packages on Hackage. "
String -> String -> String
forall a. [a] -> [a] -> [a]
++ String
"If no `Error` is reported, Hackage should accept the "
String -> String -> String
forall a. [a] -> [a] -> [a]
++ String
"package. If errors are present, `check` exits with 1 and Hackage "
String -> String -> String
forall a. [a] -> [a] -> [a]
++ String
"will refuse the package.\n"
, commandNotes :: Maybe (String -> String)
commandNotes = Maybe (String -> String)
forall a. Maybe a
Nothing
, commandUsage :: String -> String
commandUsage = String -> String -> String
usageFlags String
"check"
, commandDefaultFlags :: CheckFlags
commandDefaultFlags = CheckFlags
defaultCheckFlags
, commandOptions :: ShowOrParseArgs -> [OptionField CheckFlags]
commandOptions = ShowOrParseArgs -> [OptionField CheckFlags]
checkOptions'
}
checkOptions' :: ShowOrParseArgs -> [OptionField CheckFlags]
checkOptions' :: ShowOrParseArgs -> [OptionField CheckFlags]
checkOptions' ShowOrParseArgs
_showOrParseArgs =
[ (CheckFlags -> Last Verbosity)
-> (Last Verbosity -> CheckFlags -> CheckFlags)
-> OptionField CheckFlags
forall flags.
(flags -> Last Verbosity)
-> (Last Verbosity -> flags -> flags) -> OptionField flags
optionVerbosity
CheckFlags -> Last Verbosity
checkVerbosity
(\Last Verbosity
v CheckFlags
flags -> CheckFlags
flags{checkVerbosity = v})
, String
-> [String]
-> String
-> (CheckFlags -> [String])
-> ([String] -> CheckFlags -> CheckFlags)
-> MkOptDescr
(CheckFlags -> [String])
([String] -> CheckFlags -> CheckFlags)
CheckFlags
-> OptionField CheckFlags
forall get set a.
String
-> [String]
-> String
-> get
-> set
-> MkOptDescr get set a
-> OptionField a
option
[Char
'i']
[String
"ignore"]
String
"ignore a specific warning (e.g. --ignore=missing-upper-bounds)"
CheckFlags -> [String]
checkIgnore
(\[String]
v CheckFlags
c -> CheckFlags
c{checkIgnore = v ++ checkIgnore c})
(String
-> (String -> [String])
-> ([String] -> [String])
-> MkOptDescr
(CheckFlags -> [String])
([String] -> CheckFlags -> CheckFlags)
CheckFlags
forall b a.
Monoid b =>
String
-> (String -> b)
-> (b -> [String])
-> MkOptDescr (a -> b) (b -> a -> a) a
reqArg' String
"WARNING" (String -> [String] -> [String]
forall a. a -> [a] -> [a]
: []) ([String] -> [String] -> [String]
forall a b. a -> b -> a
const []))
]
data UpdateFlags = UpdateFlags
{ UpdateFlags -> Last Verbosity
updateVerbosity :: Flag Verbosity
, UpdateFlags -> Last TotalIndexState
updateIndexState :: Flag TotalIndexState
}
deriving ((forall x. UpdateFlags -> Rep UpdateFlags x)
-> (forall x. Rep UpdateFlags x -> UpdateFlags)
-> Generic UpdateFlags
forall x. Rep UpdateFlags x -> UpdateFlags
forall x. UpdateFlags -> Rep UpdateFlags x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cfrom :: forall x. UpdateFlags -> Rep UpdateFlags x
from :: forall x. UpdateFlags -> Rep UpdateFlags x
$cto :: forall x. Rep UpdateFlags x -> UpdateFlags
to :: forall x. Rep UpdateFlags x -> UpdateFlags
Generic)
defaultUpdateFlags :: UpdateFlags
defaultUpdateFlags :: UpdateFlags
defaultUpdateFlags =
UpdateFlags
{ updateVerbosity :: Last Verbosity
updateVerbosity = Verbosity -> Last Verbosity
forall a. a -> Last a
toFlag Verbosity
normal
, updateIndexState :: Last TotalIndexState
updateIndexState = TotalIndexState -> Last TotalIndexState
forall a. a -> Last a
toFlag TotalIndexState
headTotalIndexState
}
cleanCommand :: CommandUI CleanFlags
cleanCommand :: CommandUI CleanFlags
cleanCommand =
CommandUI CleanFlags
Cabal.cleanCommand
{ commandUsage = \String
pname ->
String
"Usage: " String -> String -> String
forall a. [a] -> [a] -> [a]
++ String
pname String -> String -> String
forall a. [a] -> [a] -> [a]
++ String
" v1-clean [FLAGS]\n"
}
formatCommand :: CommandUI (Flag Verbosity)
formatCommand :: CommandUI (Last Verbosity)
formatCommand =
CommandUI
{ commandName :: String
commandName = String
"format"
, commandSynopsis :: String
commandSynopsis = String
"Reformat the .cabal file using the standard style."
, commandDescription :: Maybe (String -> String)
commandDescription = Maybe (String -> String)
forall a. Maybe a
Nothing
, commandNotes :: Maybe (String -> String)
commandNotes = Maybe (String -> String)
forall a. Maybe a
Nothing
, commandUsage :: String -> String
commandUsage = String -> [String] -> String -> String
usageAlternatives String
"format" [String
"[FILE]"]
, commandDefaultFlags :: Last Verbosity
commandDefaultFlags = Verbosity -> Last Verbosity
forall a. a -> Last a
toFlag Verbosity
normal
, commandOptions :: ShowOrParseArgs -> [OptionField (Last Verbosity)]
commandOptions = \ShowOrParseArgs
_ -> []
}
manpageCommand :: CommandUI ManpageFlags
manpageCommand :: CommandUI ManpageFlags
manpageCommand =
CommandUI
{ commandName :: String
commandName = String
"man"
, commandSynopsis :: String
commandSynopsis = String
"Outputs manpage source."
, commandDescription :: Maybe (String -> String)
commandDescription = (String -> String) -> Maybe (String -> String)
forall a. a -> Maybe a
Just ((String -> String) -> Maybe (String -> String))
-> (String -> String) -> Maybe (String -> String)
forall a b. (a -> b) -> a -> b
$ \String
_ ->
String
"Output manpage source to STDOUT.\n"
, commandNotes :: Maybe (String -> String)
commandNotes = Maybe (String -> String)
forall a. Maybe a
Nothing
, commandUsage :: String -> String
commandUsage = String -> String -> String
usageFlags String
"man"
, commandDefaultFlags :: ManpageFlags
commandDefaultFlags = ManpageFlags
defaultManpageFlags
, commandOptions :: ShowOrParseArgs -> [OptionField ManpageFlags]
commandOptions = ShowOrParseArgs -> [OptionField ManpageFlags]
manpageOptions
}
runCommand :: CommandUI BuildFlags
runCommand :: CommandUI BuildFlags
runCommand =
CommandUI
{ commandName :: String
commandName = String
"run"
, commandSynopsis :: String
commandSynopsis = String
"Builds and runs an executable."
, commandDescription :: Maybe (String -> String)
commandDescription = (String -> String) -> Maybe (String -> String)
forall a. a -> Maybe a
Just ((String -> String) -> Maybe (String -> String))
-> (String -> String) -> Maybe (String -> String)
forall a b. (a -> b) -> a -> b
$ \String
pname ->
String -> String
wrapText (String -> String) -> String -> String
forall a b. (a -> b) -> a -> b
$
String
"Builds and then runs the specified executable. If no executable is "
String -> String -> String
forall a. [a] -> [a] -> [a]
++ String
"specified, but the package contains just one executable, that one "
String -> String -> String
forall a. [a] -> [a] -> [a]
++ String
"is built and executed.\n"
String -> String -> String
forall a. [a] -> [a] -> [a]
++ String
"\n"
String -> String -> String
forall a. [a] -> [a] -> [a]
++ String
"Use `"
String -> String -> String
forall a. [a] -> [a] -> [a]
++ String
pname
String -> String -> String
forall a. [a] -> [a] -> [a]
++ String
" v1-test --show-details=streaming` to run a "
String -> String -> String
forall a. [a] -> [a] -> [a]
++ String
"test-suite and get its full output.\n"
, commandNotes :: Maybe (String -> String)
commandNotes = (String -> String) -> Maybe (String -> String)
forall a. a -> Maybe a
Just ((String -> String) -> Maybe (String -> String))
-> (String -> String) -> Maybe (String -> String)
forall a b. (a -> b) -> a -> b
$ \String
pname ->
String
"Examples:\n"
String -> String -> String
forall a. [a] -> [a] -> [a]
++ String
" "
String -> String -> String
forall a. [a] -> [a] -> [a]
++ String
pname
String -> String -> String
forall a. [a] -> [a] -> [a]
++ String
" v1-run\n"
String -> String -> String
forall a. [a] -> [a] -> [a]
++ String
" Run the only executable in the current package;\n"
String -> String -> String
forall a. [a] -> [a] -> [a]
++ String
" "
String -> String -> String
forall a. [a] -> [a] -> [a]
++ String
pname
String -> String -> String
forall a. [a] -> [a] -> [a]
++ String
" v1-run foo -- --fooflag\n"
String -> String -> String
forall a. [a] -> [a] -> [a]
++ String
" Works similar to `./foo --fooflag`.\n"
, commandUsage :: String -> String
commandUsage =
String -> [String] -> String -> String
usageAlternatives
String
"v1-run"
[String
"[FLAGS] [EXECUTABLE] [-- EXECUTABLE_FLAGS]"]
, commandDefaultFlags :: BuildFlags
commandDefaultFlags = BuildFlags
forall a. Monoid a => a
mempty
, commandOptions :: ShowOrParseArgs -> [OptionField BuildFlags]
commandOptions = CommandUI BuildFlags -> ShowOrParseArgs -> [OptionField BuildFlags]
forall flags.
CommandUI flags -> ShowOrParseArgs -> [OptionField flags]
commandOptions CommandUI BuildFlags
parent
}
where
parent :: CommandUI BuildFlags
parent = ProgramDb -> CommandUI BuildFlags
Cabal.buildCommand ProgramDb
defaultProgramDb
data ReportFlags = ReportFlags
{ ReportFlags -> Last Token
reportToken :: Flag Token
, ReportFlags -> Last Username
reportUsername :: Flag Username
, ReportFlags -> Last Password
reportPassword :: Flag Password
, ReportFlags -> Last Verbosity
reportVerbosity :: Flag Verbosity
}
deriving ((forall x. ReportFlags -> Rep ReportFlags x)
-> (forall x. Rep ReportFlags x -> ReportFlags)
-> Generic ReportFlags
forall x. Rep ReportFlags x -> ReportFlags
forall x. ReportFlags -> Rep ReportFlags x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cfrom :: forall x. ReportFlags -> Rep ReportFlags x
from :: forall x. ReportFlags -> Rep ReportFlags x
$cto :: forall x. Rep ReportFlags x -> ReportFlags
to :: forall x. Rep ReportFlags x -> ReportFlags
Generic)
defaultReportFlags :: ReportFlags
defaultReportFlags :: ReportFlags
defaultReportFlags =
ReportFlags
{ reportToken :: Last Token
reportToken = Last Token
forall a. Monoid a => a
mempty
, reportUsername :: Last Username
reportUsername = Last Username
forall a. Monoid a => a
mempty
, reportPassword :: Last Password
reportPassword = Last Password
forall a. Monoid a => a
mempty
, reportVerbosity :: Last Verbosity
reportVerbosity = Verbosity -> Last Verbosity
forall a. a -> Last a
toFlag Verbosity
normal
}
reportCommand :: CommandUI ReportFlags
reportCommand :: CommandUI ReportFlags
reportCommand =
CommandUI
{ commandName :: String
commandName = String
"report"
, commandSynopsis :: String
commandSynopsis = String
"Upload build reports to a remote server."
, commandDescription :: Maybe (String -> String)
commandDescription = Maybe (String -> String)
forall a. Maybe a
Nothing
, commandNotes :: Maybe (String -> String)
commandNotes = (String -> String) -> Maybe (String -> String)
forall a. a -> Maybe a
Just ((String -> String) -> Maybe (String -> String))
-> (String -> String) -> Maybe (String -> String)
forall a b. (a -> b) -> a -> b
$ \String
_ ->
String
"You can store your Hackage login in the ~/.config/cabal/config file\n"
String -> String -> String
forall a. [a] -> [a] -> [a]
++ String
"(the %APPDATA%\\cabal\\config file on Windows)\n"
, commandUsage :: String -> String
commandUsage = String -> [String] -> String -> String
usageAlternatives String
"report" [String
"[FLAGS]"]
, commandDefaultFlags :: ReportFlags
commandDefaultFlags = ReportFlags
defaultReportFlags
, commandOptions :: ShowOrParseArgs -> [OptionField ReportFlags]
commandOptions = \ShowOrParseArgs
_ ->
[ (ReportFlags -> Last Verbosity)
-> (Last Verbosity -> ReportFlags -> ReportFlags)
-> OptionField ReportFlags
forall flags.
(flags -> Last Verbosity)
-> (Last Verbosity -> flags -> flags) -> OptionField flags
optionVerbosity ReportFlags -> Last Verbosity
reportVerbosity (\Last Verbosity
v ReportFlags
flags -> ReportFlags
flags{reportVerbosity = v})
, String
-> [String]
-> String
-> (ReportFlags -> Last Token)
-> (Last Token -> ReportFlags -> ReportFlags)
-> MkOptDescr
(ReportFlags -> Last Token)
(Last Token -> ReportFlags -> ReportFlags)
ReportFlags
-> OptionField ReportFlags
forall get set a.
String
-> [String]
-> String
-> get
-> set
-> MkOptDescr get set a
-> OptionField a
option
[Char
't']
[String
"token"]
String
"Hackage authentication Token."
ReportFlags -> Last Token
reportToken
(\Last Token
v ReportFlags
flags -> ReportFlags
flags{reportToken = v})
( String
-> (String -> Last Token)
-> (Last Token -> [String])
-> MkOptDescr
(ReportFlags -> Last Token)
(Last Token -> ReportFlags -> ReportFlags)
ReportFlags
forall b a.
Monoid b =>
String
-> (String -> b)
-> (b -> [String])
-> MkOptDescr (a -> b) (b -> a -> a) a
reqArg'
String
"TOKEN"
(Token -> Last Token
forall a. a -> Last a
toFlag (Token -> Last Token) -> (String -> Token) -> String -> Last Token
forall b c a. (b -> c) -> (a -> b) -> a -> c
. String -> Token
Token)
(Last String -> [String]
forall a. Flag a -> [a]
flagToList (Last String -> [String])
-> (Last Token -> Last String) -> Last Token -> [String]
forall b c a. (b -> c) -> (a -> b) -> a -> c
. (Token -> String) -> Last Token -> Last String
forall a b. (a -> b) -> Last a -> Last b
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
fmap Token -> String
unToken)
)
, String
-> [String]
-> String
-> (ReportFlags -> Last Username)
-> (Last Username -> ReportFlags -> ReportFlags)
-> MkOptDescr
(ReportFlags -> Last Username)
(Last Username -> ReportFlags -> ReportFlags)
ReportFlags
-> OptionField ReportFlags
forall get set a.
String
-> [String]
-> String
-> get
-> set
-> MkOptDescr get set a
-> OptionField a
option
[Char
'u']
[String
"username"]
String
"Hackage username."
ReportFlags -> Last Username
reportUsername
(\Last Username
v ReportFlags
flags -> ReportFlags
flags{reportUsername = v})
( String
-> (String -> Last Username)
-> (Last Username -> [String])
-> MkOptDescr
(ReportFlags -> Last Username)
(Last Username -> ReportFlags -> ReportFlags)
ReportFlags
forall b a.
Monoid b =>
String
-> (String -> b)
-> (b -> [String])
-> MkOptDescr (a -> b) (b -> a -> a) a
reqArg'
String
"USERNAME"
(Username -> Last Username
forall a. a -> Last a
toFlag (Username -> Last Username)
-> (String -> Username) -> String -> Last Username
forall b c a. (b -> c) -> (a -> b) -> a -> c
. String -> Username
Username)
(Last String -> [String]
forall a. Flag a -> [a]
flagToList (Last String -> [String])
-> (Last Username -> Last String) -> Last Username -> [String]
forall b c a. (b -> c) -> (a -> b) -> a -> c
. (Username -> String) -> Last Username -> Last String
forall a b. (a -> b) -> Last a -> Last b
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
fmap Username -> String
unUsername)
)
, String
-> [String]
-> String
-> (ReportFlags -> Last Password)
-> (Last Password -> ReportFlags -> ReportFlags)
-> MkOptDescr
(ReportFlags -> Last Password)
(Last Password -> ReportFlags -> ReportFlags)
ReportFlags
-> OptionField ReportFlags
forall get set a.
String
-> [String]
-> String
-> get
-> set
-> MkOptDescr get set a
-> OptionField a
option
[Char
'p']
[String
"password"]
String
"Hackage password."
ReportFlags -> Last Password
reportPassword
(\Last Password
v ReportFlags
flags -> ReportFlags
flags{reportPassword = v})
( String
-> (String -> Last Password)
-> (Last Password -> [String])
-> MkOptDescr
(ReportFlags -> Last Password)
(Last Password -> ReportFlags -> ReportFlags)
ReportFlags
forall b a.
Monoid b =>
String
-> (String -> b)
-> (b -> [String])
-> MkOptDescr (a -> b) (b -> a -> a) a
reqArg'
String
"PASSWORD"
(Password -> Last Password
forall a. a -> Last a
toFlag (Password -> Last Password)
-> (String -> Password) -> String -> Last Password
forall b c a. (b -> c) -> (a -> b) -> a -> c
. String -> Password
Password)
(Last String -> [String]
forall a. Flag a -> [a]
flagToList (Last String -> [String])
-> (Last Password -> Last String) -> Last Password -> [String]
forall b c a. (b -> c) -> (a -> b) -> a -> c
. (Password -> String) -> Last Password -> Last String
forall a b. (a -> b) -> Last a -> Last b
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
fmap Password -> String
unPassword)
)
]
}
instance Monoid ReportFlags where
mempty :: ReportFlags
mempty = ReportFlags
forall a. (Generic a, GMonoid (Rep a)) => a
gmempty
mappend :: ReportFlags -> ReportFlags -> ReportFlags
mappend = ReportFlags -> ReportFlags -> ReportFlags
forall a. Semigroup a => a -> a -> a
(<>)
instance Semigroup ReportFlags where
<> :: ReportFlags -> ReportFlags -> ReportFlags
(<>) = ReportFlags -> ReportFlags -> ReportFlags
forall a. (Generic a, GSemigroup (Rep a)) => a -> a -> a
gmappend
data GetFlags = GetFlags
{ GetFlags -> Last String
getDestDir :: Flag FilePath
, GetFlags -> Last Bool
getOnlyPkgDescr :: Flag Bool
, GetFlags -> Last Bool
getPristine :: Flag Bool
, GetFlags -> Last TotalIndexState
getIndexState :: Flag TotalIndexState
, GetFlags -> Last ActiveRepos
getActiveRepos :: Flag ActiveRepos
, GetFlags -> Last (Maybe RepoKind)
getSourceRepository :: Flag (Maybe RepoKind)
, GetFlags -> Last Verbosity
getVerbosity :: Flag Verbosity
}
deriving ((forall x. GetFlags -> Rep GetFlags x)
-> (forall x. Rep GetFlags x -> GetFlags) -> Generic GetFlags
forall x. Rep GetFlags x -> GetFlags
forall x. GetFlags -> Rep GetFlags x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cfrom :: forall x. GetFlags -> Rep GetFlags x
from :: forall x. GetFlags -> Rep GetFlags x
$cto :: forall x. Rep GetFlags x -> GetFlags
to :: forall x. Rep GetFlags x -> GetFlags
Generic)
defaultGetFlags :: GetFlags
defaultGetFlags :: GetFlags
defaultGetFlags =
GetFlags
{ getDestDir :: Last String
getDestDir = Last String
forall a. Monoid a => a
mempty
, getOnlyPkgDescr :: Last Bool
getOnlyPkgDescr = Last Bool
forall a. Monoid a => a
mempty
, getPristine :: Last Bool
getPristine = Last Bool
forall a. Monoid a => a
mempty
, getIndexState :: Last TotalIndexState
getIndexState = Last TotalIndexState
forall a. Monoid a => a
mempty
, getActiveRepos :: Last ActiveRepos
getActiveRepos = Last ActiveRepos
forall a. Monoid a => a
mempty
, getSourceRepository :: Last (Maybe RepoKind)
getSourceRepository = Last (Maybe RepoKind)
forall a. Monoid a => a
mempty
, getVerbosity :: Last Verbosity
getVerbosity = Verbosity -> Last Verbosity
forall a. a -> Last a
toFlag Verbosity
normal
}
getCommand :: CommandUI GetFlags
getCommand :: CommandUI GetFlags
getCommand =
CommandUI
{ commandName :: String
commandName = String
"get"
, commandSynopsis :: String
commandSynopsis = String
"Download/Extract a package's source code (repository)."
, commandDescription :: Maybe (String -> String)
commandDescription = (String -> String) -> Maybe (String -> String)
forall a. a -> Maybe a
Just ((String -> String) -> Maybe (String -> String))
-> (String -> String) -> Maybe (String -> String)
forall a b. (a -> b) -> a -> b
$ \String
_ -> String -> String
wrapText (String -> String) -> String -> String
forall a b. (a -> b) -> a -> b
$ [String] -> String
unlines [String]
descriptionOfGetCommand
, commandNotes :: Maybe (String -> String)
commandNotes = (String -> String) -> Maybe (String -> String)
forall a. a -> Maybe a
Just ((String -> String) -> Maybe (String -> String))
-> (String -> String) -> Maybe (String -> String)
forall a b. (a -> b) -> a -> b
$ \String
pname -> [String] -> String
unlines ([String] -> String) -> [String] -> String
forall a b. (a -> b) -> a -> b
$ String -> String -> [String]
notesOfGetCommand String
"get" String
pname
, commandUsage :: String -> String
commandUsage = String -> String -> String
usagePackages String
"get"
, commandDefaultFlags :: GetFlags
commandDefaultFlags = GetFlags
defaultGetFlags
, commandOptions :: ShowOrParseArgs -> [OptionField GetFlags]
commandOptions = \ShowOrParseArgs
_ ->
[ (GetFlags -> Last Verbosity)
-> (Last Verbosity -> GetFlags -> GetFlags) -> OptionField GetFlags
forall flags.
(flags -> Last Verbosity)
-> (Last Verbosity -> flags -> flags) -> OptionField flags
optionVerbosity GetFlags -> Last Verbosity
getVerbosity (\Last Verbosity
v GetFlags
flags -> GetFlags
flags{getVerbosity = v})
, String
-> [String]
-> String
-> (GetFlags -> Last String)
-> (Last String -> GetFlags -> GetFlags)
-> MkOptDescr
(GetFlags -> Last String)
(Last String -> GetFlags -> GetFlags)
GetFlags
-> OptionField GetFlags
forall get set a.
String
-> [String]
-> String
-> get
-> set
-> MkOptDescr get set a
-> OptionField a
option
String
"d"
[String
"destdir"]
String
"Where to place the package source, defaults to the current directory."
GetFlags -> Last String
getDestDir
(\Last String
v GetFlags
flags -> GetFlags
flags{getDestDir = v})
(String
-> MkOptDescr
(GetFlags -> Last String)
(Last String -> GetFlags -> GetFlags)
GetFlags
forall b.
String -> MkOptDescr (b -> Last String) (Last String -> b -> b) b
reqArgFlag String
"PATH")
, String
-> [String]
-> String
-> (GetFlags -> Last (Maybe RepoKind))
-> (Last (Maybe RepoKind) -> GetFlags -> GetFlags)
-> MkOptDescr
(GetFlags -> Last (Maybe RepoKind))
(Last (Maybe RepoKind) -> GetFlags -> GetFlags)
GetFlags
-> OptionField GetFlags
forall get set a.
String
-> [String]
-> String
-> get
-> set
-> MkOptDescr get set a
-> OptionField a
option
String
"s"
[String
"source-repository"]
String
"Copy the package's source repository (ie git clone, darcs get, etc as appropriate)."
GetFlags -> Last (Maybe RepoKind)
getSourceRepository
(\Last (Maybe RepoKind)
v GetFlags
flags -> GetFlags
flags{getSourceRepository = v})
( String
-> ReadE (Last (Maybe RepoKind))
-> (String, Last (Maybe RepoKind))
-> (Last (Maybe RepoKind) -> [Maybe String])
-> MkOptDescr
(GetFlags -> Last (Maybe RepoKind))
(Last (Maybe RepoKind) -> GetFlags -> GetFlags)
GetFlags
forall b a.
Monoid b =>
String
-> ReadE b
-> (String, b)
-> (b -> [Maybe String])
-> MkOptDescr (a -> b) (b -> a -> a) a
optArg
String
"[head|this|...]"
( (String -> String)
-> ParsecParser (Last (Maybe RepoKind))
-> ReadE (Last (Maybe RepoKind))
forall a. (String -> String) -> ParsecParser a -> ReadE a
parsecToReadE
(String -> String -> String
forall a b. a -> b -> a
const String
"invalid source-repository")
((RepoKind -> Last (Maybe RepoKind))
-> ParsecParser RepoKind -> ParsecParser (Last (Maybe RepoKind))
forall a b. (a -> b) -> ParsecParser a -> ParsecParser b
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
fmap (Maybe RepoKind -> Last (Maybe RepoKind)
forall a. a -> Last a
toFlag (Maybe RepoKind -> Last (Maybe RepoKind))
-> (RepoKind -> Maybe RepoKind)
-> RepoKind
-> Last (Maybe RepoKind)
forall b c a. (b -> c) -> (a -> b) -> a -> c
. RepoKind -> Maybe RepoKind
forall a. a -> Maybe a
Just) ParsecParser RepoKind
forall a (m :: * -> *). (Parsec a, CabalParsing m) => m a
forall (m :: * -> *). CabalParsing m => m RepoKind
parsec)
)
(String
"", Maybe RepoKind -> Last (Maybe RepoKind)
forall a. a -> Last a
Flag Maybe RepoKind
forall a. Maybe a
Nothing)
((Maybe RepoKind -> Maybe String)
-> [Maybe RepoKind] -> [Maybe String]
forall a b. (a -> b) -> [a] -> [b]
map ((RepoKind -> String) -> Maybe RepoKind -> Maybe String
forall a b. (a -> b) -> Maybe a -> Maybe b
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
fmap RepoKind -> String
forall a. Show a => a -> String
show) ([Maybe RepoKind] -> [Maybe String])
-> (Last (Maybe RepoKind) -> [Maybe RepoKind])
-> Last (Maybe RepoKind)
-> [Maybe String]
forall b c a. (b -> c) -> (a -> b) -> a -> c
. Last (Maybe RepoKind) -> [Maybe RepoKind]
forall a. Flag a -> [a]
flagToList)
)
, String
-> [String]
-> String
-> (GetFlags -> Last TotalIndexState)
-> (Last TotalIndexState -> GetFlags -> GetFlags)
-> MkOptDescr
(GetFlags -> Last TotalIndexState)
(Last TotalIndexState -> GetFlags -> GetFlags)
GetFlags
-> OptionField GetFlags
forall get set a.
String
-> [String]
-> String
-> get
-> set
-> MkOptDescr get set a
-> OptionField a
option
[]
[String
"index-state"]
( String
"Use source package index state as it existed at a previous time. "
String -> String -> String
forall a. [a] -> [a] -> [a]
++ String
"Accepts unix-timestamps (e.g. '@1474732068'), ISO8601 UTC timestamps "
String -> String -> String
forall a. [a] -> [a] -> [a]
++ String
"(e.g. '2016-09-24T17:47:48Z'), or 'HEAD' (default: 'HEAD'). "
String -> String -> String
forall a. [a] -> [a] -> [a]
++ String
"This determines which package versions are available as well as "
String -> String -> String
forall a. [a] -> [a] -> [a]
++ String
".cabal file revision is selected (unless --pristine is used)."
)
GetFlags -> Last TotalIndexState
getIndexState
(\Last TotalIndexState
v GetFlags
flags -> GetFlags
flags{getIndexState = v})
( String
-> ReadE (Last TotalIndexState)
-> (Last TotalIndexState -> [String])
-> MkOptDescr
(GetFlags -> Last TotalIndexState)
(Last TotalIndexState -> GetFlags -> GetFlags)
GetFlags
forall b a.
Monoid b =>
String
-> ReadE b
-> (b -> [String])
-> MkOptDescr (a -> b) (b -> a -> a) a
reqArg
String
"STATE"
( (String -> String)
-> ParsecParser (Last TotalIndexState)
-> ReadE (Last TotalIndexState)
forall a. (String -> String) -> ParsecParser a -> ReadE a
parsecToReadE
( String -> String -> String
forall a b. a -> b -> a
const (String -> String -> String) -> String -> String -> String
forall a b. (a -> b) -> a -> b
$
String
"index-state must be a "
String -> String -> String
forall a. [a] -> [a] -> [a]
++ String
"unix-timestamps (e.g. '@1474732068'), "
String -> String -> String
forall a. [a] -> [a] -> [a]
++ String
"a ISO8601 UTC timestamp "
String -> String -> String
forall a. [a] -> [a] -> [a]
++ String
"(e.g. '2016-09-24T17:47:48Z'), or 'HEAD'"
)
(TotalIndexState -> Last TotalIndexState
forall a. a -> Last a
toFlag (TotalIndexState -> Last TotalIndexState)
-> ParsecParser TotalIndexState
-> ParsecParser (Last TotalIndexState)
forall a b. (a -> b) -> ParsecParser a -> ParsecParser b
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
`fmap` ParsecParser TotalIndexState
forall a (m :: * -> *). (Parsec a, CabalParsing m) => m a
forall (m :: * -> *). CabalParsing m => m TotalIndexState
parsec)
)
(Last String -> [String]
forall a. Flag a -> [a]
flagToList (Last String -> [String])
-> (Last TotalIndexState -> Last String)
-> Last TotalIndexState
-> [String]
forall b c a. (b -> c) -> (a -> b) -> a -> c
. (TotalIndexState -> String) -> Last TotalIndexState -> Last String
forall a b. (a -> b) -> Last a -> Last b
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
fmap TotalIndexState -> String
forall a. Pretty a => a -> String
prettyShow)
)
, String
-> [String]
-> String
-> (GetFlags -> Last Bool)
-> (Last Bool -> GetFlags -> GetFlags)
-> MkOptDescr
(GetFlags -> Last Bool)
(Last Bool -> GetFlags -> GetFlags)
GetFlags
-> OptionField GetFlags
forall get set a.
String
-> [String]
-> String
-> get
-> set
-> MkOptDescr get set a
-> OptionField a
option
[]
[String
"only-package-description"]
String
"Unpack only the package description file."
GetFlags -> Last Bool
getOnlyPkgDescr
(\Last Bool
v GetFlags
flags -> GetFlags
flags{getOnlyPkgDescr = v})
MkOptDescr
(GetFlags -> Last Bool)
(Last Bool -> GetFlags -> GetFlags)
GetFlags
forall a. MkOptDescr (a -> Last Bool) (Last Bool -> a -> a) a
trueArg
, String
-> [String]
-> String
-> (GetFlags -> Last Bool)
-> (Last Bool -> GetFlags -> GetFlags)
-> MkOptDescr
(GetFlags -> Last Bool)
(Last Bool -> GetFlags -> GetFlags)
GetFlags
-> OptionField GetFlags
forall get set a.
String
-> [String]
-> String
-> get
-> set
-> MkOptDescr get set a
-> OptionField a
option
[]
[String
"package-description-only"]
String
"A synonym for --only-package-description."
GetFlags -> Last Bool
getOnlyPkgDescr
(\Last Bool
v GetFlags
flags -> GetFlags
flags{getOnlyPkgDescr = v})
MkOptDescr
(GetFlags -> Last Bool)
(Last Bool -> GetFlags -> GetFlags)
GetFlags
forall a. MkOptDescr (a -> Last Bool) (Last Bool -> a -> a) a
trueArg
, String
-> [String]
-> String
-> (GetFlags -> Last Bool)
-> (Last Bool -> GetFlags -> GetFlags)
-> MkOptDescr
(GetFlags -> Last Bool)
(Last Bool -> GetFlags -> GetFlags)
GetFlags
-> OptionField GetFlags
forall get set a.
String
-> [String]
-> String
-> get
-> set
-> MkOptDescr get set a
-> OptionField a
option
[]
[String
"pristine"]
( String
"Unpack the original pristine tarball, rather than updating the "
String -> String -> String
forall a. [a] -> [a] -> [a]
++ String
".cabal file with the latest revision from the package archive."
)
GetFlags -> Last Bool
getPristine
(\Last Bool
v GetFlags
flags -> GetFlags
flags{getPristine = v})
MkOptDescr
(GetFlags -> Last Bool)
(Last Bool -> GetFlags -> GetFlags)
GetFlags
forall a. MkOptDescr (a -> Last Bool) (Last Bool -> a -> a) a
trueArg
]
}
descriptionOfGetCommand :: [String]
descriptionOfGetCommand :: [String]
descriptionOfGetCommand =
[ String
"Creates a local copy of a package's source code. By default it gets the source"
, String
"tarball and unpacks it in a local subdirectory. Alternatively, with -s it will"
, String
"get the code from the source repository specified by the package."
]
notesOfGetCommand
:: String
-> String
-> [String]
notesOfGetCommand :: String -> String -> [String]
notesOfGetCommand String
cmd String
pname =
[ String
"Examples:"
, String
" " String -> String -> String
forall a. [a] -> [a] -> [a]
++ [String] -> String
unwords [String
pname, String
cmd, String
"hlint"]
, String
" Download the latest stable version of hlint;"
, String
" " String -> String -> String
forall a. [a] -> [a] -> [a]
++ [String] -> String
unwords [String
pname, String
cmd, String
"lens --source-repository=head"]
, String
" Download the source repository of lens (i.e. git clone from github)."
]
unpackCommand :: CommandUI GetFlags
unpackCommand :: CommandUI GetFlags
unpackCommand =
CommandUI GetFlags
getCommand
{ commandName = "unpack"
, commandSynopsis = synopsis
, commandNotes = Just $ \String
pname ->
[String] -> String
unlines ([String] -> String) -> [String] -> String
forall a b. (a -> b) -> a -> b
$
String -> String -> [String]
notesOfGetCommand String
"unpack" String
pname
, commandUsage = usagePackages "unpack"
}
where
synopsis :: String
synopsis = String
"Deprecated alias for 'get'."
instance Monoid GetFlags where
mempty :: GetFlags
mempty = GetFlags
forall a. (Generic a, GMonoid (Rep a)) => a
gmempty
mappend :: GetFlags -> GetFlags -> GetFlags
mappend = GetFlags -> GetFlags -> GetFlags
forall a. Semigroup a => a -> a -> a
(<>)
instance Semigroup GetFlags where
<> :: GetFlags -> GetFlags -> GetFlags
(<>) = GetFlags -> GetFlags -> GetFlags
forall a. (Generic a, GSemigroup (Rep a)) => a -> a -> a
gmappend
data ListFlags = ListFlags
{ ListFlags -> Last Bool
listInstalled :: Flag Bool
, ListFlags -> Last Bool
listSimpleOutput :: Flag Bool
, ListFlags -> Last Bool
listCaseInsensitive :: Flag Bool
, ListFlags -> Last Verbosity
listVerbosity :: Flag Verbosity
, ListFlags -> [Maybe PackageDB]
listPackageDBs :: [Maybe PackageDB]
, ListFlags -> Last String
listHcPath :: Flag FilePath
}
deriving ((forall x. ListFlags -> Rep ListFlags x)
-> (forall x. Rep ListFlags x -> ListFlags) -> Generic ListFlags
forall x. Rep ListFlags x -> ListFlags
forall x. ListFlags -> Rep ListFlags x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cfrom :: forall x. ListFlags -> Rep ListFlags x
from :: forall x. ListFlags -> Rep ListFlags x
$cto :: forall x. Rep ListFlags x -> ListFlags
to :: forall x. Rep ListFlags x -> ListFlags
Generic)
defaultListFlags :: ListFlags
defaultListFlags :: ListFlags
defaultListFlags =
ListFlags
{ listInstalled :: Last Bool
listInstalled = Bool -> Last Bool
forall a. a -> Last a
Flag Bool
False
, listSimpleOutput :: Last Bool
listSimpleOutput = Bool -> Last Bool
forall a. a -> Last a
Flag Bool
False
, listCaseInsensitive :: Last Bool
listCaseInsensitive = Bool -> Last Bool
forall a. a -> Last a
Flag Bool
True
, listVerbosity :: Last Verbosity
listVerbosity = Verbosity -> Last Verbosity
forall a. a -> Last a
toFlag Verbosity
normal
, listPackageDBs :: [Maybe PackageDB]
listPackageDBs = []
, listHcPath :: Last String
listHcPath = Last String
forall a. Monoid a => a
mempty
}
listCommand :: CommandUI ListFlags
listCommand :: CommandUI ListFlags
listCommand =
CommandUI
{ commandName :: String
commandName = String
"list"
, commandSynopsis :: String
commandSynopsis = String
"List packages matching a search string."
, commandDescription :: Maybe (String -> String)
commandDescription = (String -> String) -> Maybe (String -> String)
forall a. a -> Maybe a
Just ((String -> String) -> Maybe (String -> String))
-> (String -> String) -> Maybe (String -> String)
forall a b. (a -> b) -> a -> b
$ \String
_ ->
String -> String
wrapText (String -> String) -> String -> String
forall a b. (a -> b) -> a -> b
$
String
"List all packages, or all packages matching one of the search"
String -> String -> String
forall a. [a] -> [a] -> [a]
++ String
" strings.\n"
String -> String -> String
forall a. [a] -> [a] -> [a]
++ String
"\n"
String -> String -> String
forall a. [a] -> [a] -> [a]
++ String
"Use the package database specified with --package-db. "
String -> String -> String
forall a. [a] -> [a] -> [a]
++ String
"If not specified, use the user package database.\n"
, commandNotes :: Maybe (String -> String)
commandNotes = (String -> String) -> Maybe (String -> String)
forall a. a -> Maybe a
Just ((String -> String) -> Maybe (String -> String))
-> (String -> String) -> Maybe (String -> String)
forall a b. (a -> b) -> a -> b
$ \String
pname ->
String
"Examples:\n"
String -> String -> String
forall a. [a] -> [a] -> [a]
++ String
" "
String -> String -> String
forall a. [a] -> [a] -> [a]
++ String
pname
String -> String -> String
forall a. [a] -> [a] -> [a]
++ String
" list pandoc\n"
String -> String -> String
forall a. [a] -> [a] -> [a]
++ String
" Will find pandoc, pandoc-citeproc, pandoc-lens, ...\n"
, commandUsage :: String -> String
commandUsage =
String -> [String] -> String -> String
usageAlternatives
String
"list"
[ String
"[FLAGS]"
, String
"[FLAGS] STRINGS"
]
, commandDefaultFlags :: ListFlags
commandDefaultFlags = ListFlags
defaultListFlags
, commandOptions :: ShowOrParseArgs -> [OptionField ListFlags]
commandOptions = [OptionField ListFlags]
-> ShowOrParseArgs -> [OptionField ListFlags]
forall a b. a -> b -> a
const [OptionField ListFlags]
listOptions
}
listOptions :: [OptionField ListFlags]
listOptions :: [OptionField ListFlags]
listOptions =
[ (ListFlags -> Last Verbosity)
-> (Last Verbosity -> ListFlags -> ListFlags)
-> OptionField ListFlags
forall flags.
(flags -> Last Verbosity)
-> (Last Verbosity -> flags -> flags) -> OptionField flags
optionVerbosity ListFlags -> Last Verbosity
listVerbosity (\Last Verbosity
v ListFlags
flags -> ListFlags
flags{listVerbosity = v})
, String
-> [String]
-> String
-> (ListFlags -> Last Bool)
-> (Last Bool -> ListFlags -> ListFlags)
-> MkOptDescr
(ListFlags -> Last Bool)
(Last Bool -> ListFlags -> ListFlags)
ListFlags
-> OptionField ListFlags
forall get set a.
String
-> [String]
-> String
-> get
-> set
-> MkOptDescr get set a
-> OptionField a
option
[]
[String
"installed"]
String
"Only print installed packages"
ListFlags -> Last Bool
listInstalled
(\Last Bool
v ListFlags
flags -> ListFlags
flags{listInstalled = v})
MkOptDescr
(ListFlags -> Last Bool)
(Last Bool -> ListFlags -> ListFlags)
ListFlags
forall a. MkOptDescr (a -> Last Bool) (Last Bool -> a -> a) a
trueArg
, String
-> [String]
-> String
-> (ListFlags -> Last Bool)
-> (Last Bool -> ListFlags -> ListFlags)
-> MkOptDescr
(ListFlags -> Last Bool)
(Last Bool -> ListFlags -> ListFlags)
ListFlags
-> OptionField ListFlags
forall get set a.
String
-> [String]
-> String
-> get
-> set
-> MkOptDescr get set a
-> OptionField a
option
[]
[String
"simple-output"]
String
"Print in a easy-to-parse format"
ListFlags -> Last Bool
listSimpleOutput
(\Last Bool
v ListFlags
flags -> ListFlags
flags{listSimpleOutput = v})
MkOptDescr
(ListFlags -> Last Bool)
(Last Bool -> ListFlags -> ListFlags)
ListFlags
forall a. MkOptDescr (a -> Last Bool) (Last Bool -> a -> a) a
trueArg
, String
-> [String]
-> String
-> (ListFlags -> Last Bool)
-> (Last Bool -> ListFlags -> ListFlags)
-> MkOptDescr
(ListFlags -> Last Bool)
(Last Bool -> ListFlags -> ListFlags)
ListFlags
-> OptionField ListFlags
forall get set a.
String
-> [String]
-> String
-> get
-> set
-> MkOptDescr get set a
-> OptionField a
option
[Char
'i']
[String
"ignore-case"]
String
"Ignore case distinctions"
ListFlags -> Last Bool
listCaseInsensitive
(\Last Bool
v ListFlags
flags -> ListFlags
flags{listCaseInsensitive = v})
(OptFlags
-> OptFlags
-> MkOptDescr
(ListFlags -> Last Bool)
(Last Bool -> ListFlags -> ListFlags)
ListFlags
forall a.
OptFlags
-> OptFlags -> MkOptDescr (a -> Last Bool) (Last Bool -> a -> a) a
boolOpt' ([Char
'i'], [String
"ignore-case"]) ([Char
'I'], [String
"strict-case"]))
, String
-> [String]
-> String
-> (ListFlags -> [Maybe PackageDB])
-> ([Maybe PackageDB] -> ListFlags -> ListFlags)
-> MkOptDescr
(ListFlags -> [Maybe PackageDB])
([Maybe PackageDB] -> ListFlags -> ListFlags)
ListFlags
-> OptionField ListFlags
forall get set a.
String
-> [String]
-> String
-> get
-> set
-> MkOptDescr get set a
-> OptionField a
option
String
""
[String
"package-db"]
( String
"Append the given package database to the list of package"
String -> String -> String
forall a. [a] -> [a] -> [a]
++ String
" databases used (to satisfy dependencies and register into)."
String -> String -> String
forall a. [a] -> [a] -> [a]
++ String
" May be a specific file, 'global' or 'user'. The initial list"
String -> String -> String
forall a. [a] -> [a] -> [a]
++ String
" is ['global'], ['global', 'user'],"
String -> String -> String
forall a. [a] -> [a] -> [a]
++ String
" depending on context. Use 'clear' to reset the list to empty."
String -> String -> String
forall a. [a] -> [a] -> [a]
++ String
" See the user guide for details."
)
ListFlags -> [Maybe PackageDB]
listPackageDBs
(\[Maybe PackageDB]
v ListFlags
flags -> ListFlags
flags{listPackageDBs = v})
(String
-> (String -> [Maybe PackageDB])
-> ([Maybe PackageDB] -> [String])
-> MkOptDescr
(ListFlags -> [Maybe PackageDB])
([Maybe PackageDB] -> ListFlags -> ListFlags)
ListFlags
forall b a.
Monoid b =>
String
-> (String -> b)
-> (b -> [String])
-> MkOptDescr (a -> b) (b -> a -> a) a
reqArg' String
"DB" String -> [Maybe PackageDB]
readPackageDbList [Maybe PackageDB] -> [String]
showPackageDbList)
, String
-> [String]
-> String
-> (ListFlags -> Last String)
-> (Last String -> ListFlags -> ListFlags)
-> MkOptDescr
(ListFlags -> Last String)
(Last String -> ListFlags -> ListFlags)
ListFlags
-> OptionField ListFlags
forall get set a.
String
-> [String]
-> String
-> get
-> set
-> MkOptDescr get set a
-> OptionField a
option
String
"w"
[String
"with-compiler"]
String
"give the path to a particular compiler"
ListFlags -> Last String
listHcPath
(\Last String
v ListFlags
flags -> ListFlags
flags{listHcPath = v})
(String
-> MkOptDescr
(ListFlags -> Last String)
(Last String -> ListFlags -> ListFlags)
ListFlags
forall b.
String -> MkOptDescr (b -> Last String) (Last String -> b -> b) b
reqArgFlag String
"PATH")
]
listNeedsCompiler :: ListFlags -> Bool
listNeedsCompiler :: ListFlags -> Bool
listNeedsCompiler ListFlags
f =
Bool -> (String -> Bool) -> Last String -> Bool
forall b a. b -> (a -> b) -> Flag a -> b
flagElim Bool
False (Bool -> String -> Bool
forall a b. a -> b -> a
const Bool
True) (ListFlags -> Last String
listHcPath ListFlags
f)
Bool -> Bool -> Bool
|| Bool -> Last Bool -> Bool
forall a. a -> Flag a -> a
fromFlagOrDefault Bool
False (ListFlags -> Last Bool
listInstalled ListFlags
f)
instance Monoid ListFlags where
mempty :: ListFlags
mempty = ListFlags
forall a. (Generic a, GMonoid (Rep a)) => a
gmempty
mappend :: ListFlags -> ListFlags -> ListFlags
mappend = ListFlags -> ListFlags -> ListFlags
forall a. Semigroup a => a -> a -> a
(<>)
instance Semigroup ListFlags where
<> :: ListFlags -> ListFlags -> ListFlags
(<>) = ListFlags -> ListFlags -> ListFlags
forall a. (Generic a, GSemigroup (Rep a)) => a -> a -> a
gmappend
data InfoFlags = InfoFlags
{ InfoFlags -> Last Verbosity
infoVerbosity :: Flag Verbosity
, InfoFlags -> [Maybe PackageDB]
infoPackageDBs :: [Maybe PackageDB]
}
deriving ((forall x. InfoFlags -> Rep InfoFlags x)
-> (forall x. Rep InfoFlags x -> InfoFlags) -> Generic InfoFlags
forall x. Rep InfoFlags x -> InfoFlags
forall x. InfoFlags -> Rep InfoFlags x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cfrom :: forall x. InfoFlags -> Rep InfoFlags x
from :: forall x. InfoFlags -> Rep InfoFlags x
$cto :: forall x. Rep InfoFlags x -> InfoFlags
to :: forall x. Rep InfoFlags x -> InfoFlags
Generic)
defaultInfoFlags :: InfoFlags
defaultInfoFlags :: InfoFlags
defaultInfoFlags =
InfoFlags
{ infoVerbosity :: Last Verbosity
infoVerbosity = Verbosity -> Last Verbosity
forall a. a -> Last a
toFlag Verbosity
normal
, infoPackageDBs :: [Maybe PackageDB]
infoPackageDBs = []
}
infoCommand :: CommandUI InfoFlags
infoCommand :: CommandUI InfoFlags
infoCommand =
CommandUI
{ commandName :: String
commandName = String
"info"
, commandSynopsis :: String
commandSynopsis = String
"Display detailed information about a particular package."
, commandDescription :: Maybe (String -> String)
commandDescription = (String -> String) -> Maybe (String -> String)
forall a. a -> Maybe a
Just ((String -> String) -> Maybe (String -> String))
-> (String -> String) -> Maybe (String -> String)
forall a b. (a -> b) -> a -> b
$ \String
_ ->
String -> String
wrapText (String -> String) -> String -> String
forall a b. (a -> b) -> a -> b
$
String
"Use the package database specified with --package-db. "
String -> String -> String
forall a. [a] -> [a] -> [a]
++ String
"If not specified, use the user package database.\n"
, commandNotes :: Maybe (String -> String)
commandNotes = Maybe (String -> String)
forall a. Maybe a
Nothing
, commandUsage :: String -> String
commandUsage = String -> [String] -> String -> String
usageAlternatives String
"info" [String
"[FLAGS] PACKAGES"]
, commandDefaultFlags :: InfoFlags
commandDefaultFlags = InfoFlags
defaultInfoFlags
, commandOptions :: ShowOrParseArgs -> [OptionField InfoFlags]
commandOptions = \ShowOrParseArgs
_ ->
[ (InfoFlags -> Last Verbosity)
-> (Last Verbosity -> InfoFlags -> InfoFlags)
-> OptionField InfoFlags
forall flags.
(flags -> Last Verbosity)
-> (Last Verbosity -> flags -> flags) -> OptionField flags
optionVerbosity InfoFlags -> Last Verbosity
infoVerbosity (\Last Verbosity
v InfoFlags
flags -> InfoFlags
flags{infoVerbosity = v})
, String
-> [String]
-> String
-> (InfoFlags -> [Maybe PackageDB])
-> ([Maybe PackageDB] -> InfoFlags -> InfoFlags)
-> MkOptDescr
(InfoFlags -> [Maybe PackageDB])
([Maybe PackageDB] -> InfoFlags -> InfoFlags)
InfoFlags
-> OptionField InfoFlags
forall get set a.
String
-> [String]
-> String
-> get
-> set
-> MkOptDescr get set a
-> OptionField a
option
String
""
[String
"package-db"]
( String
"Append the given package database to the list of package"
String -> String -> String
forall a. [a] -> [a] -> [a]
++ String
" databases used (to satisfy dependencies and register into)."
String -> String -> String
forall a. [a] -> [a] -> [a]
++ String
" May be a specific file, 'global' or 'user'. The initial list"
String -> String -> String
forall a. [a] -> [a] -> [a]
++ String
" is ['global'], ['global', 'user'],"
String -> String -> String
forall a. [a] -> [a] -> [a]
++ String
" depending on context. Use 'clear' to reset the list to empty."
String -> String -> String
forall a. [a] -> [a] -> [a]
++ String
" See the user guide for details."
)
InfoFlags -> [Maybe PackageDB]
infoPackageDBs
(\[Maybe PackageDB]
v InfoFlags
flags -> InfoFlags
flags{infoPackageDBs = v})
(String
-> (String -> [Maybe PackageDB])
-> ([Maybe PackageDB] -> [String])
-> MkOptDescr
(InfoFlags -> [Maybe PackageDB])
([Maybe PackageDB] -> InfoFlags -> InfoFlags)
InfoFlags
forall b a.
Monoid b =>
String
-> (String -> b)
-> (b -> [String])
-> MkOptDescr (a -> b) (b -> a -> a) a
reqArg' String
"DB" String -> [Maybe PackageDB]
readPackageDbList [Maybe PackageDB] -> [String]
showPackageDbList)
]
}
instance Monoid InfoFlags where
mempty :: InfoFlags
mempty = InfoFlags
forall a. (Generic a, GMonoid (Rep a)) => a
gmempty
mappend :: InfoFlags -> InfoFlags -> InfoFlags
mappend = InfoFlags -> InfoFlags -> InfoFlags
forall a. Semigroup a => a -> a -> a
(<>)
instance Semigroup InfoFlags where
<> :: InfoFlags -> InfoFlags -> InfoFlags
(<>) = InfoFlags -> InfoFlags -> InfoFlags
forall a. (Generic a, GSemigroup (Rep a)) => a -> a -> a
gmappend
data InstallFlags = InstallFlags
{ InstallFlags -> Last Bool
installDocumentation :: Flag Bool
, InstallFlags -> Last PathTemplate
installHaddockIndex :: Flag PathTemplate
, InstallFlags -> Last CopyDest
installDest :: Flag Cabal.CopyDest
, InstallFlags -> Last Bool
installDryRun :: Flag Bool
, InstallFlags -> Last Bool
installOnlyDownload :: Flag Bool
, InstallFlags -> Flag Int
installMaxBackjumps :: Flag Int
, InstallFlags -> Flag ReorderGoals
installReorderGoals :: Flag ReorderGoals
, InstallFlags -> Flag CountConflicts
installCountConflicts :: Flag CountConflicts
, InstallFlags -> Flag FineGrainedConflicts
installFineGrainedConflicts :: Flag FineGrainedConflicts
, InstallFlags -> Flag MinimizeConflictSet
installMinimizeConflictSet :: Flag MinimizeConflictSet
, InstallFlags -> Flag IndependentGoals
installIndependentGoals :: Flag IndependentGoals
, InstallFlags -> Flag PreferOldest
installPreferOldest :: Flag PreferOldest
, InstallFlags -> Flag ShadowPkgs
installShadowPkgs :: Flag ShadowPkgs
, InstallFlags -> Flag StrongFlags
installStrongFlags :: Flag StrongFlags
, InstallFlags -> Flag AllowBootLibInstalls
installAllowBootLibInstalls :: Flag AllowBootLibInstalls
, InstallFlags -> Flag OnlyConstrained
installOnlyConstrained :: Flag OnlyConstrained
, InstallFlags -> Last Bool
installReinstall :: Flag Bool
, InstallFlags -> Flag AvoidReinstalls
installAvoidReinstalls :: Flag AvoidReinstalls
, InstallFlags -> Last Bool
installOverrideReinstall :: Flag Bool
, InstallFlags -> Last Bool
installUpgradeDeps :: Flag Bool
, InstallFlags -> Last Bool
installOnly :: Flag Bool
, InstallFlags -> Last Bool
installOnlyDeps :: Flag Bool
, InstallFlags -> Last TotalIndexState
installIndexState :: Flag TotalIndexState
, InstallFlags -> Last String
installRootCmd :: Flag String
, InstallFlags -> NubList PathTemplate
installSummaryFile :: NubList PathTemplate
, InstallFlags -> Last PathTemplate
installLogFile :: Flag PathTemplate
, InstallFlags -> Last ReportLevel
installBuildReports :: Flag ReportLevel
, InstallFlags -> Last Bool
installReportPlanningFailure :: Flag Bool
,
InstallFlags -> Last String
installSymlinkBinDir :: Flag FilePath
, InstallFlags -> Last Bool
installPerComponent :: Flag Bool
, InstallFlags -> Last (Maybe Int)
installNumJobs :: Flag (Maybe Int)
, InstallFlags -> Last Bool
installUseSemaphore :: Flag Bool
, InstallFlags -> Last Bool
installKeepGoing :: Flag Bool
, InstallFlags -> Last Bool
installRunTests :: Flag Bool
, InstallFlags -> Last Bool
installOfflineMode :: Flag Bool
}
deriving (InstallFlags -> InstallFlags -> Bool
(InstallFlags -> InstallFlags -> Bool)
-> (InstallFlags -> InstallFlags -> Bool) -> Eq InstallFlags
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
$c== :: InstallFlags -> InstallFlags -> Bool
== :: InstallFlags -> InstallFlags -> Bool
$c/= :: InstallFlags -> InstallFlags -> Bool
/= :: InstallFlags -> InstallFlags -> Bool
Eq, Int -> InstallFlags -> String -> String
[InstallFlags] -> String -> String
InstallFlags -> String
(Int -> InstallFlags -> String -> String)
-> (InstallFlags -> String)
-> ([InstallFlags] -> String -> String)
-> Show InstallFlags
forall a.
(Int -> a -> String -> String)
-> (a -> String) -> ([a] -> String -> String) -> Show a
$cshowsPrec :: Int -> InstallFlags -> String -> String
showsPrec :: Int -> InstallFlags -> String -> String
$cshow :: InstallFlags -> String
show :: InstallFlags -> String
$cshowList :: [InstallFlags] -> String -> String
showList :: [InstallFlags] -> String -> String
Show, (forall x. InstallFlags -> Rep InstallFlags x)
-> (forall x. Rep InstallFlags x -> InstallFlags)
-> Generic InstallFlags
forall x. Rep InstallFlags x -> InstallFlags
forall x. InstallFlags -> Rep InstallFlags x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cfrom :: forall x. InstallFlags -> Rep InstallFlags x
from :: forall x. InstallFlags -> Rep InstallFlags x
$cto :: forall x. Rep InstallFlags x -> InstallFlags
to :: forall x. Rep InstallFlags x -> InstallFlags
Generic)
instance Binary InstallFlags
defaultInstallFlags :: InstallFlags
defaultInstallFlags :: InstallFlags
defaultInstallFlags =
InstallFlags
{ installDocumentation :: Last Bool
installDocumentation = Bool -> Last Bool
forall a. a -> Last a
Flag Bool
False
, installHaddockIndex :: Last PathTemplate
installHaddockIndex = PathTemplate -> Last PathTemplate
forall a. a -> Last a
Flag PathTemplate
docIndexFile
, installDest :: Last CopyDest
installDest = CopyDest -> Last CopyDest
forall a. a -> Last a
Flag CopyDest
Cabal.NoCopyDest
, installDryRun :: Last Bool
installDryRun = Bool -> Last Bool
forall a. a -> Last a
Flag Bool
False
, installOnlyDownload :: Last Bool
installOnlyDownload = Bool -> Last Bool
forall a. a -> Last a
Flag Bool
False
, installMaxBackjumps :: Flag Int
installMaxBackjumps = Int -> Flag Int
forall a. a -> Last a
Flag Int
defaultMaxBackjumps
, installReorderGoals :: Flag ReorderGoals
installReorderGoals = ReorderGoals -> Flag ReorderGoals
forall a. a -> Last a
Flag (Bool -> ReorderGoals
ReorderGoals Bool
False)
, installCountConflicts :: Flag CountConflicts
installCountConflicts = CountConflicts -> Flag CountConflicts
forall a. a -> Last a
Flag (Bool -> CountConflicts
CountConflicts Bool
True)
, installFineGrainedConflicts :: Flag FineGrainedConflicts
installFineGrainedConflicts = FineGrainedConflicts -> Flag FineGrainedConflicts
forall a. a -> Last a
Flag (Bool -> FineGrainedConflicts
FineGrainedConflicts Bool
True)
, installMinimizeConflictSet :: Flag MinimizeConflictSet
installMinimizeConflictSet = MinimizeConflictSet -> Flag MinimizeConflictSet
forall a. a -> Last a
Flag (Bool -> MinimizeConflictSet
MinimizeConflictSet Bool
False)
, installIndependentGoals :: Flag IndependentGoals
installIndependentGoals = IndependentGoals -> Flag IndependentGoals
forall a. a -> Last a
Flag (Bool -> IndependentGoals
IndependentGoals Bool
False)
, installPreferOldest :: Flag PreferOldest
installPreferOldest = PreferOldest -> Flag PreferOldest
forall a. a -> Last a
Flag (Bool -> PreferOldest
PreferOldest Bool
False)
, installShadowPkgs :: Flag ShadowPkgs
installShadowPkgs = ShadowPkgs -> Flag ShadowPkgs
forall a. a -> Last a
Flag (Bool -> ShadowPkgs
ShadowPkgs Bool
False)
, installStrongFlags :: Flag StrongFlags
installStrongFlags = StrongFlags -> Flag StrongFlags
forall a. a -> Last a
Flag (Bool -> StrongFlags
StrongFlags Bool
False)
, installAllowBootLibInstalls :: Flag AllowBootLibInstalls
installAllowBootLibInstalls = AllowBootLibInstalls -> Flag AllowBootLibInstalls
forall a. a -> Last a
Flag (Bool -> AllowBootLibInstalls
AllowBootLibInstalls Bool
False)
, installOnlyConstrained :: Flag OnlyConstrained
installOnlyConstrained = OnlyConstrained -> Flag OnlyConstrained
forall a. a -> Last a
Flag OnlyConstrained
OnlyConstrainedNone
, installReinstall :: Last Bool
installReinstall = Bool -> Last Bool
forall a. a -> Last a
Flag Bool
False
, installAvoidReinstalls :: Flag AvoidReinstalls
installAvoidReinstalls = AvoidReinstalls -> Flag AvoidReinstalls
forall a. a -> Last a
Flag (Bool -> AvoidReinstalls
AvoidReinstalls Bool
False)
, installOverrideReinstall :: Last Bool
installOverrideReinstall = Bool -> Last Bool
forall a. a -> Last a
Flag Bool
False
, installUpgradeDeps :: Last Bool
installUpgradeDeps = Bool -> Last Bool
forall a. a -> Last a
Flag Bool
False
, installOnly :: Last Bool
installOnly = Bool -> Last Bool
forall a. a -> Last a
Flag Bool
False
, installOnlyDeps :: Last Bool
installOnlyDeps = Bool -> Last Bool
forall a. a -> Last a
Flag Bool
False
, installIndexState :: Last TotalIndexState
installIndexState = Last TotalIndexState
forall a. Monoid a => a
mempty
, installRootCmd :: Last String
installRootCmd = Last String
forall a. Monoid a => a
mempty
, installSummaryFile :: NubList PathTemplate
installSummaryFile = NubList PathTemplate
forall a. Monoid a => a
mempty
, installLogFile :: Last PathTemplate
installLogFile = Last PathTemplate
forall a. Monoid a => a
mempty
, installBuildReports :: Last ReportLevel
installBuildReports = ReportLevel -> Last ReportLevel
forall a. a -> Last a
Flag ReportLevel
NoReports
, installReportPlanningFailure :: Last Bool
installReportPlanningFailure = Bool -> Last Bool
forall a. a -> Last a
Flag Bool
False
, installSymlinkBinDir :: Last String
installSymlinkBinDir = Last String
forall a. Monoid a => a
mempty
, installPerComponent :: Last Bool
installPerComponent = Bool -> Last Bool
forall a. a -> Last a
Flag Bool
True
, installNumJobs :: Last (Maybe Int)
installNumJobs = Last (Maybe Int)
forall a. Monoid a => a
mempty
, installUseSemaphore :: Last Bool
installUseSemaphore = Bool -> Last Bool
forall a. a -> Last a
Flag Bool
False
, installKeepGoing :: Last Bool
installKeepGoing = Bool -> Last Bool
forall a. a -> Last a
Flag Bool
False
, installRunTests :: Last Bool
installRunTests = Last Bool
forall a. Monoid a => a
mempty
, installOfflineMode :: Last Bool
installOfflineMode = Bool -> Last Bool
forall a. a -> Last a
Flag Bool
False
}
where
docIndexFile :: PathTemplate
docIndexFile =
String -> PathTemplate
toPathTemplate
( String
"$datadir"
String -> String -> String
</> String
"doc"
String -> String -> String
</> String
"$arch-$os-$compiler"
String -> String -> String
</> String
"index.html"
)
defaultMaxBackjumps :: Int
defaultMaxBackjumps :: Int
defaultMaxBackjumps = Int
4000
defaultSolver :: PreSolver
defaultSolver :: PreSolver
defaultSolver = PreSolver
AlwaysModular
allSolvers :: String
allSolvers :: String
allSolvers = String -> [String] -> String
forall a. [a] -> [[a]] -> [a]
intercalate String
", " ((PreSolver -> String) -> [PreSolver] -> [String]
forall a b. (a -> b) -> [a] -> [b]
map PreSolver -> String
forall a. Pretty a => a -> String
prettyShow ([PreSolver
forall a. Bounded a => a
minBound .. PreSolver
forall a. Bounded a => a
maxBound] :: [PreSolver]))
installCommand
:: CommandUI
( ConfigFlags
, ConfigExFlags
, InstallFlags
, HaddockFlags
, TestFlags
, BenchmarkFlags
)
installCommand :: CommandUI
(ConfigFlags, ConfigExFlags, InstallFlags, HaddockFlags, TestFlags,
BenchmarkFlags)
installCommand =
CommandUI
{ commandName :: String
commandName = String
"install"
, commandSynopsis :: String
commandSynopsis = String
"Install packages."
, commandUsage :: String -> String
commandUsage =
String -> [String] -> String -> String
usageAlternatives
String
"v1-install"
[ String
"[FLAGS]"
, String
"[FLAGS] PACKAGES"
]
, commandDescription :: Maybe (String -> String)
commandDescription = (String -> String) -> Maybe (String -> String)
forall a. a -> Maybe a
Just ((String -> String) -> Maybe (String -> String))
-> (String -> String) -> Maybe (String -> String)
forall a b. (a -> b) -> a -> b
$ \String
_ ->
String -> String
wrapText (String -> String) -> String -> String
forall a b. (a -> b) -> a -> b
$
String
"Installs one or more packages. By default, the installed package"
String -> String -> String
forall a. [a] -> [a] -> [a]
++ String
" will be registered in the user's package database."
String -> String -> String
forall a. [a] -> [a] -> [a]
++ String
"\n"
String -> String -> String
forall a. [a] -> [a] -> [a]
++ String
"If PACKAGES are specified, downloads and installs those packages."
String -> String -> String
forall a. [a] -> [a] -> [a]
++ String
" Otherwise, install the package in the current directory (and/or its"
String -> String -> String
forall a. [a] -> [a] -> [a]
++ String
" dependencies) (there must be exactly one .cabal file in the current"
String -> String -> String
forall a. [a] -> [a] -> [a]
++ String
" directory).\n"
String -> String -> String
forall a. [a] -> [a] -> [a]
++ String
"\n"
String -> String -> String
forall a. [a] -> [a] -> [a]
++ String
"The flags to `v1-install` are saved and"
String -> String -> String
forall a. [a] -> [a] -> [a]
++ String
" affect future commands such as `v1-build` and `v1-repl`. See the help for"
String -> String -> String
forall a. [a] -> [a] -> [a]
++ String
" `v1-configure` for a list of commands being affected.\n"
String -> String -> String
forall a. [a] -> [a] -> [a]
++ String
"\n"
String -> String -> String
forall a. [a] -> [a] -> [a]
++ String
"Installed executables will by default"
String -> String -> String
forall a. [a] -> [a] -> [a]
++ String
" be put into `~/.local/bin/`."
String -> String -> String
forall a. [a] -> [a] -> [a]
++ String
" If you want installed executable to be available globally, make"
String -> String -> String
forall a. [a] -> [a] -> [a]
++ String
" sure that the PATH environment variable contains that directory.\n"
String -> String -> String
forall a. [a] -> [a] -> [a]
++ String
"\n"
, commandNotes :: Maybe (String -> String)
commandNotes = (String -> String) -> Maybe (String -> String)
forall a. a -> Maybe a
Just ((String -> String) -> Maybe (String -> String))
-> (String -> String) -> Maybe (String -> String)
forall a b. (a -> b) -> a -> b
$ \String
pname ->
( case CommandUI ConfigFlags -> Maybe (String -> String)
forall flags. CommandUI flags -> Maybe (String -> String)
commandNotes (CommandUI ConfigFlags -> Maybe (String -> String))
-> CommandUI ConfigFlags -> Maybe (String -> String)
forall a b. (a -> b) -> a -> b
$
ProgramDb -> CommandUI ConfigFlags
Cabal.configureCommand ProgramDb
defaultProgramDb of
Just String -> String
desc -> String -> String
desc String
pname String -> String -> String
forall a. [a] -> [a] -> [a]
++ String
"\n"
Maybe (String -> String)
Nothing -> String
""
)
String -> String -> String
forall a. [a] -> [a] -> [a]
++ String
"Examples:\n"
String -> String -> String
forall a. [a] -> [a] -> [a]
++ String
" "
String -> String -> String
forall a. [a] -> [a] -> [a]
++ String
pname
String -> String -> String
forall a. [a] -> [a] -> [a]
++ String
" v1-install "
String -> String -> String
forall a. [a] -> [a] -> [a]
++ String
" Package in the current directory\n"
String -> String -> String
forall a. [a] -> [a] -> [a]
++ String
" "
String -> String -> String
forall a. [a] -> [a] -> [a]
++ String
pname
String -> String -> String
forall a. [a] -> [a] -> [a]
++ String
" v1-install foo "
String -> String -> String
forall a. [a] -> [a] -> [a]
++ String
" Package from the hackage server\n"
String -> String -> String
forall a. [a] -> [a] -> [a]
++ String
" "
String -> String -> String
forall a. [a] -> [a] -> [a]
++ String
pname
String -> String -> String
forall a. [a] -> [a] -> [a]
++ String
" v1-install foo-1.0 "
String -> String -> String
forall a. [a] -> [a] -> [a]
++ String
" Specific version of a package\n"
String -> String -> String
forall a. [a] -> [a] -> [a]
++ String
" "
String -> String -> String
forall a. [a] -> [a] -> [a]
++ String
pname
String -> String -> String
forall a. [a] -> [a] -> [a]
++ String
" v1-install 'foo < 2' "
String -> String -> String
forall a. [a] -> [a] -> [a]
++ String
" Constrained package version\n"
String -> String -> String
forall a. [a] -> [a] -> [a]
++ String
" "
String -> String -> String
forall a. [a] -> [a] -> [a]
++ String
pname
String -> String -> String
forall a. [a] -> [a] -> [a]
++ String
" v1-install haddock --bindir=$HOME/hask-bin/ --datadir=$HOME/hask-data/\n"
String -> String -> String
forall a. [a] -> [a] -> [a]
++ String
" "
String -> String -> String
forall a. [a] -> [a] -> [a]
++ ((Char -> Char) -> String -> String
forall a b. (a -> b) -> [a] -> [b]
map (Char -> Char -> Char
forall a b. a -> b -> a
const Char
' ') String
pname)
String -> String -> String
forall a. [a] -> [a] -> [a]
++ String
" "
String -> String -> String
forall a. [a] -> [a] -> [a]
++ String
" Change installation destination\n"
, commandDefaultFlags :: (ConfigFlags, ConfigExFlags, InstallFlags, HaddockFlags, TestFlags,
BenchmarkFlags)
commandDefaultFlags = (ConfigFlags
forall a. Monoid a => a
mempty, ConfigExFlags
forall a. Monoid a => a
mempty, InstallFlags
forall a. Monoid a => a
mempty, HaddockFlags
forall a. Monoid a => a
mempty, TestFlags
forall a. Monoid a => a
mempty, BenchmarkFlags
forall a. Monoid a => a
mempty)
, commandOptions :: ShowOrParseArgs
-> [OptionField
(ConfigFlags, ConfigExFlags, InstallFlags, HaddockFlags, TestFlags,
BenchmarkFlags)]
commandOptions = \ShowOrParseArgs
showOrParseArgs ->
((ConfigFlags, ConfigExFlags, InstallFlags, HaddockFlags,
TestFlags, BenchmarkFlags)
-> ConfigFlags)
-> (ConfigFlags
-> (ConfigFlags, ConfigExFlags, InstallFlags, HaddockFlags,
TestFlags, BenchmarkFlags)
-> (ConfigFlags, ConfigExFlags, InstallFlags, HaddockFlags,
TestFlags, BenchmarkFlags))
-> [OptionField ConfigFlags]
-> [OptionField
(ConfigFlags, ConfigExFlags, InstallFlags, HaddockFlags, TestFlags,
BenchmarkFlags)]
forall b a.
(b -> a) -> (a -> b -> b) -> [OptionField a] -> [OptionField b]
liftOptions
(ConfigFlags, ConfigExFlags, InstallFlags, HaddockFlags, TestFlags,
BenchmarkFlags)
-> ConfigFlags
forall {a} {b} {c} {d} {e} {f}. (a, b, c, d, e, f) -> a
get1
ConfigFlags
-> (ConfigFlags, ConfigExFlags, InstallFlags, HaddockFlags,
TestFlags, BenchmarkFlags)
-> (ConfigFlags, ConfigExFlags, InstallFlags, HaddockFlags,
TestFlags, BenchmarkFlags)
forall {a} {a} {b} {c} {d} {e} {f}.
a -> (a, b, c, d, e, f) -> (a, b, c, d, e, f)
set1
( (OptionField ConfigFlags -> Bool)
-> [OptionField ConfigFlags] -> [OptionField ConfigFlags]
forall a. (a -> Bool) -> [a] -> [a]
filter
( ( String -> [String] -> Bool
forall (t :: * -> *) a. (Foldable t, Eq a) => a -> t a -> Bool
`notElem`
[ String
"constraint"
, String
"dependency"
, String
"promised-dependency"
, String
"exact-configuration"
]
)
(String -> Bool)
-> (OptionField ConfigFlags -> String)
-> OptionField ConfigFlags
-> Bool
forall b c a. (b -> c) -> (a -> b) -> a -> c
. OptionField ConfigFlags -> String
forall a. OptionField a -> String
optionName
)
([OptionField ConfigFlags] -> [OptionField ConfigFlags])
-> [OptionField ConfigFlags] -> [OptionField ConfigFlags]
forall a b. (a -> b) -> a -> b
$ ShowOrParseArgs -> [OptionField ConfigFlags]
configureOptions ShowOrParseArgs
showOrParseArgs
)
[OptionField
(ConfigFlags, ConfigExFlags, InstallFlags, HaddockFlags, TestFlags,
BenchmarkFlags)]
-> [OptionField
(ConfigFlags, ConfigExFlags, InstallFlags, HaddockFlags, TestFlags,
BenchmarkFlags)]
-> [OptionField
(ConfigFlags, ConfigExFlags, InstallFlags, HaddockFlags, TestFlags,
BenchmarkFlags)]
forall a. [a] -> [a] -> [a]
++ ((ConfigFlags, ConfigExFlags, InstallFlags, HaddockFlags,
TestFlags, BenchmarkFlags)
-> ConfigExFlags)
-> (ConfigExFlags
-> (ConfigFlags, ConfigExFlags, InstallFlags, HaddockFlags,
TestFlags, BenchmarkFlags)
-> (ConfigFlags, ConfigExFlags, InstallFlags, HaddockFlags,
TestFlags, BenchmarkFlags))
-> [OptionField ConfigExFlags]
-> [OptionField
(ConfigFlags, ConfigExFlags, InstallFlags, HaddockFlags, TestFlags,
BenchmarkFlags)]
forall b a.
(b -> a) -> (a -> b -> b) -> [OptionField a] -> [OptionField b]
liftOptions (ConfigFlags, ConfigExFlags, InstallFlags, HaddockFlags, TestFlags,
BenchmarkFlags)
-> ConfigExFlags
forall {a} {b} {c} {d} {e} {f}. (a, b, c, d, e, f) -> b
get2 ConfigExFlags
-> (ConfigFlags, ConfigExFlags, InstallFlags, HaddockFlags,
TestFlags, BenchmarkFlags)
-> (ConfigFlags, ConfigExFlags, InstallFlags, HaddockFlags,
TestFlags, BenchmarkFlags)
forall {b} {a} {b} {c} {d} {e} {f}.
b -> (a, b, c, d, e, f) -> (a, b, c, d, e, f)
set2 (ShowOrParseArgs -> ConstraintSource -> [OptionField ConfigExFlags]
configureExOptions ShowOrParseArgs
showOrParseArgs ConstraintSource
ConstraintSourceCommandlineFlag)
[OptionField
(ConfigFlags, ConfigExFlags, InstallFlags, HaddockFlags, TestFlags,
BenchmarkFlags)]
-> [OptionField
(ConfigFlags, ConfigExFlags, InstallFlags, HaddockFlags, TestFlags,
BenchmarkFlags)]
-> [OptionField
(ConfigFlags, ConfigExFlags, InstallFlags, HaddockFlags, TestFlags,
BenchmarkFlags)]
forall a. [a] -> [a] -> [a]
++ ((ConfigFlags, ConfigExFlags, InstallFlags, HaddockFlags,
TestFlags, BenchmarkFlags)
-> InstallFlags)
-> (InstallFlags
-> (ConfigFlags, ConfigExFlags, InstallFlags, HaddockFlags,
TestFlags, BenchmarkFlags)
-> (ConfigFlags, ConfigExFlags, InstallFlags, HaddockFlags,
TestFlags, BenchmarkFlags))
-> [OptionField InstallFlags]
-> [OptionField
(ConfigFlags, ConfigExFlags, InstallFlags, HaddockFlags, TestFlags,
BenchmarkFlags)]
forall b a.
(b -> a) -> (a -> b -> b) -> [OptionField a] -> [OptionField b]
liftOptions
(ConfigFlags, ConfigExFlags, InstallFlags, HaddockFlags, TestFlags,
BenchmarkFlags)
-> InstallFlags
forall {a} {b} {c} {d} {e} {f}. (a, b, c, d, e, f) -> c
get3
InstallFlags
-> (ConfigFlags, ConfigExFlags, InstallFlags, HaddockFlags,
TestFlags, BenchmarkFlags)
-> (ConfigFlags, ConfigExFlags, InstallFlags, HaddockFlags,
TestFlags, BenchmarkFlags)
forall {c} {a} {b} {c} {d} {e} {f}.
c -> (a, b, c, d, e, f) -> (a, b, c, d, e, f)
set3
( (OptionField InstallFlags -> Bool)
-> [OptionField InstallFlags] -> [OptionField InstallFlags]
forall a. (a -> Bool) -> [a] -> [a]
filter
( (String -> [String] -> Bool
forall (t :: * -> *) a. (Foldable t, Eq a) => a -> t a -> Bool
`notElem` [String
"target-package-db"])
(String -> Bool)
-> (OptionField InstallFlags -> String)
-> OptionField InstallFlags
-> Bool
forall b c a. (b -> c) -> (a -> b) -> a -> c
. OptionField InstallFlags -> String
forall a. OptionField a -> String
optionName
)
([OptionField InstallFlags] -> [OptionField InstallFlags])
-> [OptionField InstallFlags] -> [OptionField InstallFlags]
forall a b. (a -> b) -> a -> b
$ ShowOrParseArgs -> [OptionField InstallFlags]
installOptions ShowOrParseArgs
showOrParseArgs
)
[OptionField
(ConfigFlags, ConfigExFlags, InstallFlags, HaddockFlags, TestFlags,
BenchmarkFlags)]
-> [OptionField
(ConfigFlags, ConfigExFlags, InstallFlags, HaddockFlags, TestFlags,
BenchmarkFlags)]
-> [OptionField
(ConfigFlags, ConfigExFlags, InstallFlags, HaddockFlags, TestFlags,
BenchmarkFlags)]
forall a. [a] -> [a] -> [a]
++ ((ConfigFlags, ConfigExFlags, InstallFlags, HaddockFlags,
TestFlags, BenchmarkFlags)
-> HaddockFlags)
-> (HaddockFlags
-> (ConfigFlags, ConfigExFlags, InstallFlags, HaddockFlags,
TestFlags, BenchmarkFlags)
-> (ConfigFlags, ConfigExFlags, InstallFlags, HaddockFlags,
TestFlags, BenchmarkFlags))
-> [OptionField HaddockFlags]
-> [OptionField
(ConfigFlags, ConfigExFlags, InstallFlags, HaddockFlags, TestFlags,
BenchmarkFlags)]
forall b a.
(b -> a) -> (a -> b -> b) -> [OptionField a] -> [OptionField b]
liftOptions (ConfigFlags, ConfigExFlags, InstallFlags, HaddockFlags, TestFlags,
BenchmarkFlags)
-> HaddockFlags
forall {a} {b} {c} {d} {e} {f}. (a, b, c, d, e, f) -> d
get4 HaddockFlags
-> (ConfigFlags, ConfigExFlags, InstallFlags, HaddockFlags,
TestFlags, BenchmarkFlags)
-> (ConfigFlags, ConfigExFlags, InstallFlags, HaddockFlags,
TestFlags, BenchmarkFlags)
forall {d} {a} {b} {c} {d} {e} {f}.
d -> (a, b, c, d, e, f) -> (a, b, c, d, e, f)
set4 (ShowOrParseArgs -> [OptionField HaddockFlags]
haddockOptions ShowOrParseArgs
showOrParseArgs)
[OptionField
(ConfigFlags, ConfigExFlags, InstallFlags, HaddockFlags, TestFlags,
BenchmarkFlags)]
-> [OptionField
(ConfigFlags, ConfigExFlags, InstallFlags, HaddockFlags, TestFlags,
BenchmarkFlags)]
-> [OptionField
(ConfigFlags, ConfigExFlags, InstallFlags, HaddockFlags, TestFlags,
BenchmarkFlags)]
forall a. [a] -> [a] -> [a]
++ ((ConfigFlags, ConfigExFlags, InstallFlags, HaddockFlags,
TestFlags, BenchmarkFlags)
-> TestFlags)
-> (TestFlags
-> (ConfigFlags, ConfigExFlags, InstallFlags, HaddockFlags,
TestFlags, BenchmarkFlags)
-> (ConfigFlags, ConfigExFlags, InstallFlags, HaddockFlags,
TestFlags, BenchmarkFlags))
-> [OptionField TestFlags]
-> [OptionField
(ConfigFlags, ConfigExFlags, InstallFlags, HaddockFlags, TestFlags,
BenchmarkFlags)]
forall b a.
(b -> a) -> (a -> b -> b) -> [OptionField a] -> [OptionField b]
liftOptions (ConfigFlags, ConfigExFlags, InstallFlags, HaddockFlags, TestFlags,
BenchmarkFlags)
-> TestFlags
forall {a} {b} {c} {d} {e} {f}. (a, b, c, d, e, f) -> e
get5 TestFlags
-> (ConfigFlags, ConfigExFlags, InstallFlags, HaddockFlags,
TestFlags, BenchmarkFlags)
-> (ConfigFlags, ConfigExFlags, InstallFlags, HaddockFlags,
TestFlags, BenchmarkFlags)
forall {e} {a} {b} {c} {d} {e} {f}.
e -> (a, b, c, d, e, f) -> (a, b, c, d, e, f)
set5 (ShowOrParseArgs -> [OptionField TestFlags]
testOptions ShowOrParseArgs
showOrParseArgs)
[OptionField
(ConfigFlags, ConfigExFlags, InstallFlags, HaddockFlags, TestFlags,
BenchmarkFlags)]
-> [OptionField
(ConfigFlags, ConfigExFlags, InstallFlags, HaddockFlags, TestFlags,
BenchmarkFlags)]
-> [OptionField
(ConfigFlags, ConfigExFlags, InstallFlags, HaddockFlags, TestFlags,
BenchmarkFlags)]
forall a. [a] -> [a] -> [a]
++ ((ConfigFlags, ConfigExFlags, InstallFlags, HaddockFlags,
TestFlags, BenchmarkFlags)
-> BenchmarkFlags)
-> (BenchmarkFlags
-> (ConfigFlags, ConfigExFlags, InstallFlags, HaddockFlags,
TestFlags, BenchmarkFlags)
-> (ConfigFlags, ConfigExFlags, InstallFlags, HaddockFlags,
TestFlags, BenchmarkFlags))
-> [OptionField BenchmarkFlags]
-> [OptionField
(ConfigFlags, ConfigExFlags, InstallFlags, HaddockFlags, TestFlags,
BenchmarkFlags)]
forall b a.
(b -> a) -> (a -> b -> b) -> [OptionField a] -> [OptionField b]
liftOptions (ConfigFlags, ConfigExFlags, InstallFlags, HaddockFlags, TestFlags,
BenchmarkFlags)
-> BenchmarkFlags
forall {a} {b} {c} {d} {e} {f}. (a, b, c, d, e, f) -> f
get6 BenchmarkFlags
-> (ConfigFlags, ConfigExFlags, InstallFlags, HaddockFlags,
TestFlags, BenchmarkFlags)
-> (ConfigFlags, ConfigExFlags, InstallFlags, HaddockFlags,
TestFlags, BenchmarkFlags)
forall {f} {a} {b} {c} {d} {e} {f}.
f -> (a, b, c, d, e, f) -> (a, b, c, d, e, f)
set6 (ShowOrParseArgs -> [OptionField BenchmarkFlags]
benchmarkOptions ShowOrParseArgs
showOrParseArgs)
}
where
get1 :: (a, b, c, d, e, f) -> a
get1 (a
a, b
_, c
_, d
_, e
_, f
_) = a
a
set1 :: a -> (a, b, c, d, e, f) -> (a, b, c, d, e, f)
set1 a
a (a
_, b
b, c
c, d
d, e
e, f
f) = (a
a, b
b, c
c, d
d, e
e, f
f)
get2 :: (a, b, c, d, e, f) -> b
get2 (a
_, b
b, c
_, d
_, e
_, f
_) = b
b
set2 :: b -> (a, b, c, d, e, f) -> (a, b, c, d, e, f)
set2 b
b (a
a, b
_, c
c, d
d, e
e, f
f) = (a
a, b
b, c
c, d
d, e
e, f
f)
get3 :: (a, b, c, d, e, f) -> c
get3 (a
_, b
_, c
c, d
_, e
_, f
_) = c
c
set3 :: c -> (a, b, c, d, e, f) -> (a, b, c, d, e, f)
set3 c
c (a
a, b
b, c
_, d
d, e
e, f
f) = (a
a, b
b, c
c, d
d, e
e, f
f)
get4 :: (a, b, c, d, e, f) -> d
get4 (a
_, b
_, c
_, d
d, e
_, f
_) = d
d
set4 :: d -> (a, b, c, d, e, f) -> (a, b, c, d, e, f)
set4 d
d (a
a, b
b, c
c, d
_, e
e, f
f) = (a
a, b
b, c
c, d
d, e
e, f
f)
get5 :: (a, b, c, d, e, f) -> e
get5 (a
_, b
_, c
_, d
_, e
e, f
_) = e
e
set5 :: e -> (a, b, c, d, e, f) -> (a, b, c, d, e, f)
set5 e
e (a
a, b
b, c
c, d
d, e
_, f
f) = (a
a, b
b, c
c, d
d, e
e, f
f)
get6 :: (a, b, c, d, e, f) -> f
get6 (a
_, b
_, c
_, d
_, e
_, f
f) = f
f
set6 :: f -> (a, b, c, d, e, f) -> (a, b, c, d, e, f)
set6 f
f (a
a, b
b, c
c, d
d, e
e, f
_) = (a
a, b
b, c
c, d
d, e
e, f
f)
haddockCommand :: CommandUI HaddockFlags
haddockCommand :: CommandUI HaddockFlags
haddockCommand =
CommandUI HaddockFlags
Cabal.haddockCommand
{ commandUsage =
usageAlternatives "v1-haddock" $
["[FLAGS]", "COMPONENTS [FLAGS]"]
}
filterHaddockArgs :: [String] -> Version -> [String]
filterHaddockArgs :: [String] -> Version -> [String]
filterHaddockArgs [String]
args Version
cabalLibVersion
| Version
cabalLibVersion Version -> Version -> Bool
forall a. Ord a => a -> a -> Bool
>= [Int] -> Version
mkVersion [Int
2, Int
3, Int
0] = [String]
args_latest
| Version
cabalLibVersion Version -> Version -> Bool
forall a. Ord a => a -> a -> Bool
< [Int] -> Version
mkVersion [Int
2, Int
3, Int
0] = [String]
forall a. [a]
args_2_3_0
| Bool
otherwise = [String]
args_latest
where
args_latest :: [String]
args_latest = [String]
args
args_2_3_0 :: [a]
args_2_3_0 = []
filterHaddockFlags :: HaddockFlags -> Version -> HaddockFlags
filterHaddockFlags :: HaddockFlags -> Version -> HaddockFlags
filterHaddockFlags HaddockFlags
flags Version
cabalLibVersion
| Version
cabalLibVersion Version -> Version -> Bool
forall a. Ord a => a -> a -> Bool
>= [Int] -> Version
mkVersion [Int
2, Int
3, Int
0] = HaddockFlags
flags_latest
| Version
cabalLibVersion Version -> Version -> Bool
forall a. Ord a => a -> a -> Bool
< [Int] -> Version
mkVersion [Int
2, Int
3, Int
0] = HaddockFlags
flags_2_3_0
| Bool
otherwise = HaddockFlags
flags_latest
where
flags_latest :: HaddockFlags
flags_latest =
HaddockFlags
flags
{ haddockCommonFlags =
(filterCommonFlags (haddockCommonFlags flags) cabalLibVersion)
{
setupKeepTempFiles = setupKeepTempFiles (haddockCommonFlags flags)
}
}
flags_2_3_0 :: HaddockFlags
flags_2_3_0 =
HaddockFlags
flags_latest
{
haddockCommonFlags =
(haddockCommonFlags flags_latest)
{ setupTargets = []
}
}
haddockOptions :: ShowOrParseArgs -> [OptionField HaddockFlags]
haddockOptions :: ShowOrParseArgs -> [OptionField HaddockFlags]
haddockOptions ShowOrParseArgs
showOrParseArgs =
[ OptionField HaddockFlags
opt
{ optionName = "haddock-" ++ name
, optionDescr =
[ fmapOptFlags (\(String
_, [String]
lflags) -> ([], (String -> String) -> [String] -> [String]
forall a b. (a -> b) -> [a] -> [b]
map (String
"haddock-" String -> String -> String
forall a. [a] -> [a] -> [a]
++) [String]
lflags)) descr
| descr <- optionDescr opt
]
}
| OptionField HaddockFlags
opt <- CommandUI HaddockFlags
-> ShowOrParseArgs -> [OptionField HaddockFlags]
forall flags.
CommandUI flags -> ShowOrParseArgs -> [OptionField flags]
commandOptions CommandUI HaddockFlags
Cabal.haddockCommand ShowOrParseArgs
showOrParseArgs
, let name :: String
name = OptionField HaddockFlags -> String
forall a. OptionField a -> String
optionName OptionField HaddockFlags
opt
, String
name
String -> [String] -> Bool
forall a. Eq a => a -> [a] -> Bool
forall (t :: * -> *) a. (Foldable t, Eq a) => a -> t a -> Bool
`elem` [ String
"hoogle"
, String
"html"
, String
"html-location"
, String
"executables"
, String
"tests"
, String
"benchmarks"
, String
"all"
, String
"internal"
, String
"css"
, String
"hyperlink-source"
, String
"quickjump"
, String
"hscolour-css"
, String
"contents-location"
, String
"use-index"
, String
"for-hackage"
, String
"base-url"
, String
"resources-dir"
, String
"output-dir"
, String
"use-unicode"
]
]
testOptions :: ShowOrParseArgs -> [OptionField TestFlags]
testOptions :: ShowOrParseArgs -> [OptionField TestFlags]
testOptions ShowOrParseArgs
showOrParseArgs =
[ OptionField TestFlags
opt
{ optionName = prefixTest name
, optionDescr =
[ fmapOptFlags (\(String
_, [String]
lflags) -> ([], (String -> String) -> [String] -> [String]
forall a b. (a -> b) -> [a] -> [b]
map String -> String
prefixTest [String]
lflags)) descr
| descr <- optionDescr opt
]
}
| OptionField TestFlags
opt <- CommandUI TestFlags -> ShowOrParseArgs -> [OptionField TestFlags]
forall flags.
CommandUI flags -> ShowOrParseArgs -> [OptionField flags]
commandOptions CommandUI TestFlags
Cabal.testCommand ShowOrParseArgs
showOrParseArgs
, let name :: String
name = OptionField TestFlags -> String
forall a. OptionField a -> String
optionName OptionField TestFlags
opt
, String
name
String -> [String] -> Bool
forall a. Eq a => a -> [a] -> Bool
forall (t :: * -> *) a. (Foldable t, Eq a) => a -> t a -> Bool
`elem` [ String
"log"
, String
"machine-log"
, String
"show-details"
, String
"keep-tix-files"
, String
"fail-when-no-test-suites"
, String
"test-options"
, String
"test-option"
, String
"test-wrapper"
]
]
where
prefixTest :: String -> String
prefixTest String
name
| String
"test-" String -> String -> Bool
forall a. Eq a => [a] -> [a] -> Bool
`isPrefixOf` String
name = String
name
| Bool
otherwise = String
"test-" String -> String -> String
forall a. [a] -> [a] -> [a]
++ String
name
benchmarkOptions :: ShowOrParseArgs -> [OptionField BenchmarkFlags]
benchmarkOptions :: ShowOrParseArgs -> [OptionField BenchmarkFlags]
benchmarkOptions ShowOrParseArgs
showOrParseArgs =
[ OptionField BenchmarkFlags
opt
{ optionName = prefixBenchmark name
, optionDescr =
[ fmapOptFlags (\(String
_, [String]
lflags) -> ([], (String -> String) -> [String] -> [String]
forall a b. (a -> b) -> [a] -> [b]
map String -> String
prefixBenchmark [String]
lflags)) descr
| descr <- optionDescr opt
]
}
| OptionField BenchmarkFlags
opt <- CommandUI BenchmarkFlags
-> ShowOrParseArgs -> [OptionField BenchmarkFlags]
forall flags.
CommandUI flags -> ShowOrParseArgs -> [OptionField flags]
commandOptions CommandUI BenchmarkFlags
Cabal.benchmarkCommand ShowOrParseArgs
showOrParseArgs
, let name :: String
name = OptionField BenchmarkFlags -> String
forall a. OptionField a -> String
optionName OptionField BenchmarkFlags
opt
, String
name String -> [String] -> Bool
forall a. Eq a => a -> [a] -> Bool
forall (t :: * -> *) a. (Foldable t, Eq a) => a -> t a -> Bool
`elem` [String
"benchmark-options", String
"benchmark-option"]
]
where
prefixBenchmark :: String -> String
prefixBenchmark String
name
| String
"benchmark-" String -> String -> Bool
forall a. Eq a => [a] -> [a] -> Bool
`isPrefixOf` String
name = String
name
| Bool
otherwise = String
"benchmark-" String -> String -> String
forall a. [a] -> [a] -> [a]
++ String
name
fmapOptFlags :: (OptFlags -> OptFlags) -> OptDescr a -> OptDescr a
fmapOptFlags :: forall a. (OptFlags -> OptFlags) -> OptDescr a -> OptDescr a
fmapOptFlags OptFlags -> OptFlags
modify (ReqArg String
d OptFlags
f String
p ReadE (a -> a)
r a -> [String]
w) = String
-> OptFlags
-> String
-> ReadE (a -> a)
-> (a -> [String])
-> OptDescr a
forall a.
String
-> OptFlags
-> String
-> ReadE (a -> a)
-> (a -> [String])
-> OptDescr a
ReqArg String
d (OptFlags -> OptFlags
modify OptFlags
f) String
p ReadE (a -> a)
r a -> [String]
w
fmapOptFlags OptFlags -> OptFlags
modify (OptArg String
d OptFlags
f String
p ReadE (a -> a)
r (String, a -> a)
i a -> [Maybe String]
w) = String
-> OptFlags
-> String
-> ReadE (a -> a)
-> (String, a -> a)
-> (a -> [Maybe String])
-> OptDescr a
forall a.
String
-> OptFlags
-> String
-> ReadE (a -> a)
-> (String, a -> a)
-> (a -> [Maybe String])
-> OptDescr a
OptArg String
d (OptFlags -> OptFlags
modify OptFlags
f) String
p ReadE (a -> a)
r (String, a -> a)
i a -> [Maybe String]
w
fmapOptFlags OptFlags -> OptFlags
modify (ChoiceOpt [(String, OptFlags, a -> a, a -> Bool)]
xs) = [(String, OptFlags, a -> a, a -> Bool)] -> OptDescr a
forall a. [(String, OptFlags, a -> a, a -> Bool)] -> OptDescr a
ChoiceOpt [(String
d, OptFlags -> OptFlags
modify OptFlags
f, a -> a
i, a -> Bool
w) | (String
d, OptFlags
f, a -> a
i, a -> Bool
w) <- [(String, OptFlags, a -> a, a -> Bool)]
xs]
fmapOptFlags OptFlags -> OptFlags
modify (BoolOpt String
d OptFlags
f1 OptFlags
f2 Bool -> a -> a
r a -> Maybe Bool
w) = String
-> OptFlags
-> OptFlags
-> (Bool -> a -> a)
-> (a -> Maybe Bool)
-> OptDescr a
forall a.
String
-> OptFlags
-> OptFlags
-> (Bool -> a -> a)
-> (a -> Maybe Bool)
-> OptDescr a
BoolOpt String
d (OptFlags -> OptFlags
modify OptFlags
f1) (OptFlags -> OptFlags
modify OptFlags
f2) Bool -> a -> a
r a -> Maybe Bool
w
installOptions :: ShowOrParseArgs -> [OptionField InstallFlags]
installOptions :: ShowOrParseArgs -> [OptionField InstallFlags]
installOptions ShowOrParseArgs
showOrParseArgs =
[ String
-> [String]
-> String
-> (InstallFlags -> Last Bool)
-> (Last Bool -> InstallFlags -> InstallFlags)
-> MkOptDescr
(InstallFlags -> Last Bool)
(Last Bool -> InstallFlags -> InstallFlags)
InstallFlags
-> OptionField InstallFlags
forall get set a.
String
-> [String]
-> String
-> get
-> set
-> MkOptDescr get set a
-> OptionField a
option
String
""
[String
"documentation"]
String
"building of documentation"
InstallFlags -> Last Bool
installDocumentation
(\Last Bool
v InstallFlags
flags -> InstallFlags
flags{installDocumentation = v})
(String
-> String
-> MkOptDescr
(InstallFlags -> Last Bool)
(Last Bool -> InstallFlags -> InstallFlags)
InstallFlags
forall a.
String
-> String -> MkOptDescr (a -> Last Bool) (Last Bool -> a -> a) a
boolOpt [] [])
, String
-> [String]
-> String
-> (InstallFlags -> Last PathTemplate)
-> (Last PathTemplate -> InstallFlags -> InstallFlags)
-> MkOptDescr
(InstallFlags -> Last PathTemplate)
(Last PathTemplate -> InstallFlags -> InstallFlags)
InstallFlags
-> OptionField InstallFlags
forall get set a.
String
-> [String]
-> String
-> get
-> set
-> MkOptDescr get set a
-> OptionField a
option
[]
[String
"doc-index-file"]
String
"A central index of haddock API documentation (template cannot use $pkgid)"
InstallFlags -> Last PathTemplate
installHaddockIndex
(\Last PathTemplate
v InstallFlags
flags -> InstallFlags
flags{installHaddockIndex = v})
( String
-> (String -> Last PathTemplate)
-> (Last PathTemplate -> [String])
-> MkOptDescr
(InstallFlags -> Last PathTemplate)
(Last PathTemplate -> InstallFlags -> InstallFlags)
InstallFlags
forall b a.
Monoid b =>
String
-> (String -> b)
-> (b -> [String])
-> MkOptDescr (a -> b) (b -> a -> a) a
reqArg'
String
"TEMPLATE"
(PathTemplate -> Last PathTemplate
forall a. a -> Last a
toFlag (PathTemplate -> Last PathTemplate)
-> (String -> PathTemplate) -> String -> Last PathTemplate
forall b c a. (b -> c) -> (a -> b) -> a -> c
. String -> PathTemplate
toPathTemplate)
(Last String -> [String]
forall a. Flag a -> [a]
flagToList (Last String -> [String])
-> (Last PathTemplate -> Last String)
-> Last PathTemplate
-> [String]
forall b c a. (b -> c) -> (a -> b) -> a -> c
. (PathTemplate -> String) -> Last PathTemplate -> Last String
forall a b. (a -> b) -> Last a -> Last b
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
fmap PathTemplate -> String
fromPathTemplate)
)
, String
-> [String]
-> String
-> (InstallFlags -> Last Bool)
-> (Last Bool -> InstallFlags -> InstallFlags)
-> MkOptDescr
(InstallFlags -> Last Bool)
(Last Bool -> InstallFlags -> InstallFlags)
InstallFlags
-> OptionField InstallFlags
forall get set a.
String
-> [String]
-> String
-> get
-> set
-> MkOptDescr get set a
-> OptionField a
option
[]
[String
"dry-run"]
String
"Do not install anything, only print what would be installed."
InstallFlags -> Last Bool
installDryRun
(\Last Bool
v InstallFlags
flags -> InstallFlags
flags{installDryRun = v})
MkOptDescr
(InstallFlags -> Last Bool)
(Last Bool -> InstallFlags -> InstallFlags)
InstallFlags
forall a. MkOptDescr (a -> Last Bool) (Last Bool -> a -> a) a
trueArg
, String
-> [String]
-> String
-> (InstallFlags -> Last Bool)
-> (Last Bool -> InstallFlags -> InstallFlags)
-> MkOptDescr
(InstallFlags -> Last Bool)
(Last Bool -> InstallFlags -> InstallFlags)
InstallFlags
-> OptionField InstallFlags
forall get set a.
String
-> [String]
-> String
-> get
-> set
-> MkOptDescr get set a
-> OptionField a
option
[]
[String
"only-download"]
String
"Do not build anything, only fetch the packages."
InstallFlags -> Last Bool
installOnlyDownload
(\Last Bool
v InstallFlags
flags -> InstallFlags
flags{installOnlyDownload = v})
MkOptDescr
(InstallFlags -> Last Bool)
(Last Bool -> InstallFlags -> InstallFlags)
InstallFlags
forall a. MkOptDescr (a -> Last Bool) (Last Bool -> a -> a) a
trueArg
, String
-> [String]
-> String
-> (InstallFlags -> Last CopyDest)
-> (Last CopyDest -> InstallFlags -> InstallFlags)
-> MkOptDescr
(InstallFlags -> Last CopyDest)
(Last CopyDest -> InstallFlags -> InstallFlags)
InstallFlags
-> OptionField InstallFlags
forall get set a.
String
-> [String]
-> String
-> get
-> set
-> MkOptDescr get set a
-> OptionField a
option
String
""
[String
"target-package-db"]
String
"package database to install into. Required when using ${pkgroot} prefix."
InstallFlags -> Last CopyDest
installDest
(\Last CopyDest
v InstallFlags
flags -> InstallFlags
flags{installDest = v})
( String
-> ReadE (Last CopyDest)
-> (Last CopyDest -> [String])
-> MkOptDescr
(InstallFlags -> Last CopyDest)
(Last CopyDest -> InstallFlags -> InstallFlags)
InstallFlags
forall b a.
Monoid b =>
String
-> ReadE b
-> (b -> [String])
-> MkOptDescr (a -> b) (b -> a -> a) a
reqArg
String
"DATABASE"
((String -> Last CopyDest) -> ReadE (Last CopyDest)
forall a. (String -> a) -> ReadE a
succeedReadE (CopyDest -> Last CopyDest
forall a. a -> Last a
Flag (CopyDest -> Last CopyDest)
-> (String -> CopyDest) -> String -> Last CopyDest
forall b c a. (b -> c) -> (a -> b) -> a -> c
. String -> CopyDest
Cabal.CopyToDb))
(\Last CopyDest
f -> case Last CopyDest
f of Flag (Cabal.CopyToDb String
p) -> [String
p]; Last CopyDest
_ -> [])
)
]
[OptionField InstallFlags]
-> [OptionField InstallFlags] -> [OptionField InstallFlags]
forall a. [a] -> [a] -> [a]
++ ShowOrParseArgs
-> (InstallFlags -> Flag Int)
-> (Flag Int -> InstallFlags -> InstallFlags)
-> (InstallFlags -> Flag ReorderGoals)
-> (Flag ReorderGoals -> InstallFlags -> InstallFlags)
-> (InstallFlags -> Flag CountConflicts)
-> (Flag CountConflicts -> InstallFlags -> InstallFlags)
-> (InstallFlags -> Flag FineGrainedConflicts)
-> (Flag FineGrainedConflicts -> InstallFlags -> InstallFlags)
-> (InstallFlags -> Flag MinimizeConflictSet)
-> (Flag MinimizeConflictSet -> InstallFlags -> InstallFlags)
-> (InstallFlags -> Flag IndependentGoals)
-> (Flag IndependentGoals -> InstallFlags -> InstallFlags)
-> (InstallFlags -> Flag PreferOldest)
-> (Flag PreferOldest -> InstallFlags -> InstallFlags)
-> (InstallFlags -> Flag ShadowPkgs)
-> (Flag ShadowPkgs -> InstallFlags -> InstallFlags)
-> (InstallFlags -> Flag StrongFlags)
-> (Flag StrongFlags -> InstallFlags -> InstallFlags)
-> (InstallFlags -> Flag AllowBootLibInstalls)
-> (Flag AllowBootLibInstalls -> InstallFlags -> InstallFlags)
-> (InstallFlags -> Flag OnlyConstrained)
-> (Flag OnlyConstrained -> InstallFlags -> InstallFlags)
-> [OptionField InstallFlags]
forall flags.
ShowOrParseArgs
-> (flags -> Flag Int)
-> (Flag Int -> flags -> flags)
-> (flags -> Flag ReorderGoals)
-> (Flag ReorderGoals -> flags -> flags)
-> (flags -> Flag CountConflicts)
-> (Flag CountConflicts -> flags -> flags)
-> (flags -> Flag FineGrainedConflicts)
-> (Flag FineGrainedConflicts -> flags -> flags)
-> (flags -> Flag MinimizeConflictSet)
-> (Flag MinimizeConflictSet -> flags -> flags)
-> (flags -> Flag IndependentGoals)
-> (Flag IndependentGoals -> flags -> flags)
-> (flags -> Flag PreferOldest)
-> (Flag PreferOldest -> flags -> flags)
-> (flags -> Flag ShadowPkgs)
-> (Flag ShadowPkgs -> flags -> flags)
-> (flags -> Flag StrongFlags)
-> (Flag StrongFlags -> flags -> flags)
-> (flags -> Flag AllowBootLibInstalls)
-> (Flag AllowBootLibInstalls -> flags -> flags)
-> (flags -> Flag OnlyConstrained)
-> (Flag OnlyConstrained -> flags -> flags)
-> [OptionField flags]
optionSolverFlags
ShowOrParseArgs
showOrParseArgs
InstallFlags -> Flag Int
installMaxBackjumps
(\Flag Int
v InstallFlags
flags -> InstallFlags
flags{installMaxBackjumps = v})
InstallFlags -> Flag ReorderGoals
installReorderGoals
(\Flag ReorderGoals
v InstallFlags
flags -> InstallFlags
flags{installReorderGoals = v})
InstallFlags -> Flag CountConflicts
installCountConflicts
(\Flag CountConflicts
v InstallFlags
flags -> InstallFlags
flags{installCountConflicts = v})
InstallFlags -> Flag FineGrainedConflicts
installFineGrainedConflicts
(\Flag FineGrainedConflicts
v InstallFlags
flags -> InstallFlags
flags{installFineGrainedConflicts = v})
InstallFlags -> Flag MinimizeConflictSet
installMinimizeConflictSet
(\Flag MinimizeConflictSet
v InstallFlags
flags -> InstallFlags
flags{installMinimizeConflictSet = v})
InstallFlags -> Flag IndependentGoals
installIndependentGoals
(\Flag IndependentGoals
v InstallFlags
flags -> InstallFlags
flags{installIndependentGoals = v})
InstallFlags -> Flag PreferOldest
installPreferOldest
(\Flag PreferOldest
v InstallFlags
flags -> InstallFlags
flags{installPreferOldest = v})
InstallFlags -> Flag ShadowPkgs
installShadowPkgs
(\Flag ShadowPkgs
v InstallFlags
flags -> InstallFlags
flags{installShadowPkgs = v})
InstallFlags -> Flag StrongFlags
installStrongFlags
(\Flag StrongFlags
v InstallFlags
flags -> InstallFlags
flags{installStrongFlags = v})
InstallFlags -> Flag AllowBootLibInstalls
installAllowBootLibInstalls
(\Flag AllowBootLibInstalls
v InstallFlags
flags -> InstallFlags
flags{installAllowBootLibInstalls = v})
InstallFlags -> Flag OnlyConstrained
installOnlyConstrained
(\Flag OnlyConstrained
v InstallFlags
flags -> InstallFlags
flags{installOnlyConstrained = v})
[OptionField InstallFlags]
-> [OptionField InstallFlags] -> [OptionField InstallFlags]
forall a. [a] -> [a] -> [a]
++ [ String
-> [String]
-> String
-> (InstallFlags -> Last Bool)
-> (Last Bool -> InstallFlags -> InstallFlags)
-> MkOptDescr
(InstallFlags -> Last Bool)
(Last Bool -> InstallFlags -> InstallFlags)
InstallFlags
-> OptionField InstallFlags
forall get set a.
String
-> [String]
-> String
-> get
-> set
-> MkOptDescr get set a
-> OptionField a
option
[]
[String
"reinstall"]
String
"Install even if it means installing the same version again."
InstallFlags -> Last Bool
installReinstall
(\Last Bool
v InstallFlags
flags -> InstallFlags
flags{installReinstall = v})
(ShowOrParseArgs
-> MkOptDescr
(InstallFlags -> Last Bool)
(Last Bool -> InstallFlags -> InstallFlags)
InstallFlags
forall b.
ShowOrParseArgs
-> MkOptDescr (b -> Last Bool) (Last Bool -> b -> b) b
yesNoOpt ShowOrParseArgs
showOrParseArgs)
, String
-> [String]
-> String
-> (InstallFlags -> Last Bool)
-> (Last Bool -> InstallFlags -> InstallFlags)
-> MkOptDescr
(InstallFlags -> Last Bool)
(Last Bool -> InstallFlags -> InstallFlags)
InstallFlags
-> OptionField InstallFlags
forall get set a.
String
-> [String]
-> String
-> get
-> set
-> MkOptDescr get set a
-> OptionField a
option
[]
[String
"avoid-reinstalls"]
String
"Do not select versions that would destructively overwrite installed packages."
((AvoidReinstalls -> Bool) -> Flag AvoidReinstalls -> Last Bool
forall a b. (a -> b) -> Last a -> Last b
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
fmap AvoidReinstalls -> Bool
forall a. BooleanFlag a => a -> Bool
asBool (Flag AvoidReinstalls -> Last Bool)
-> (InstallFlags -> Flag AvoidReinstalls)
-> InstallFlags
-> Last Bool
forall b c a. (b -> c) -> (a -> b) -> a -> c
. InstallFlags -> Flag AvoidReinstalls
installAvoidReinstalls)
(\Last Bool
v InstallFlags
flags -> InstallFlags
flags{installAvoidReinstalls = fmap AvoidReinstalls v})
(ShowOrParseArgs
-> MkOptDescr
(InstallFlags -> Last Bool)
(Last Bool -> InstallFlags -> InstallFlags)
InstallFlags
forall b.
ShowOrParseArgs
-> MkOptDescr (b -> Last Bool) (Last Bool -> b -> b) b
yesNoOpt ShowOrParseArgs
showOrParseArgs)
, String
-> [String]
-> String
-> (InstallFlags -> Last Bool)
-> (Last Bool -> InstallFlags -> InstallFlags)
-> MkOptDescr
(InstallFlags -> Last Bool)
(Last Bool -> InstallFlags -> InstallFlags)
InstallFlags
-> OptionField InstallFlags
forall get set a.
String
-> [String]
-> String
-> get
-> set
-> MkOptDescr get set a
-> OptionField a
option
[]
[String
"force-reinstalls"]
String
"Reinstall packages even if they will most likely break other installed packages."
InstallFlags -> Last Bool
installOverrideReinstall
(\Last Bool
v InstallFlags
flags -> InstallFlags
flags{installOverrideReinstall = v})
(ShowOrParseArgs
-> MkOptDescr
(InstallFlags -> Last Bool)
(Last Bool -> InstallFlags -> InstallFlags)
InstallFlags
forall b.
ShowOrParseArgs
-> MkOptDescr (b -> Last Bool) (Last Bool -> b -> b) b
yesNoOpt ShowOrParseArgs
showOrParseArgs)
, String
-> [String]
-> String
-> (InstallFlags -> Last Bool)
-> (Last Bool -> InstallFlags -> InstallFlags)
-> MkOptDescr
(InstallFlags -> Last Bool)
(Last Bool -> InstallFlags -> InstallFlags)
InstallFlags
-> OptionField InstallFlags
forall get set a.
String
-> [String]
-> String
-> get
-> set
-> MkOptDescr get set a
-> OptionField a
option
[]
[String
"upgrade-dependencies"]
String
"Pick the latest version for all dependencies, rather than trying to pick an installed version."
InstallFlags -> Last Bool
installUpgradeDeps
(\Last Bool
v InstallFlags
flags -> InstallFlags
flags{installUpgradeDeps = v})
(ShowOrParseArgs
-> MkOptDescr
(InstallFlags -> Last Bool)
(Last Bool -> InstallFlags -> InstallFlags)
InstallFlags
forall b.
ShowOrParseArgs
-> MkOptDescr (b -> Last Bool) (Last Bool -> b -> b) b
yesNoOpt ShowOrParseArgs
showOrParseArgs)
, String
-> [String]
-> String
-> (InstallFlags -> Last Bool)
-> (Last Bool -> InstallFlags -> InstallFlags)
-> MkOptDescr
(InstallFlags -> Last Bool)
(Last Bool -> InstallFlags -> InstallFlags)
InstallFlags
-> OptionField InstallFlags
forall get set a.
String
-> [String]
-> String
-> get
-> set
-> MkOptDescr get set a
-> OptionField a
option
[]
[String
"only-dependencies"]
String
"Install only the dependencies necessary to build the given packages"
InstallFlags -> Last Bool
installOnlyDeps
(\Last Bool
v InstallFlags
flags -> InstallFlags
flags{installOnlyDeps = v})
(ShowOrParseArgs
-> MkOptDescr
(InstallFlags -> Last Bool)
(Last Bool -> InstallFlags -> InstallFlags)
InstallFlags
forall b.
ShowOrParseArgs
-> MkOptDescr (b -> Last Bool) (Last Bool -> b -> b) b
yesNoOpt ShowOrParseArgs
showOrParseArgs)
, String
-> [String]
-> String
-> (InstallFlags -> Last Bool)
-> (Last Bool -> InstallFlags -> InstallFlags)
-> MkOptDescr
(InstallFlags -> Last Bool)
(Last Bool -> InstallFlags -> InstallFlags)
InstallFlags
-> OptionField InstallFlags
forall get set a.
String
-> [String]
-> String
-> get
-> set
-> MkOptDescr get set a
-> OptionField a
option
[]
[String
"dependencies-only"]
String
"A synonym for --only-dependencies"
InstallFlags -> Last Bool
installOnlyDeps
(\Last Bool
v InstallFlags
flags -> InstallFlags
flags{installOnlyDeps = v})
(ShowOrParseArgs
-> MkOptDescr
(InstallFlags -> Last Bool)
(Last Bool -> InstallFlags -> InstallFlags)
InstallFlags
forall b.
ShowOrParseArgs
-> MkOptDescr (b -> Last Bool) (Last Bool -> b -> b) b
yesNoOpt ShowOrParseArgs
showOrParseArgs)
, String
-> [String]
-> String
-> (InstallFlags -> Last TotalIndexState)
-> (Last TotalIndexState -> InstallFlags -> InstallFlags)
-> MkOptDescr
(InstallFlags -> Last TotalIndexState)
(Last TotalIndexState -> InstallFlags -> InstallFlags)
InstallFlags
-> OptionField InstallFlags
forall get set a.
String
-> [String]
-> String
-> get
-> set
-> MkOptDescr get set a
-> OptionField a
option
[]
[String
"index-state"]
( String
"Use source package index state as it existed at a previous time. "
String -> String -> String
forall a. [a] -> [a] -> [a]
++ String
"Accepts unix-timestamps (e.g. '@1474732068'), ISO8601 UTC timestamps "
String -> String -> String
forall a. [a] -> [a] -> [a]
++ String
"(e.g. '2016-09-24T17:47:48Z'), or 'HEAD' (default: 'HEAD')."
)
InstallFlags -> Last TotalIndexState
installIndexState
(\Last TotalIndexState
v InstallFlags
flags -> InstallFlags
flags{installIndexState = v})
( String
-> ReadE (Last TotalIndexState)
-> (Last TotalIndexState -> [String])
-> MkOptDescr
(InstallFlags -> Last TotalIndexState)
(Last TotalIndexState -> InstallFlags -> InstallFlags)
InstallFlags
forall b a.
Monoid b =>
String
-> ReadE b
-> (b -> [String])
-> MkOptDescr (a -> b) (b -> a -> a) a
reqArg
String
"STATE"
( (String -> String)
-> ParsecParser (Last TotalIndexState)
-> ReadE (Last TotalIndexState)
forall a. (String -> String) -> ParsecParser a -> ReadE a
parsecToReadE
( String -> String -> String
forall a b. a -> b -> a
const (String -> String -> String) -> String -> String -> String
forall a b. (a -> b) -> a -> b
$
String
"index-state must be a "
String -> String -> String
forall a. [a] -> [a] -> [a]
++ String
"unix-timestamps (e.g. '@1474732068'), "
String -> String -> String
forall a. [a] -> [a] -> [a]
++ String
"a ISO8601 UTC timestamp "
String -> String -> String
forall a. [a] -> [a] -> [a]
++ String
"(e.g. '2016-09-24T17:47:48Z'), or 'HEAD'"
)
(TotalIndexState -> Last TotalIndexState
forall a. a -> Last a
toFlag (TotalIndexState -> Last TotalIndexState)
-> ParsecParser TotalIndexState
-> ParsecParser (Last TotalIndexState)
forall a b. (a -> b) -> ParsecParser a -> ParsecParser b
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
`fmap` ParsecParser TotalIndexState
forall a (m :: * -> *). (Parsec a, CabalParsing m) => m a
forall (m :: * -> *). CabalParsing m => m TotalIndexState
parsec)
)
(Last String -> [String]
forall a. Flag a -> [a]
flagToList (Last String -> [String])
-> (Last TotalIndexState -> Last String)
-> Last TotalIndexState
-> [String]
forall b c a. (b -> c) -> (a -> b) -> a -> c
. (TotalIndexState -> String) -> Last TotalIndexState -> Last String
forall a b. (a -> b) -> Last a -> Last b
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
fmap TotalIndexState -> String
forall a. Pretty a => a -> String
prettyShow)
)
, String
-> [String]
-> String
-> (InstallFlags -> Last String)
-> (Last String -> InstallFlags -> InstallFlags)
-> MkOptDescr
(InstallFlags -> Last String)
(Last String -> InstallFlags -> InstallFlags)
InstallFlags
-> OptionField InstallFlags
forall get set a.
String
-> [String]
-> String
-> get
-> set
-> MkOptDescr get set a
-> OptionField a
option
[]
[String
"root-cmd"]
String
"(No longer supported, do not use.)"
InstallFlags -> Last String
installRootCmd
(\Last String
v InstallFlags
flags -> InstallFlags
flags{installRootCmd = v})
(String
-> (String -> Last String)
-> (Last String -> [String])
-> MkOptDescr
(InstallFlags -> Last String)
(Last String -> InstallFlags -> InstallFlags)
InstallFlags
forall b a.
Monoid b =>
String
-> (String -> b)
-> (b -> [String])
-> MkOptDescr (a -> b) (b -> a -> a) a
reqArg' String
"COMMAND" String -> Last String
forall a. a -> Last a
toFlag Last String -> [String]
forall a. Flag a -> [a]
flagToList)
, String
-> [String]
-> String
-> (InstallFlags -> Last String)
-> (Last String -> InstallFlags -> InstallFlags)
-> MkOptDescr
(InstallFlags -> Last String)
(Last String -> InstallFlags -> InstallFlags)
InstallFlags
-> OptionField InstallFlags
forall get set a.
String
-> [String]
-> String
-> get
-> set
-> MkOptDescr get set a
-> OptionField a
option
[]
[String
"symlink-bindir"]
String
"Add symlinks to installed executables into this directory."
InstallFlags -> Last String
installSymlinkBinDir
(\Last String
v InstallFlags
flags -> InstallFlags
flags{installSymlinkBinDir = v})
(String
-> MkOptDescr
(InstallFlags -> Last String)
(Last String -> InstallFlags -> InstallFlags)
InstallFlags
forall b.
String -> MkOptDescr (b -> Last String) (Last String -> b -> b) b
reqArgFlag String
"DIR")
, String
-> [String]
-> String
-> (InstallFlags -> NubList PathTemplate)
-> (NubList PathTemplate -> InstallFlags -> InstallFlags)
-> MkOptDescr
(InstallFlags -> NubList PathTemplate)
(NubList PathTemplate -> InstallFlags -> InstallFlags)
InstallFlags
-> OptionField InstallFlags
forall get set a.
String
-> [String]
-> String
-> get
-> set
-> MkOptDescr get set a
-> OptionField a
option
[]
[String
"build-summary"]
String
"Save build summaries to file (name template can use $pkgid, $compiler, $os, $arch)"
InstallFlags -> NubList PathTemplate
installSummaryFile
(\NubList PathTemplate
v InstallFlags
flags -> InstallFlags
flags{installSummaryFile = v})
(String
-> (String -> NubList PathTemplate)
-> (NubList PathTemplate -> [String])
-> MkOptDescr
(InstallFlags -> NubList PathTemplate)
(NubList PathTemplate -> InstallFlags -> InstallFlags)
InstallFlags
forall b a.
Monoid b =>
String
-> (String -> b)
-> (b -> [String])
-> MkOptDescr (a -> b) (b -> a -> a) a
reqArg' String
"TEMPLATE" (\String
x -> [PathTemplate] -> NubList PathTemplate
forall a. Ord a => [a] -> NubList a
toNubList [String -> PathTemplate
toPathTemplate String
x]) ((PathTemplate -> String) -> [PathTemplate] -> [String]
forall a b. (a -> b) -> [a] -> [b]
map PathTemplate -> String
fromPathTemplate ([PathTemplate] -> [String])
-> (NubList PathTemplate -> [PathTemplate])
-> NubList PathTemplate
-> [String]
forall b c a. (b -> c) -> (a -> b) -> a -> c
. NubList PathTemplate -> [PathTemplate]
forall a. NubList a -> [a]
fromNubList))
, String
-> [String]
-> String
-> (InstallFlags -> Last PathTemplate)
-> (Last PathTemplate -> InstallFlags -> InstallFlags)
-> MkOptDescr
(InstallFlags -> Last PathTemplate)
(Last PathTemplate -> InstallFlags -> InstallFlags)
InstallFlags
-> OptionField InstallFlags
forall get set a.
String
-> [String]
-> String
-> get
-> set
-> MkOptDescr get set a
-> OptionField a
option
[]
[String
"build-log"]
String
"Log all builds to file (name template can use $pkgid, $compiler, $os, $arch)"
InstallFlags -> Last PathTemplate
installLogFile
(\Last PathTemplate
v InstallFlags
flags -> InstallFlags
flags{installLogFile = v})
( String
-> (String -> Last PathTemplate)
-> (Last PathTemplate -> [String])
-> MkOptDescr
(InstallFlags -> Last PathTemplate)
(Last PathTemplate -> InstallFlags -> InstallFlags)
InstallFlags
forall b a.
Monoid b =>
String
-> (String -> b)
-> (b -> [String])
-> MkOptDescr (a -> b) (b -> a -> a) a
reqArg'
String
"TEMPLATE"
(PathTemplate -> Last PathTemplate
forall a. a -> Last a
toFlag (PathTemplate -> Last PathTemplate)
-> (String -> PathTemplate) -> String -> Last PathTemplate
forall b c a. (b -> c) -> (a -> b) -> a -> c
. String -> PathTemplate
toPathTemplate)
(Last String -> [String]
forall a. Flag a -> [a]
flagToList (Last String -> [String])
-> (Last PathTemplate -> Last String)
-> Last PathTemplate
-> [String]
forall b c a. (b -> c) -> (a -> b) -> a -> c
. (PathTemplate -> String) -> Last PathTemplate -> Last String
forall a b. (a -> b) -> Last a -> Last b
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
fmap PathTemplate -> String
fromPathTemplate)
)
, String
-> [String]
-> String
-> (InstallFlags -> Last ReportLevel)
-> (Last ReportLevel -> InstallFlags -> InstallFlags)
-> MkOptDescr
(InstallFlags -> Last ReportLevel)
(Last ReportLevel -> InstallFlags -> InstallFlags)
InstallFlags
-> OptionField InstallFlags
forall get set a.
String
-> [String]
-> String
-> get
-> set
-> MkOptDescr get set a
-> OptionField a
option
[]
[String
"remote-build-reporting"]
String
"Generate build reports to send to a remote server (none, anonymous or detailed)."
InstallFlags -> Last ReportLevel
installBuildReports
(\Last ReportLevel
v InstallFlags
flags -> InstallFlags
flags{installBuildReports = v})
( String
-> ReadE (Last ReportLevel)
-> (Last ReportLevel -> [String])
-> MkOptDescr
(InstallFlags -> Last ReportLevel)
(Last ReportLevel -> InstallFlags -> InstallFlags)
InstallFlags
forall b a.
Monoid b =>
String
-> ReadE b
-> (b -> [String])
-> MkOptDescr (a -> b) (b -> a -> a) a
reqArg
String
"LEVEL"
( (String -> String)
-> ParsecParser (Last ReportLevel) -> ReadE (Last ReportLevel)
forall a. (String -> String) -> ParsecParser a -> ReadE a
parsecToReadE
( String -> String -> String
forall a b. a -> b -> a
const (String -> String -> String) -> String -> String -> String
forall a b. (a -> b) -> a -> b
$
String
"report level must be 'none', "
String -> String -> String
forall a. [a] -> [a] -> [a]
++ String
"'anonymous' or 'detailed'"
)
(ReportLevel -> Last ReportLevel
forall a. a -> Last a
toFlag (ReportLevel -> Last ReportLevel)
-> ParsecParser ReportLevel -> ParsecParser (Last ReportLevel)
forall a b. (a -> b) -> ParsecParser a -> ParsecParser b
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
`fmap` ParsecParser ReportLevel
forall a (m :: * -> *). (Parsec a, CabalParsing m) => m a
forall (m :: * -> *). CabalParsing m => m ReportLevel
parsec)
)
(Last String -> [String]
forall a. Flag a -> [a]
flagToList (Last String -> [String])
-> (Last ReportLevel -> Last String)
-> Last ReportLevel
-> [String]
forall b c a. (b -> c) -> (a -> b) -> a -> c
. (ReportLevel -> String) -> Last ReportLevel -> Last String
forall a b. (a -> b) -> Last a -> Last b
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
fmap ReportLevel -> String
forall a. Pretty a => a -> String
prettyShow)
)
, String
-> [String]
-> String
-> (InstallFlags -> Last Bool)
-> (Last Bool -> InstallFlags -> InstallFlags)
-> MkOptDescr
(InstallFlags -> Last Bool)
(Last Bool -> InstallFlags -> InstallFlags)
InstallFlags
-> OptionField InstallFlags
forall get set a.
String
-> [String]
-> String
-> get
-> set
-> MkOptDescr get set a
-> OptionField a
option
[]
[String
"report-planning-failure"]
String
"Generate build reports when the dependency solver fails. This is used by the Hackage build bot."
InstallFlags -> Last Bool
installReportPlanningFailure
(\Last Bool
v InstallFlags
flags -> InstallFlags
flags{installReportPlanningFailure = v})
MkOptDescr
(InstallFlags -> Last Bool)
(Last Bool -> InstallFlags -> InstallFlags)
InstallFlags
forall a. MkOptDescr (a -> Last Bool) (Last Bool -> a -> a) a
trueArg
, String
-> [String]
-> String
-> (InstallFlags -> Last Bool)
-> (Last Bool -> InstallFlags -> InstallFlags)
-> MkOptDescr
(InstallFlags -> Last Bool)
(Last Bool -> InstallFlags -> InstallFlags)
InstallFlags
-> OptionField InstallFlags
forall get set a.
String
-> [String]
-> String
-> get
-> set
-> MkOptDescr get set a
-> OptionField a
option
String
""
[String
"per-component"]
String
"Per-component builds when possible"
InstallFlags -> Last Bool
installPerComponent
(\Last Bool
v InstallFlags
flags -> InstallFlags
flags{installPerComponent = v})
(String
-> String
-> MkOptDescr
(InstallFlags -> Last Bool)
(Last Bool -> InstallFlags -> InstallFlags)
InstallFlags
forall a.
String
-> String -> MkOptDescr (a -> Last Bool) (Last Bool -> a -> a) a
boolOpt [] [])
, String
-> [String]
-> String
-> (InstallFlags -> Last Bool)
-> (Last Bool -> InstallFlags -> InstallFlags)
-> MkOptDescr
(InstallFlags -> Last Bool)
(Last Bool -> InstallFlags -> InstallFlags)
InstallFlags
-> OptionField InstallFlags
forall get set a.
String
-> [String]
-> String
-> get
-> set
-> MkOptDescr get set a
-> OptionField a
option
[]
[String
"run-tests"]
String
"Run package test suites during installation."
InstallFlags -> Last Bool
installRunTests
(\Last Bool
v InstallFlags
flags -> InstallFlags
flags{installRunTests = v})
MkOptDescr
(InstallFlags -> Last Bool)
(Last Bool -> InstallFlags -> InstallFlags)
InstallFlags
forall a. MkOptDescr (a -> Last Bool) (Last Bool -> a -> a) a
trueArg
, String
-> [String]
-> String
-> (InstallFlags -> Last Bool)
-> (Last Bool -> InstallFlags -> InstallFlags)
-> MkOptDescr
(InstallFlags -> Last Bool)
(Last Bool -> InstallFlags -> InstallFlags)
InstallFlags
-> OptionField InstallFlags
forall get set a.
String
-> [String]
-> String
-> get
-> set
-> MkOptDescr get set a
-> OptionField a
option
[]
[String
"semaphore"]
String
"Use a semaphore so GHC can compile components in parallel"
InstallFlags -> Last Bool
installUseSemaphore
(\Last Bool
v InstallFlags
flags -> InstallFlags
flags{installUseSemaphore = v})
(ShowOrParseArgs
-> MkOptDescr
(InstallFlags -> Last Bool)
(Last Bool -> InstallFlags -> InstallFlags)
InstallFlags
forall b.
ShowOrParseArgs
-> MkOptDescr (b -> Last Bool) (Last Bool -> b -> b) b
yesNoOpt ShowOrParseArgs
showOrParseArgs)
, (InstallFlags -> Last (Maybe Int))
-> (Last (Maybe Int) -> InstallFlags -> InstallFlags)
-> OptionField InstallFlags
forall flags.
(flags -> Last (Maybe Int))
-> (Last (Maybe Int) -> flags -> flags) -> OptionField flags
optionNumJobs
InstallFlags -> Last (Maybe Int)
installNumJobs
(\Last (Maybe Int)
v InstallFlags
flags -> InstallFlags
flags{installNumJobs = v})
, String
-> [String]
-> String
-> (InstallFlags -> Last Bool)
-> (Last Bool -> InstallFlags -> InstallFlags)
-> MkOptDescr
(InstallFlags -> Last Bool)
(Last Bool -> InstallFlags -> InstallFlags)
InstallFlags
-> OptionField InstallFlags
forall get set a.
String
-> [String]
-> String
-> get
-> set
-> MkOptDescr get set a
-> OptionField a
option
[]
[String
"keep-going"]
String
"After a build failure, continue to build other unaffected packages."
InstallFlags -> Last Bool
installKeepGoing
(\Last Bool
v InstallFlags
flags -> InstallFlags
flags{installKeepGoing = v})
MkOptDescr
(InstallFlags -> Last Bool)
(Last Bool -> InstallFlags -> InstallFlags)
InstallFlags
forall a. MkOptDescr (a -> Last Bool) (Last Bool -> a -> a) a
trueArg
, String
-> [String]
-> String
-> (InstallFlags -> Last Bool)
-> (Last Bool -> InstallFlags -> InstallFlags)
-> MkOptDescr
(InstallFlags -> Last Bool)
(Last Bool -> InstallFlags -> InstallFlags)
InstallFlags
-> OptionField InstallFlags
forall get set a.
String
-> [String]
-> String
-> get
-> set
-> MkOptDescr get set a
-> OptionField a
option
[]
[String
"offline"]
String
"Don't download packages from the Internet."
InstallFlags -> Last Bool
installOfflineMode
(\Last Bool
v InstallFlags
flags -> InstallFlags
flags{installOfflineMode = v})
(ShowOrParseArgs
-> MkOptDescr
(InstallFlags -> Last Bool)
(Last Bool -> InstallFlags -> InstallFlags)
InstallFlags
forall b.
ShowOrParseArgs
-> MkOptDescr (b -> Last Bool) (Last Bool -> b -> b) b
yesNoOpt ShowOrParseArgs
showOrParseArgs)
]
[OptionField InstallFlags]
-> [OptionField InstallFlags] -> [OptionField InstallFlags]
forall a. [a] -> [a] -> [a]
++ case ShowOrParseArgs
showOrParseArgs of
ShowOrParseArgs
ParseArgs ->
[ String
-> [String]
-> String
-> (InstallFlags -> Last Bool)
-> (Last Bool -> InstallFlags -> InstallFlags)
-> MkOptDescr
(InstallFlags -> Last Bool)
(Last Bool -> InstallFlags -> InstallFlags)
InstallFlags
-> OptionField InstallFlags
forall get set a.
String
-> [String]
-> String
-> get
-> set
-> MkOptDescr get set a
-> OptionField a
option
[]
[String
"only"]
String
"Only installs the package in the current directory."
InstallFlags -> Last Bool
installOnly
(\Last Bool
v InstallFlags
flags -> InstallFlags
flags{installOnly = v})
MkOptDescr
(InstallFlags -> Last Bool)
(Last Bool -> InstallFlags -> InstallFlags)
InstallFlags
forall a. MkOptDescr (a -> Last Bool) (Last Bool -> a -> a) a
trueArg
]
ShowOrParseArgs
_ -> []
optionNumJobs
:: (flags -> Flag (Maybe Int))
-> (Flag (Maybe Int) -> flags -> flags)
-> OptionField flags
optionNumJobs :: forall flags.
(flags -> Last (Maybe Int))
-> (Last (Maybe Int) -> flags -> flags) -> OptionField flags
optionNumJobs flags -> Last (Maybe Int)
get Last (Maybe Int) -> flags -> flags
set =
String
-> [String]
-> String
-> (flags -> Last (Maybe Int))
-> (Last (Maybe Int) -> flags -> flags)
-> MkOptDescr
(flags -> Last (Maybe Int))
(Last (Maybe Int) -> flags -> flags)
flags
-> OptionField flags
forall get set a.
String
-> [String]
-> String
-> get
-> set
-> MkOptDescr get set a
-> OptionField a
option
String
"j"
[String
"jobs"]
String
"Run NUM jobs simultaneously (or '$ncpus' if no NUM is given)."
flags -> Last (Maybe Int)
get
Last (Maybe Int) -> flags -> flags
set
( String
-> ReadE (Last (Maybe Int))
-> (String, Last (Maybe Int))
-> (Last (Maybe Int) -> [Maybe String])
-> MkOptDescr
(flags -> Last (Maybe Int))
(Last (Maybe Int) -> flags -> flags)
flags
forall b a.
Monoid b =>
String
-> ReadE b
-> (String, b)
-> (b -> [Maybe String])
-> MkOptDescr (a -> b) (b -> a -> a) a
optArg
String
"NUM"
((Maybe Int -> Last (Maybe Int))
-> ReadE (Maybe Int) -> ReadE (Last (Maybe Int))
forall a b. (a -> b) -> ReadE a -> ReadE b
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
fmap Maybe Int -> Last (Maybe Int)
forall a. a -> Last a
Flag ReadE (Maybe Int)
numJobsParser)
(String
"", Maybe Int -> Last (Maybe Int)
forall a. a -> Last a
Flag Maybe Int
forall a. Maybe a
Nothing)
((Maybe Int -> Maybe String) -> [Maybe Int] -> [Maybe String]
forall a b. (a -> b) -> [a] -> [b]
map (String -> Maybe String
forall a. a -> Maybe a
Just (String -> Maybe String)
-> (Maybe Int -> String) -> Maybe Int -> Maybe String
forall b c a. (b -> c) -> (a -> b) -> a -> c
. String -> (Int -> String) -> Maybe Int -> String
forall b a. b -> (a -> b) -> Maybe a -> b
maybe String
"$ncpus" Int -> String
forall a. Show a => a -> String
show) ([Maybe Int] -> [Maybe String])
-> (Last (Maybe Int) -> [Maybe Int])
-> Last (Maybe Int)
-> [Maybe String]
forall b c a. (b -> c) -> (a -> b) -> a -> c
. Last (Maybe Int) -> [Maybe Int]
forall a. Flag a -> [a]
flagToList)
)
where
numJobsParser :: ReadE (Maybe Int)
numJobsParser :: ReadE (Maybe Int)
numJobsParser = (String -> Either String (Maybe Int)) -> ReadE (Maybe Int)
forall a. (String -> Either String a) -> ReadE a
ReadE ((String -> Either String (Maybe Int)) -> ReadE (Maybe Int))
-> (String -> Either String (Maybe Int)) -> ReadE (Maybe Int)
forall a b. (a -> b) -> a -> b
$ \String
s ->
case String
s of
String
"$ncpus" -> Maybe Int -> Either String (Maybe Int)
forall a b. b -> Either a b
Right Maybe Int
forall a. Maybe a
Nothing
String
_ -> case ReadS Int
forall a. Read a => ReadS a
reads String
s of
[(Int
n, String
"")]
| Int
n Int -> Int -> Bool
forall a. Ord a => a -> a -> Bool
< Int
1 -> String -> Either String (Maybe Int)
forall a b. a -> Either a b
Left String
"The number of jobs should be 1 or more."
| Bool
otherwise -> Maybe Int -> Either String (Maybe Int)
forall a b. b -> Either a b
Right (Int -> Maybe Int
forall a. a -> Maybe a
Just Int
n)
[(Int, String)]
_ -> String -> Either String (Maybe Int)
forall a b. a -> Either a b
Left String
"The jobs value should be a number or '$ncpus'"
instance Monoid InstallFlags where
mempty :: InstallFlags
mempty = InstallFlags
forall a. (Generic a, GMonoid (Rep a)) => a
gmempty
mappend :: InstallFlags -> InstallFlags -> InstallFlags
mappend = InstallFlags -> InstallFlags -> InstallFlags
forall a. Semigroup a => a -> a -> a
(<>)
instance Semigroup InstallFlags where
<> :: InstallFlags -> InstallFlags -> InstallFlags
(<>) = InstallFlags -> InstallFlags -> InstallFlags
forall a. (Generic a, GSemigroup (Rep a)) => a -> a -> a
gmappend
data IsCandidate = IsCandidate | IsPublished
deriving (IsCandidate -> IsCandidate -> Bool
(IsCandidate -> IsCandidate -> Bool)
-> (IsCandidate -> IsCandidate -> Bool) -> Eq IsCandidate
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
$c== :: IsCandidate -> IsCandidate -> Bool
== :: IsCandidate -> IsCandidate -> Bool
$c/= :: IsCandidate -> IsCandidate -> Bool
/= :: IsCandidate -> IsCandidate -> Bool
Eq)
data UploadFlags = UploadFlags
{ UploadFlags -> Last IsCandidate
uploadCandidate :: Flag IsCandidate
, UploadFlags -> Last Bool
uploadDoc :: Flag Bool
, UploadFlags -> Last Token
uploadToken :: Flag Token
, UploadFlags -> Last Username
uploadUsername :: Flag Username
, UploadFlags -> Last Password
uploadPassword :: Flag Password
, UploadFlags -> Last [String]
uploadPasswordCmd :: Flag [String]
, UploadFlags -> Last Verbosity
uploadVerbosity :: Flag Verbosity
}
deriving ((forall x. UploadFlags -> Rep UploadFlags x)
-> (forall x. Rep UploadFlags x -> UploadFlags)
-> Generic UploadFlags
forall x. Rep UploadFlags x -> UploadFlags
forall x. UploadFlags -> Rep UploadFlags x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cfrom :: forall x. UploadFlags -> Rep UploadFlags x
from :: forall x. UploadFlags -> Rep UploadFlags x
$cto :: forall x. Rep UploadFlags x -> UploadFlags
to :: forall x. Rep UploadFlags x -> UploadFlags
Generic)
defaultUploadFlags :: UploadFlags
defaultUploadFlags :: UploadFlags
defaultUploadFlags =
UploadFlags
{ uploadCandidate :: Last IsCandidate
uploadCandidate = IsCandidate -> Last IsCandidate
forall a. a -> Last a
toFlag IsCandidate
IsCandidate
, uploadDoc :: Last Bool
uploadDoc = Bool -> Last Bool
forall a. a -> Last a
toFlag Bool
False
, uploadToken :: Last Token
uploadToken = Last Token
forall a. Monoid a => a
mempty
, uploadUsername :: Last Username
uploadUsername = Last Username
forall a. Monoid a => a
mempty
, uploadPassword :: Last Password
uploadPassword = Last Password
forall a. Monoid a => a
mempty
, uploadPasswordCmd :: Last [String]
uploadPasswordCmd = Last [String]
forall a. Monoid a => a
mempty
, uploadVerbosity :: Last Verbosity
uploadVerbosity = Verbosity -> Last Verbosity
forall a. a -> Last a
toFlag Verbosity
normal
}
uploadCommand :: CommandUI UploadFlags
uploadCommand :: CommandUI UploadFlags
uploadCommand =
CommandUI
{ commandName :: String
commandName = String
"upload"
, commandSynopsis :: String
commandSynopsis = String
"Uploads source packages or documentation to Hackage."
, commandDescription :: Maybe (String -> String)
commandDescription = Maybe (String -> String)
forall a. Maybe a
Nothing
, commandNotes :: Maybe (String -> String)
commandNotes = (String -> String) -> Maybe (String -> String)
forall a. a -> Maybe a
Just ((String -> String) -> Maybe (String -> String))
-> (String -> String) -> Maybe (String -> String)
forall a b. (a -> b) -> a -> b
$ \String
_ ->
String
"You can store your Hackage login in the ~/.config/cabal/config file\n"
String -> String -> String
forall a. [a] -> [a] -> [a]
++ String
"(the %APPDATA%\\cabal\\config file on Windows)\n"
String -> String -> String
forall a. [a] -> [a] -> [a]
++ [String] -> String
relevantConfigValuesText [String
"token", String
"username", String
"password", String
"password-command"]
, commandUsage :: String -> String
commandUsage = \String
pname ->
String
"Usage: " String -> String -> String
forall a. [a] -> [a] -> [a]
++ String
pname String -> String -> String
forall a. [a] -> [a] -> [a]
++ String
" upload [FLAGS] TARFILES\n"
, commandDefaultFlags :: UploadFlags
commandDefaultFlags = UploadFlags
defaultUploadFlags
, commandOptions :: ShowOrParseArgs -> [OptionField UploadFlags]
commandOptions = \ShowOrParseArgs
_ ->
[ (UploadFlags -> Last Verbosity)
-> (Last Verbosity -> UploadFlags -> UploadFlags)
-> OptionField UploadFlags
forall flags.
(flags -> Last Verbosity)
-> (Last Verbosity -> flags -> flags) -> OptionField flags
optionVerbosity
UploadFlags -> Last Verbosity
uploadVerbosity
(\Last Verbosity
v UploadFlags
flags -> UploadFlags
flags{uploadVerbosity = v})
, String
-> [String]
-> String
-> (UploadFlags -> Last IsCandidate)
-> (Last IsCandidate -> UploadFlags -> UploadFlags)
-> MkOptDescr
(UploadFlags -> Last IsCandidate)
(Last IsCandidate -> UploadFlags -> UploadFlags)
UploadFlags
-> OptionField UploadFlags
forall get set a.
String
-> [String]
-> String
-> get
-> set
-> MkOptDescr get set a
-> OptionField a
option
[]
[String
"publish"]
String
"Publish the package instead of uploading it as a candidate."
UploadFlags -> Last IsCandidate
uploadCandidate
(\Last IsCandidate
v UploadFlags
flags -> UploadFlags
flags{uploadCandidate = v})
(Last IsCandidate
-> MkOptDescr
(UploadFlags -> Last IsCandidate)
(Last IsCandidate -> UploadFlags -> UploadFlags)
UploadFlags
forall b a. Eq b => b -> MkOptDescr (a -> b) (b -> a -> a) a
noArg (IsCandidate -> Last IsCandidate
forall a. a -> Last a
Flag IsCandidate
IsPublished))
, String
-> [String]
-> String
-> (UploadFlags -> Last Bool)
-> (Last Bool -> UploadFlags -> UploadFlags)
-> MkOptDescr
(UploadFlags -> Last Bool)
(Last Bool -> UploadFlags -> UploadFlags)
UploadFlags
-> OptionField UploadFlags
forall get set a.
String
-> [String]
-> String
-> get
-> set
-> MkOptDescr get set a
-> OptionField a
option
[Char
'd']
[String
"documentation"]
( String
"Upload documentation instead of a source package. "
String -> String -> String
forall a. [a] -> [a] -> [a]
++ String
"By default, this uploads documentation for a package candidate. "
String -> String -> String
forall a. [a] -> [a] -> [a]
++ String
"To upload documentation for "
String -> String -> String
forall a. [a] -> [a] -> [a]
++ String
"a published package, combine with --publish."
)
UploadFlags -> Last Bool
uploadDoc
(\Last Bool
v UploadFlags
flags -> UploadFlags
flags{uploadDoc = v})
MkOptDescr
(UploadFlags -> Last Bool)
(Last Bool -> UploadFlags -> UploadFlags)
UploadFlags
forall a. MkOptDescr (a -> Last Bool) (Last Bool -> a -> a) a
trueArg
, String
-> [String]
-> String
-> (UploadFlags -> Last Token)
-> (Last Token -> UploadFlags -> UploadFlags)
-> MkOptDescr
(UploadFlags -> Last Token)
(Last Token -> UploadFlags -> UploadFlags)
UploadFlags
-> OptionField UploadFlags
forall get set a.
String
-> [String]
-> String
-> get
-> set
-> MkOptDescr get set a
-> OptionField a
option
[Char
't']
[String
"token"]
String
"Hackage authentication token."
UploadFlags -> Last Token
uploadToken
(\Last Token
v UploadFlags
flags -> UploadFlags
flags{uploadToken = v})
( String
-> (String -> Last Token)
-> (Last Token -> [String])
-> MkOptDescr
(UploadFlags -> Last Token)
(Last Token -> UploadFlags -> UploadFlags)
UploadFlags
forall b a.
Monoid b =>
String
-> (String -> b)
-> (b -> [String])
-> MkOptDescr (a -> b) (b -> a -> a) a
reqArg'
String
"TOKEN"
(Token -> Last Token
forall a. a -> Last a
toFlag (Token -> Last Token) -> (String -> Token) -> String -> Last Token
forall b c a. (b -> c) -> (a -> b) -> a -> c
. String -> Token
Token)
(Last String -> [String]
forall a. Flag a -> [a]
flagToList (Last String -> [String])
-> (Last Token -> Last String) -> Last Token -> [String]
forall b c a. (b -> c) -> (a -> b) -> a -> c
. (Token -> String) -> Last Token -> Last String
forall a b. (a -> b) -> Last a -> Last b
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
fmap Token -> String
unToken)
)
, String
-> [String]
-> String
-> (UploadFlags -> Last Username)
-> (Last Username -> UploadFlags -> UploadFlags)
-> MkOptDescr
(UploadFlags -> Last Username)
(Last Username -> UploadFlags -> UploadFlags)
UploadFlags
-> OptionField UploadFlags
forall get set a.
String
-> [String]
-> String
-> get
-> set
-> MkOptDescr get set a
-> OptionField a
option
[Char
'u']
[String
"username"]
String
"Hackage username."
UploadFlags -> Last Username
uploadUsername
(\Last Username
v UploadFlags
flags -> UploadFlags
flags{uploadUsername = v})
( String
-> (String -> Last Username)
-> (Last Username -> [String])
-> MkOptDescr
(UploadFlags -> Last Username)
(Last Username -> UploadFlags -> UploadFlags)
UploadFlags
forall b a.
Monoid b =>
String
-> (String -> b)
-> (b -> [String])
-> MkOptDescr (a -> b) (b -> a -> a) a
reqArg'
String
"USERNAME"
(Username -> Last Username
forall a. a -> Last a
toFlag (Username -> Last Username)
-> (String -> Username) -> String -> Last Username
forall b c a. (b -> c) -> (a -> b) -> a -> c
. String -> Username
Username)
(Last String -> [String]
forall a. Flag a -> [a]
flagToList (Last String -> [String])
-> (Last Username -> Last String) -> Last Username -> [String]
forall b c a. (b -> c) -> (a -> b) -> a -> c
. (Username -> String) -> Last Username -> Last String
forall a b. (a -> b) -> Last a -> Last b
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
fmap Username -> String
unUsername)
)
, String
-> [String]
-> String
-> (UploadFlags -> Last Password)
-> (Last Password -> UploadFlags -> UploadFlags)
-> MkOptDescr
(UploadFlags -> Last Password)
(Last Password -> UploadFlags -> UploadFlags)
UploadFlags
-> OptionField UploadFlags
forall get set a.
String
-> [String]
-> String
-> get
-> set
-> MkOptDescr get set a
-> OptionField a
option
[Char
'p']
[String
"password"]
String
"Hackage password."
UploadFlags -> Last Password
uploadPassword
(\Last Password
v UploadFlags
flags -> UploadFlags
flags{uploadPassword = v})
( String
-> (String -> Last Password)
-> (Last Password -> [String])
-> MkOptDescr
(UploadFlags -> Last Password)
(Last Password -> UploadFlags -> UploadFlags)
UploadFlags
forall b a.
Monoid b =>
String
-> (String -> b)
-> (b -> [String])
-> MkOptDescr (a -> b) (b -> a -> a) a
reqArg'
String
"PASSWORD"
(Password -> Last Password
forall a. a -> Last a
toFlag (Password -> Last Password)
-> (String -> Password) -> String -> Last Password
forall b c a. (b -> c) -> (a -> b) -> a -> c
. String -> Password
Password)
(Last String -> [String]
forall a. Flag a -> [a]
flagToList (Last String -> [String])
-> (Last Password -> Last String) -> Last Password -> [String]
forall b c a. (b -> c) -> (a -> b) -> a -> c
. (Password -> String) -> Last Password -> Last String
forall a b. (a -> b) -> Last a -> Last b
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
fmap Password -> String
unPassword)
)
, String
-> [String]
-> String
-> (UploadFlags -> Last [String])
-> (Last [String] -> UploadFlags -> UploadFlags)
-> MkOptDescr
(UploadFlags -> Last [String])
(Last [String] -> UploadFlags -> UploadFlags)
UploadFlags
-> OptionField UploadFlags
forall get set a.
String
-> [String]
-> String
-> get
-> set
-> MkOptDescr get set a
-> OptionField a
option
[Char
'P']
[String
"password-command"]
String
"Command to get Hackage password."
UploadFlags -> Last [String]
uploadPasswordCmd
(\Last [String]
v UploadFlags
flags -> UploadFlags
flags{uploadPasswordCmd = v})
( String
-> ReadE (Last [String])
-> (Last [String] -> [String])
-> MkOptDescr
(UploadFlags -> Last [String])
(Last [String] -> UploadFlags -> UploadFlags)
UploadFlags
forall b a.
Monoid b =>
String
-> ReadE b
-> (b -> [String])
-> MkOptDescr (a -> b) (b -> a -> a) a
reqArg
String
"COMMAND"
( (String -> String)
-> ReadP (Last [String]) (Last [String]) -> ReadE (Last [String])
forall a. (String -> String) -> ReadP a a -> ReadE a
readP_to_E
(String
"Cannot parse command: " String -> String -> String
forall a. [a] -> [a] -> [a]
++)
([String] -> Last [String]
forall a. a -> Last a
Flag ([String] -> Last [String])
-> Parser (Last [String]) Char [String]
-> ReadP (Last [String]) (Last [String])
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
<$> ReadP (Last [String]) String
-> Parser (Last [String]) Char [String]
forall r a. ReadP r a -> ReadP r [a]
parseSpaceList ReadP (Last [String]) String
forall r. ReadP r String
parseTokenQ)
)
([String] -> ([String] -> [String]) -> Last [String] -> [String]
forall b a. b -> (a -> b) -> Flag a -> b
flagElim [] (String -> [String]
forall a. a -> [a]
forall (f :: * -> *) a. Applicative f => a -> f a
pure (String -> [String])
-> ([String] -> String) -> [String] -> [String]
forall b c a. (b -> c) -> (a -> b) -> a -> c
. [String] -> String
unwords ([String] -> String)
-> ([String] -> [String]) -> [String] -> String
forall b c a. (b -> c) -> (a -> b) -> a -> c
. (String -> String) -> [String] -> [String]
forall a b. (a -> b) -> [a] -> [b]
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
fmap String -> String
forall a. Show a => a -> String
show))
)
]
}
instance Monoid UploadFlags where
mempty :: UploadFlags
mempty = UploadFlags
forall a. (Generic a, GMonoid (Rep a)) => a
gmempty
mappend :: UploadFlags -> UploadFlags -> UploadFlags
mappend = UploadFlags -> UploadFlags -> UploadFlags
forall a. Semigroup a => a -> a -> a
(<>)
instance Semigroup UploadFlags where
<> :: UploadFlags -> UploadFlags -> UploadFlags
(<>) = UploadFlags -> UploadFlags -> UploadFlags
forall a. (Generic a, GSemigroup (Rep a)) => a -> a -> a
gmappend
initCommand :: CommandUI IT.InitFlags
initCommand :: CommandUI InitFlags
initCommand =
CommandUI
{ commandName :: String
commandName = String
"init"
, commandSynopsis :: String
commandSynopsis = String
"Create a new cabal package."
, commandDescription :: Maybe (String -> String)
commandDescription = (String -> String) -> Maybe (String -> String)
forall a. a -> Maybe a
Just ((String -> String) -> Maybe (String -> String))
-> (String -> String) -> Maybe (String -> String)
forall a b. (a -> b) -> a -> b
$ \String
_ ->
String -> String
wrapText (String -> String) -> String -> String
forall a b. (a -> b) -> a -> b
$
String
"Create a .cabal, CHANGELOG.md, minimal initial Haskell code and optionally a LICENSE file.\n"
String -> String -> String
forall a. [a] -> [a] -> [a]
++ String
"\n"
String -> String -> String
forall a. [a] -> [a] -> [a]
++ String
"Calling init with no arguments runs interactive mode, "
String -> String -> String
forall a. [a] -> [a] -> [a]
++ String
"which will try to guess as much as possible and prompt you for the rest.\n"
String -> String -> String
forall a. [a] -> [a] -> [a]
++ String
"Non-interactive mode can be invoked by the -n/--non-interactive flag, "
String -> String -> String
forall a. [a] -> [a] -> [a]
++ String
"which will let you specify the options via flags and will use the defaults for the rest.\n"
String -> String -> String
forall a. [a] -> [a] -> [a]
++ String
"It is also possible to call init with a single argument, which denotes the project's desired "
String -> String -> String
forall a. [a] -> [a] -> [a]
++ String
"root directory.\n"
, commandNotes :: Maybe (String -> String)
commandNotes = Maybe (String -> String)
forall a. Maybe a
Nothing
, commandUsage :: String -> String
commandUsage = \String
pname ->
String
"Usage: " String -> String -> String
forall a. [a] -> [a] -> [a]
++ String
pname String -> String -> String
forall a. [a] -> [a] -> [a]
++ String
" init [PROJECT ROOT] [FLAGS]\n"
, commandDefaultFlags :: InitFlags
commandDefaultFlags = InitFlags
IT.defaultInitFlags
, commandOptions :: ShowOrParseArgs -> [OptionField InitFlags]
commandOptions = ShowOrParseArgs -> [OptionField InitFlags]
initOptions
}
initOptions :: ShowOrParseArgs -> [OptionField IT.InitFlags]
initOptions :: ShowOrParseArgs -> [OptionField InitFlags]
initOptions ShowOrParseArgs
_ =
[ String
-> [String]
-> String
-> (InitFlags -> Last Bool)
-> (Last Bool -> InitFlags -> InitFlags)
-> MkOptDescr
(InitFlags -> Last Bool)
(Last Bool -> InitFlags -> InitFlags)
InitFlags
-> OptionField InitFlags
forall get set a.
String
-> [String]
-> String
-> get
-> set
-> MkOptDescr get set a
-> OptionField a
option
[Char
'i']
[String
"interactive"]
String
"interactive mode."
InitFlags -> Last Bool
IT.interactive
(\Last Bool
v InitFlags
flags -> InitFlags
flags{IT.interactive = v})
(OptFlags
-> OptFlags
-> MkOptDescr
(InitFlags -> Last Bool)
(Last Bool -> InitFlags -> InitFlags)
InitFlags
forall a.
OptFlags
-> OptFlags -> MkOptDescr (a -> Last Bool) (Last Bool -> a -> a) a
boolOpt' ([Char
'i'], [String
"interactive"]) ([Char
'n'], [String
"non-interactive"]))
, String
-> [String]
-> String
-> (InitFlags -> Last Bool)
-> (Last Bool -> InitFlags -> InitFlags)
-> MkOptDescr
(InitFlags -> Last Bool)
(Last Bool -> InitFlags -> InitFlags)
InitFlags
-> OptionField InitFlags
forall get set a.
String
-> [String]
-> String
-> get
-> set
-> MkOptDescr get set a
-> OptionField a
option
[Char
'q']
[String
"quiet"]
String
"Do not generate log messages to stdout."
InitFlags -> Last Bool
IT.quiet
(\Last Bool
v InitFlags
flags -> InitFlags
flags{IT.quiet = v})
MkOptDescr
(InitFlags -> Last Bool)
(Last Bool -> InitFlags -> InitFlags)
InitFlags
forall a. MkOptDescr (a -> Last Bool) (Last Bool -> a -> a) a
trueArg
, String
-> [String]
-> String
-> (InitFlags -> Last Bool)
-> (Last Bool -> InitFlags -> InitFlags)
-> MkOptDescr
(InitFlags -> Last Bool)
(Last Bool -> InitFlags -> InitFlags)
InitFlags
-> OptionField InitFlags
forall get set a.
String
-> [String]
-> String
-> get
-> set
-> MkOptDescr get set a
-> OptionField a
option
[]
[String
"no-comments"]
String
"Do not generate explanatory comments in the .cabal file."
InitFlags -> Last Bool
IT.noComments
(\Last Bool
v InitFlags
flags -> InitFlags
flags{IT.noComments = v})
MkOptDescr
(InitFlags -> Last Bool)
(Last Bool -> InitFlags -> InitFlags)
InitFlags
forall a. MkOptDescr (a -> Last Bool) (Last Bool -> a -> a) a
trueArg
, String
-> [String]
-> String
-> (InitFlags -> Last Bool)
-> (Last Bool -> InitFlags -> InitFlags)
-> MkOptDescr
(InitFlags -> Last Bool)
(Last Bool -> InitFlags -> InitFlags)
InitFlags
-> OptionField InitFlags
forall get set a.
String
-> [String]
-> String
-> get
-> set
-> MkOptDescr get set a
-> OptionField a
option
[Char
'm']
[String
"minimal"]
String
"Generate a minimal .cabal file, that is, do not include extra empty fields. Also implies --no-comments."
InitFlags -> Last Bool
IT.minimal
(\Last Bool
v InitFlags
flags -> InitFlags
flags{IT.minimal = v})
MkOptDescr
(InitFlags -> Last Bool)
(Last Bool -> InitFlags -> InitFlags)
InitFlags
forall a. MkOptDescr (a -> Last Bool) (Last Bool -> a -> a) a
trueArg
, String
-> [String]
-> String
-> (InitFlags -> Last Bool)
-> (Last Bool -> InitFlags -> InitFlags)
-> MkOptDescr
(InitFlags -> Last Bool)
(Last Bool -> InitFlags -> InitFlags)
InitFlags
-> OptionField InitFlags
forall get set a.
String
-> [String]
-> String
-> get
-> set
-> MkOptDescr get set a
-> OptionField a
option
[]
[String
"overwrite"]
String
"Overwrite any existing .cabal, LICENSE, or Setup.hs files without warning."
InitFlags -> Last Bool
IT.overwrite
(\Last Bool
v InitFlags
flags -> InitFlags
flags{IT.overwrite = v})
MkOptDescr
(InitFlags -> Last Bool)
(Last Bool -> InitFlags -> InitFlags)
InitFlags
forall a. MkOptDescr (a -> Last Bool) (Last Bool -> a -> a) a
trueArg
, String
-> [String]
-> String
-> (InitFlags -> Last String)
-> (Last String -> InitFlags -> InitFlags)
-> MkOptDescr
(InitFlags -> Last String)
(Last String -> InitFlags -> InitFlags)
InitFlags
-> OptionField InitFlags
forall get set a.
String
-> [String]
-> String
-> get
-> set
-> MkOptDescr get set a
-> OptionField a
option
[]
[String
"package-dir", String
"packagedir"]
String
"Root directory of the package (default = current directory)."
InitFlags -> Last String
IT.packageDir
(\Last String
v InitFlags
flags -> InitFlags
flags{IT.packageDir = v})
(String
-> MkOptDescr
(InitFlags -> Last String)
(Last String -> InitFlags -> InitFlags)
InitFlags
forall b.
String -> MkOptDescr (b -> Last String) (Last String -> b -> b) b
reqArgFlag String
"DIRECTORY")
, String
-> [String]
-> String
-> (InitFlags -> Last PackageName)
-> (Last PackageName -> InitFlags -> InitFlags)
-> MkOptDescr
(InitFlags -> Last PackageName)
(Last PackageName -> InitFlags -> InitFlags)
InitFlags
-> OptionField InitFlags
forall get set a.
String
-> [String]
-> String
-> get
-> set
-> MkOptDescr get set a
-> OptionField a
option
[Char
'p']
[String
"package-name"]
String
"Name of the Cabal package to create."
InitFlags -> Last PackageName
IT.packageName
(\Last PackageName
v InitFlags
flags -> InitFlags
flags{IT.packageName = v})
( String
-> ReadE (Last PackageName)
-> (Last PackageName -> [String])
-> MkOptDescr
(InitFlags -> Last PackageName)
(Last PackageName -> InitFlags -> InitFlags)
InitFlags
forall b a.
Monoid b =>
String
-> ReadE b
-> (b -> [String])
-> MkOptDescr (a -> b) (b -> a -> a) a
reqArg
String
"PACKAGE"
( (String -> String)
-> ParsecParser (Last PackageName) -> ReadE (Last PackageName)
forall a. (String -> String) -> ParsecParser a -> ReadE a
parsecToReadE
(String
"Cannot parse package name: " String -> String -> String
forall a. [a] -> [a] -> [a]
++)
(PackageName -> Last PackageName
forall a. a -> Last a
toFlag (PackageName -> Last PackageName)
-> ParsecParser PackageName -> ParsecParser (Last PackageName)
forall a b. (a -> b) -> ParsecParser a -> ParsecParser b
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
`fmap` ParsecParser PackageName
forall a (m :: * -> *). (Parsec a, CabalParsing m) => m a
forall (m :: * -> *). CabalParsing m => m PackageName
parsec)
)
(Last String -> [String]
forall a. Flag a -> [a]
flagToList (Last String -> [String])
-> (Last PackageName -> Last String)
-> Last PackageName
-> [String]
forall b c a. (b -> c) -> (a -> b) -> a -> c
. (PackageName -> String) -> Last PackageName -> Last String
forall a b. (a -> b) -> Last a -> Last b
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
fmap PackageName -> String
forall a. Pretty a => a -> String
prettyShow)
)
, String
-> [String]
-> String
-> (InitFlags -> Last Version)
-> (Last Version -> InitFlags -> InitFlags)
-> MkOptDescr
(InitFlags -> Last Version)
(Last Version -> InitFlags -> InitFlags)
InitFlags
-> OptionField InitFlags
forall get set a.
String
-> [String]
-> String
-> get
-> set
-> MkOptDescr get set a
-> OptionField a
option
[]
[String
"version"]
String
"Initial version of the package."
InitFlags -> Last Version
IT.version
(\Last Version
v InitFlags
flags -> InitFlags
flags{IT.version = v})
( String
-> ReadE (Last Version)
-> (Last Version -> [String])
-> MkOptDescr
(InitFlags -> Last Version)
(Last Version -> InitFlags -> InitFlags)
InitFlags
forall b a.
Monoid b =>
String
-> ReadE b
-> (b -> [String])
-> MkOptDescr (a -> b) (b -> a -> a) a
reqArg
String
"VERSION"
( (String -> String)
-> ParsecParser (Last Version) -> ReadE (Last Version)
forall a. (String -> String) -> ParsecParser a -> ReadE a
parsecToReadE
(String
"Cannot parse package version: " String -> String -> String
forall a. [a] -> [a] -> [a]
++)
(Version -> Last Version
forall a. a -> Last a
toFlag (Version -> Last Version)
-> ParsecParser Version -> ParsecParser (Last Version)
forall a b. (a -> b) -> ParsecParser a -> ParsecParser b
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
`fmap` ParsecParser Version
forall a (m :: * -> *). (Parsec a, CabalParsing m) => m a
forall (m :: * -> *). CabalParsing m => m Version
parsec)
)
(Last String -> [String]
forall a. Flag a -> [a]
flagToList (Last String -> [String])
-> (Last Version -> Last String) -> Last Version -> [String]
forall b c a. (b -> c) -> (a -> b) -> a -> c
. (Version -> String) -> Last Version -> Last String
forall a b. (a -> b) -> Last a -> Last b
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
fmap Version -> String
forall a. Pretty a => a -> String
prettyShow)
)
, String
-> [String]
-> String
-> (InitFlags -> Last CabalSpecVersion)
-> (Last CabalSpecVersion -> InitFlags -> InitFlags)
-> MkOptDescr
(InitFlags -> Last CabalSpecVersion)
(Last CabalSpecVersion -> InitFlags -> InitFlags)
InitFlags
-> OptionField InitFlags
forall get set a.
String
-> [String]
-> String
-> get
-> set
-> MkOptDescr get set a
-> OptionField a
option
[]
[String
"cabal-version"]
String
"Version of the Cabal specification."
InitFlags -> Last CabalSpecVersion
IT.cabalVersion
(\Last CabalSpecVersion
v InitFlags
flags -> InitFlags
flags{IT.cabalVersion = v})
( String
-> ReadE (Last CabalSpecVersion)
-> (Last CabalSpecVersion -> [String])
-> MkOptDescr
(InitFlags -> Last CabalSpecVersion)
(Last CabalSpecVersion -> InitFlags -> InitFlags)
InitFlags
forall b a.
Monoid b =>
String
-> ReadE b
-> (b -> [String])
-> MkOptDescr (a -> b) (b -> a -> a) a
reqArg
String
"CABALSPECVERSION"
( (String -> String)
-> ParsecParser (Last CabalSpecVersion)
-> ReadE (Last CabalSpecVersion)
forall a. (String -> String) -> ParsecParser a -> ReadE a
parsecToReadE
(String
"Cannot parse Cabal specification version: " String -> String -> String
forall a. [a] -> [a] -> [a]
++)
((SpecVersion -> Last CabalSpecVersion)
-> ParsecParser SpecVersion -> ParsecParser (Last CabalSpecVersion)
forall a b. (a -> b) -> ParsecParser a -> ParsecParser b
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
fmap (CabalSpecVersion -> Last CabalSpecVersion
forall a. a -> Last a
toFlag (CabalSpecVersion -> Last CabalSpecVersion)
-> (SpecVersion -> CabalSpecVersion)
-> SpecVersion
-> Last CabalSpecVersion
forall b c a. (b -> c) -> (a -> b) -> a -> c
. SpecVersion -> CabalSpecVersion
getSpecVersion) ParsecParser SpecVersion
forall a (m :: * -> *). (Parsec a, CabalParsing m) => m a
forall (m :: * -> *). CabalParsing m => m SpecVersion
parsec)
)
(Last String -> [String]
forall a. Flag a -> [a]
flagToList (Last String -> [String])
-> (Last CabalSpecVersion -> Last String)
-> Last CabalSpecVersion
-> [String]
forall b c a. (b -> c) -> (a -> b) -> a -> c
. (CabalSpecVersion -> String)
-> Last CabalSpecVersion -> Last String
forall a b. (a -> b) -> Last a -> Last b
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
fmap (SpecVersion -> String
forall a. Pretty a => a -> String
prettyShow (SpecVersion -> String)
-> (CabalSpecVersion -> SpecVersion) -> CabalSpecVersion -> String
forall b c a. (b -> c) -> (a -> b) -> a -> c
. CabalSpecVersion -> SpecVersion
SpecVersion))
)
, String
-> [String]
-> String
-> (InitFlags -> Last SpecLicense)
-> (Last SpecLicense -> InitFlags -> InitFlags)
-> MkOptDescr
(InitFlags -> Last SpecLicense)
(Last SpecLicense -> InitFlags -> InitFlags)
InitFlags
-> OptionField InitFlags
forall get set a.
String
-> [String]
-> String
-> get
-> set
-> MkOptDescr get set a
-> OptionField a
option
[Char
'l']
[String
"license"]
String
"Project license."
InitFlags -> Last SpecLicense
IT.license
(\Last SpecLicense
v InitFlags
flags -> InitFlags
flags{IT.license = v})
( String
-> ReadE (Last SpecLicense)
-> (Last SpecLicense -> [String])
-> MkOptDescr
(InitFlags -> Last SpecLicense)
(Last SpecLicense -> InitFlags -> InitFlags)
InitFlags
forall b a.
Monoid b =>
String
-> ReadE b
-> (b -> [String])
-> MkOptDescr (a -> b) (b -> a -> a) a
reqArg
String
"LICENSE"
( (String -> String)
-> ParsecParser (Last SpecLicense) -> ReadE (Last SpecLicense)
forall a. (String -> String) -> ParsecParser a -> ReadE a
parsecToReadE
(String
"Cannot parse license: " String -> String -> String
forall a. [a] -> [a] -> [a]
++)
(SpecLicense -> Last SpecLicense
forall a. a -> Last a
toFlag (SpecLicense -> Last SpecLicense)
-> ParsecParser SpecLicense -> ParsecParser (Last SpecLicense)
forall a b. (a -> b) -> ParsecParser a -> ParsecParser b
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
`fmap` ParsecParser SpecLicense
forall a (m :: * -> *). (Parsec a, CabalParsing m) => m a
forall (m :: * -> *). CabalParsing m => m SpecLicense
parsec)
)
(Last String -> [String]
forall a. Flag a -> [a]
flagToList (Last String -> [String])
-> (Last SpecLicense -> Last String)
-> Last SpecLicense
-> [String]
forall b c a. (b -> c) -> (a -> b) -> a -> c
. (SpecLicense -> String) -> Last SpecLicense -> Last String
forall a b. (a -> b) -> Last a -> Last b
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
fmap SpecLicense -> String
forall a. Pretty a => a -> String
prettyShow)
)
, String
-> [String]
-> String
-> (InitFlags -> Last String)
-> (Last String -> InitFlags -> InitFlags)
-> MkOptDescr
(InitFlags -> Last String)
(Last String -> InitFlags -> InitFlags)
InitFlags
-> OptionField InitFlags
forall get set a.
String
-> [String]
-> String
-> get
-> set
-> MkOptDescr get set a
-> OptionField a
option
[Char
'a']
[String
"author"]
String
"Name of the project's author."
InitFlags -> Last String
IT.author
(\Last String
v InitFlags
flags -> InitFlags
flags{IT.author = v})
(String
-> MkOptDescr
(InitFlags -> Last String)
(Last String -> InitFlags -> InitFlags)
InitFlags
forall b.
String -> MkOptDescr (b -> Last String) (Last String -> b -> b) b
reqArgFlag String
"NAME")
, String
-> [String]
-> String
-> (InitFlags -> Last String)
-> (Last String -> InitFlags -> InitFlags)
-> MkOptDescr
(InitFlags -> Last String)
(Last String -> InitFlags -> InitFlags)
InitFlags
-> OptionField InitFlags
forall get set a.
String
-> [String]
-> String
-> get
-> set
-> MkOptDescr get set a
-> OptionField a
option
[Char
'e']
[String
"email"]
String
"Email address of the maintainer."
InitFlags -> Last String
IT.email
(\Last String
v InitFlags
flags -> InitFlags
flags{IT.email = v})
(String
-> MkOptDescr
(InitFlags -> Last String)
(Last String -> InitFlags -> InitFlags)
InitFlags
forall b.
String -> MkOptDescr (b -> Last String) (Last String -> b -> b) b
reqArgFlag String
"EMAIL")
, String
-> [String]
-> String
-> (InitFlags -> Last String)
-> (Last String -> InitFlags -> InitFlags)
-> MkOptDescr
(InitFlags -> Last String)
(Last String -> InitFlags -> InitFlags)
InitFlags
-> OptionField InitFlags
forall get set a.
String
-> [String]
-> String
-> get
-> set
-> MkOptDescr get set a
-> OptionField a
option
[Char
'u']
[String
"homepage"]
String
"Project homepage and/or repository."
InitFlags -> Last String
IT.homepage
(\Last String
v InitFlags
flags -> InitFlags
flags{IT.homepage = v})
(String
-> MkOptDescr
(InitFlags -> Last String)
(Last String -> InitFlags -> InitFlags)
InitFlags
forall b.
String -> MkOptDescr (b -> Last String) (Last String -> b -> b) b
reqArgFlag String
"URL")
, String
-> [String]
-> String
-> (InitFlags -> Last String)
-> (Last String -> InitFlags -> InitFlags)
-> MkOptDescr
(InitFlags -> Last String)
(Last String -> InitFlags -> InitFlags)
InitFlags
-> OptionField InitFlags
forall get set a.
String
-> [String]
-> String
-> get
-> set
-> MkOptDescr get set a
-> OptionField a
option
[Char
's']
[String
"synopsis"]
String
"Short project synopsis."
InitFlags -> Last String
IT.synopsis
(\Last String
v InitFlags
flags -> InitFlags
flags{IT.synopsis = v})
(String
-> MkOptDescr
(InitFlags -> Last String)
(Last String -> InitFlags -> InitFlags)
InitFlags
forall b.
String -> MkOptDescr (b -> Last String) (Last String -> b -> b) b
reqArgFlag String
"TEXT")
, String
-> [String]
-> String
-> (InitFlags -> Last String)
-> (Last String -> InitFlags -> InitFlags)
-> MkOptDescr
(InitFlags -> Last String)
(Last String -> InitFlags -> InitFlags)
InitFlags
-> OptionField InitFlags
forall get set a.
String
-> [String]
-> String
-> get
-> set
-> MkOptDescr get set a
-> OptionField a
option
[Char
'c']
[String
"category"]
String
"Project category."
InitFlags -> Last String
IT.category
(\Last String
v InitFlags
flags -> InitFlags
flags{IT.category = v})
(String
-> MkOptDescr
(InitFlags -> Last String)
(Last String -> InitFlags -> InitFlags)
InitFlags
forall b.
String -> MkOptDescr (b -> Last String) (Last String -> b -> b) b
reqArgFlag String
"CATEGORY")
, String
-> [String]
-> String
-> (InitFlags -> Last [String])
-> (Last [String] -> InitFlags -> InitFlags)
-> MkOptDescr
(InitFlags -> Last [String])
(Last [String] -> InitFlags -> InitFlags)
InitFlags
-> OptionField InitFlags
forall get set a.
String
-> [String]
-> String
-> get
-> set
-> MkOptDescr get set a
-> OptionField a
option
[Char
'x']
[String
"extra-source-file"]
String
"Extra source file to be distributed with tarball."
InitFlags -> Last [String]
IT.extraSrc
(\Last [String]
v InitFlags
flags -> InitFlags
flags{IT.extraSrc = mergeListFlag (IT.extraSrc flags) v})
( String
-> (String -> Last [String])
-> (Last [String] -> [String])
-> MkOptDescr
(InitFlags -> Last [String])
(Last [String] -> InitFlags -> InitFlags)
InitFlags
forall b a.
Monoid b =>
String
-> (String -> b)
-> (b -> [String])
-> MkOptDescr (a -> b) (b -> a -> a) a
reqArg'
String
"FILE"
([String] -> Last [String]
forall a. a -> Last a
Flag ([String] -> Last [String])
-> (String -> [String]) -> String -> Last [String]
forall b c a. (b -> c) -> (a -> b) -> a -> c
. (String -> [String] -> [String]
forall a. a -> [a] -> [a]
: []))
([String] -> Last [String] -> [String]
forall a. a -> Flag a -> a
fromFlagOrDefault [])
)
, String
-> [String]
-> String
-> (InitFlags -> Last [String])
-> (Last [String] -> InitFlags -> InitFlags)
-> MkOptDescr
(InitFlags -> Last [String])
(Last [String] -> InitFlags -> InitFlags)
InitFlags
-> OptionField InitFlags
forall get set a.
String
-> [String]
-> String
-> get
-> set
-> MkOptDescr get set a
-> OptionField a
option
[]
[String
"extra-doc-file"]
String
"Extra doc file to be distributed with tarball."
InitFlags -> Last [String]
IT.extraDoc
(\Last [String]
v InitFlags
flags -> InitFlags
flags{IT.extraDoc = mergeListFlag (IT.extraDoc flags) v})
(String
-> (String -> Last [String])
-> (Last [String] -> [String])
-> MkOptDescr
(InitFlags -> Last [String])
(Last [String] -> InitFlags -> InitFlags)
InitFlags
forall b a.
Monoid b =>
String
-> (String -> b)
-> (b -> [String])
-> MkOptDescr (a -> b) (b -> a -> a) a
reqArg' String
"FILE" ([String] -> Last [String]
forall a. a -> Last a
Flag ([String] -> Last [String])
-> (String -> [String]) -> String -> Last [String]
forall b c a. (b -> c) -> (a -> b) -> a -> c
. (String -> [String] -> [String]
forall a. a -> [a] -> [a]
: [])) ([String] -> Last [String] -> [String]
forall a. a -> Flag a -> a
fromFlagOrDefault []))
, String
-> [String]
-> String
-> (InitFlags -> Last PackageType)
-> (Last PackageType -> InitFlags -> InitFlags)
-> MkOptDescr
(InitFlags -> Last PackageType)
(Last PackageType -> InitFlags -> InitFlags)
InitFlags
-> OptionField InitFlags
forall get set a.
String
-> [String]
-> String
-> get
-> set
-> MkOptDescr get set a
-> OptionField a
option
[]
[String
"lib", String
"is-library"]
String
"Build a library."
InitFlags -> Last PackageType
IT.packageType
(\Last PackageType
v InitFlags
flags -> InitFlags
flags{IT.packageType = v})
(Last PackageType
-> MkOptDescr
(InitFlags -> Last PackageType)
(Last PackageType -> InitFlags -> InitFlags)
InitFlags
forall b a. Eq b => b -> MkOptDescr (a -> b) (b -> a -> a) a
noArg (PackageType -> Last PackageType
forall a. a -> Last a
Flag PackageType
IT.Library))
, String
-> [String]
-> String
-> (InitFlags -> Last PackageType)
-> (Last PackageType -> InitFlags -> InitFlags)
-> MkOptDescr
(InitFlags -> Last PackageType)
(Last PackageType -> InitFlags -> InitFlags)
InitFlags
-> OptionField InitFlags
forall get set a.
String
-> [String]
-> String
-> get
-> set
-> MkOptDescr get set a
-> OptionField a
option
[]
[String
"exe", String
"is-executable"]
String
"Build an executable."
InitFlags -> Last PackageType
IT.packageType
(\Last PackageType
v InitFlags
flags -> InitFlags
flags{IT.packageType = v})
(Last PackageType
-> MkOptDescr
(InitFlags -> Last PackageType)
(Last PackageType -> InitFlags -> InitFlags)
InitFlags
forall b a. Eq b => b -> MkOptDescr (a -> b) (b -> a -> a) a
noArg (PackageType -> Last PackageType
forall a. a -> Last a
Flag PackageType
IT.Executable))
, String
-> [String]
-> String
-> (InitFlags -> Last PackageType)
-> (Last PackageType -> InitFlags -> InitFlags)
-> MkOptDescr
(InitFlags -> Last PackageType)
(Last PackageType -> InitFlags -> InitFlags)
InitFlags
-> OptionField InitFlags
forall get set a.
String
-> [String]
-> String
-> get
-> set
-> MkOptDescr get set a
-> OptionField a
option
[]
[String
"libandexe", String
"is-libandexe"]
String
"Build a library and an executable."
InitFlags -> Last PackageType
IT.packageType
(\Last PackageType
v InitFlags
flags -> InitFlags
flags{IT.packageType = v})
(Last PackageType
-> MkOptDescr
(InitFlags -> Last PackageType)
(Last PackageType -> InitFlags -> InitFlags)
InitFlags
forall b a. Eq b => b -> MkOptDescr (a -> b) (b -> a -> a) a
noArg (PackageType -> Last PackageType
forall a. a -> Last a
Flag PackageType
IT.LibraryAndExecutable))
, String
-> [String]
-> String
-> (InitFlags -> Last Bool)
-> (Last Bool -> InitFlags -> InitFlags)
-> MkOptDescr
(InitFlags -> Last Bool)
(Last Bool -> InitFlags -> InitFlags)
InitFlags
-> OptionField InitFlags
forall get set a.
String
-> [String]
-> String
-> get
-> set
-> MkOptDescr get set a
-> OptionField a
option
[]
[String
"tests"]
String
"Generate a test suite, standalone or for a library."
InitFlags -> Last Bool
IT.initializeTestSuite
(\Last Bool
v InitFlags
flags -> InitFlags
flags{IT.initializeTestSuite = v})
MkOptDescr
(InitFlags -> Last Bool)
(Last Bool -> InitFlags -> InitFlags)
InitFlags
forall a. MkOptDescr (a -> Last Bool) (Last Bool -> a -> a) a
trueArg
, String
-> [String]
-> String
-> (InitFlags -> Last [String])
-> (Last [String] -> InitFlags -> InitFlags)
-> MkOptDescr
(InitFlags -> Last [String])
(Last [String] -> InitFlags -> InitFlags)
InitFlags
-> OptionField InitFlags
forall get set a.
String
-> [String]
-> String
-> get
-> set
-> MkOptDescr get set a
-> OptionField a
option
[]
[String
"test-dir"]
String
"Directory containing tests."
InitFlags -> Last [String]
IT.testDirs
( \Last [String]
v InitFlags
flags ->
InitFlags
flags{IT.testDirs = mergeListFlag (IT.testDirs flags) v}
)
( String
-> (String -> Last [String])
-> (Last [String] -> [String])
-> MkOptDescr
(InitFlags -> Last [String])
(Last [String] -> InitFlags -> InitFlags)
InitFlags
forall b a.
Monoid b =>
String
-> (String -> b)
-> (b -> [String])
-> MkOptDescr (a -> b) (b -> a -> a) a
reqArg'
String
"DIR"
([String] -> Last [String]
forall a. a -> Last a
Flag ([String] -> Last [String])
-> (String -> [String]) -> String -> Last [String]
forall b c a. (b -> c) -> (a -> b) -> a -> c
. (String -> [String] -> [String]
forall a. a -> [a] -> [a]
: []))
([String] -> Last [String] -> [String]
forall a. a -> Flag a -> a
fromFlagOrDefault [])
)
, String
-> [String]
-> String
-> (InitFlags -> Last Bool)
-> (Last Bool -> InitFlags -> InitFlags)
-> MkOptDescr
(InitFlags -> Last Bool)
(Last Bool -> InitFlags -> InitFlags)
InitFlags
-> OptionField InitFlags
forall get set a.
String
-> [String]
-> String
-> get
-> set
-> MkOptDescr get set a
-> OptionField a
option
[]
[String
"simple"]
String
"Create a simple project with sensible defaults."
InitFlags -> Last Bool
IT.simpleProject
(\Last Bool
v InitFlags
flags -> InitFlags
flags{IT.simpleProject = v})
MkOptDescr
(InitFlags -> Last Bool)
(Last Bool -> InitFlags -> InitFlags)
InitFlags
forall a. MkOptDescr (a -> Last Bool) (Last Bool -> a -> a) a
trueArg
, String
-> [String]
-> String
-> (InitFlags -> Last String)
-> (Last String -> InitFlags -> InitFlags)
-> MkOptDescr
(InitFlags -> Last String)
(Last String -> InitFlags -> InitFlags)
InitFlags
-> OptionField InitFlags
forall get set a.
String
-> [String]
-> String
-> get
-> set
-> MkOptDescr get set a
-> OptionField a
option
[]
[String
"main-is"]
String
"Specify the main module."
InitFlags -> Last String
IT.mainIs
(\Last String
v InitFlags
flags -> InitFlags
flags{IT.mainIs = v})
(String
-> MkOptDescr
(InitFlags -> Last String)
(Last String -> InitFlags -> InitFlags)
InitFlags
forall b.
String -> MkOptDescr (b -> Last String) (Last String -> b -> b) b
reqArgFlag String
"FILE")
, String
-> [String]
-> String
-> (InitFlags -> Last Language)
-> (Last Language -> InitFlags -> InitFlags)
-> MkOptDescr
(InitFlags -> Last Language)
(Last Language -> InitFlags -> InitFlags)
InitFlags
-> OptionField InitFlags
forall get set a.
String
-> [String]
-> String
-> get
-> set
-> MkOptDescr get set a
-> OptionField a
option
[]
[String
"language"]
String
"Specify the default language."
InitFlags -> Last Language
IT.language
(\Last Language
v InitFlags
flags -> InitFlags
flags{IT.language = v})
( String
-> ReadE (Last Language)
-> (Last Language -> [String])
-> MkOptDescr
(InitFlags -> Last Language)
(Last Language -> InitFlags -> InitFlags)
InitFlags
forall b a.
Monoid b =>
String
-> ReadE b
-> (b -> [String])
-> MkOptDescr (a -> b) (b -> a -> a) a
reqArg
String
"LANGUAGE"
( (String -> String)
-> ParsecParser (Last Language) -> ReadE (Last Language)
forall a. (String -> String) -> ParsecParser a -> ReadE a
parsecToReadE
(String
"Cannot parse language: " String -> String -> String
forall a. [a] -> [a] -> [a]
++)
(Language -> Last Language
forall a. a -> Last a
toFlag (Language -> Last Language)
-> ParsecParser Language -> ParsecParser (Last Language)
forall a b. (a -> b) -> ParsecParser a -> ParsecParser b
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
`fmap` ParsecParser Language
forall a (m :: * -> *). (Parsec a, CabalParsing m) => m a
forall (m :: * -> *). CabalParsing m => m Language
parsec)
)
(Last String -> [String]
forall a. Flag a -> [a]
flagToList (Last String -> [String])
-> (Last Language -> Last String) -> Last Language -> [String]
forall b c a. (b -> c) -> (a -> b) -> a -> c
. (Language -> String) -> Last Language -> Last String
forall a b. (a -> b) -> Last a -> Last b
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
fmap Language -> String
forall a. Pretty a => a -> String
prettyShow)
)
, String
-> [String]
-> String
-> (InitFlags -> Last [ModuleName])
-> (Last [ModuleName] -> InitFlags -> InitFlags)
-> MkOptDescr
(InitFlags -> Last [ModuleName])
(Last [ModuleName] -> InitFlags -> InitFlags)
InitFlags
-> OptionField InitFlags
forall get set a.
String
-> [String]
-> String
-> get
-> set
-> MkOptDescr get set a
-> OptionField a
option
[Char
'o']
[String
"expose-module"]
String
"Export a module from the package."
InitFlags -> Last [ModuleName]
IT.exposedModules
( \Last [ModuleName]
v InitFlags
flags ->
InitFlags
flags
{ IT.exposedModules =
mergeListFlag (IT.exposedModules flags) v
}
)
( String
-> ReadE (Last [ModuleName])
-> (Last [ModuleName] -> [String])
-> MkOptDescr
(InitFlags -> Last [ModuleName])
(Last [ModuleName] -> InitFlags -> InitFlags)
InitFlags
forall b a.
Monoid b =>
String
-> ReadE b
-> (b -> [String])
-> MkOptDescr (a -> b) (b -> a -> a) a
reqArg
String
"MODULE"
( (String -> String)
-> ParsecParser (Last [ModuleName]) -> ReadE (Last [ModuleName])
forall a. (String -> String) -> ParsecParser a -> ReadE a
parsecToReadE
(String
"Cannot parse module name: " String -> String -> String
forall a. [a] -> [a] -> [a]
++)
([ModuleName] -> Last [ModuleName]
forall a. a -> Last a
Flag ([ModuleName] -> Last [ModuleName])
-> (ModuleName -> [ModuleName]) -> ModuleName -> Last [ModuleName]
forall b c a. (b -> c) -> (a -> b) -> a -> c
. (ModuleName -> [ModuleName] -> [ModuleName]
forall a. a -> [a] -> [a]
: []) (ModuleName -> Last [ModuleName])
-> ParsecParser ModuleName -> ParsecParser (Last [ModuleName])
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
<$> ParsecParser ModuleName
forall a (m :: * -> *). (Parsec a, CabalParsing m) => m a
forall (m :: * -> *). CabalParsing m => m ModuleName
parsec)
)
([String]
-> ([ModuleName] -> [String]) -> Last [ModuleName] -> [String]
forall b a. b -> (a -> b) -> Flag a -> b
flagElim [] ((ModuleName -> String) -> [ModuleName] -> [String]
forall a b. (a -> b) -> [a] -> [b]
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
fmap ModuleName -> String
forall a. Pretty a => a -> String
prettyShow))
)
, String
-> [String]
-> String
-> (InitFlags -> Last [Extension])
-> (Last [Extension] -> InitFlags -> InitFlags)
-> MkOptDescr
(InitFlags -> Last [Extension])
(Last [Extension] -> InitFlags -> InitFlags)
InitFlags
-> OptionField InitFlags
forall get set a.
String
-> [String]
-> String
-> get
-> set
-> MkOptDescr get set a
-> OptionField a
option
[]
[String
"extension"]
String
"Use a LANGUAGE extension (in the other-extensions field)."
InitFlags -> Last [Extension]
IT.otherExts
( \Last [Extension]
v InitFlags
flags ->
InitFlags
flags
{ IT.otherExts =
mergeListFlag (IT.otherExts flags) v
}
)
( String
-> ReadE (Last [Extension])
-> (Last [Extension] -> [String])
-> MkOptDescr
(InitFlags -> Last [Extension])
(Last [Extension] -> InitFlags -> InitFlags)
InitFlags
forall b a.
Monoid b =>
String
-> ReadE b
-> (b -> [String])
-> MkOptDescr (a -> b) (b -> a -> a) a
reqArg
String
"EXTENSION"
( (String -> String)
-> ParsecParser (Last [Extension]) -> ReadE (Last [Extension])
forall a. (String -> String) -> ParsecParser a -> ReadE a
parsecToReadE
(String
"Cannot parse extension: " String -> String -> String
forall a. [a] -> [a] -> [a]
++)
([Extension] -> Last [Extension]
forall a. a -> Last a
Flag ([Extension] -> Last [Extension])
-> (Extension -> [Extension]) -> Extension -> Last [Extension]
forall b c a. (b -> c) -> (a -> b) -> a -> c
. (Extension -> [Extension] -> [Extension]
forall a. a -> [a] -> [a]
: []) (Extension -> Last [Extension])
-> ParsecParser Extension -> ParsecParser (Last [Extension])
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
<$> ParsecParser Extension
forall a (m :: * -> *). (Parsec a, CabalParsing m) => m a
forall (m :: * -> *). CabalParsing m => m Extension
parsec)
)
([String]
-> ([Extension] -> [String]) -> Last [Extension] -> [String]
forall b a. b -> (a -> b) -> Flag a -> b
flagElim [] ((Extension -> String) -> [Extension] -> [String]
forall a b. (a -> b) -> [a] -> [b]
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
fmap Extension -> String
forall a. Pretty a => a -> String
prettyShow))
)
, String
-> [String]
-> String
-> (InitFlags -> Last [Dependency])
-> (Last [Dependency] -> InitFlags -> InitFlags)
-> MkOptDescr
(InitFlags -> Last [Dependency])
(Last [Dependency] -> InitFlags -> InitFlags)
InitFlags
-> OptionField InitFlags
forall get set a.
String
-> [String]
-> String
-> get
-> set
-> MkOptDescr get set a
-> OptionField a
option
[Char
'd']
[String
"dependency"]
String
"Package dependencies. Permits comma separated list of dependencies."
InitFlags -> Last [Dependency]
IT.dependencies
( \Last [Dependency]
v InitFlags
flags ->
InitFlags
flags
{ IT.dependencies =
mergeListFlag (IT.dependencies flags) v
}
)
( String
-> ReadE (Last [Dependency])
-> (Last [Dependency] -> [String])
-> MkOptDescr
(InitFlags -> Last [Dependency])
(Last [Dependency] -> InitFlags -> InitFlags)
InitFlags
forall b a.
Monoid b =>
String
-> ReadE b
-> (b -> [String])
-> MkOptDescr (a -> b) (b -> a -> a) a
reqArg
String
"DEPENDENCIES"
(([Dependency] -> Last [Dependency])
-> ReadE [Dependency] -> ReadE (Last [Dependency])
forall a b. (a -> b) -> ReadE a -> ReadE b
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
fmap [Dependency] -> Last [Dependency]
forall a. a -> Last a
Flag ReadE [Dependency]
dependenciesReadE)
((Dependency -> String) -> [Dependency] -> [String]
forall a b. (a -> b) -> [a] -> [b]
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
fmap Dependency -> String
forall a. Pretty a => a -> String
prettyShow ([Dependency] -> [String])
-> (Last [Dependency] -> [Dependency])
-> Last [Dependency]
-> [String]
forall b c a. (b -> c) -> (a -> b) -> a -> c
. [Dependency] -> Last [Dependency] -> [Dependency]
forall a. a -> Flag a -> a
fromFlagOrDefault [])
)
, String
-> [String]
-> String
-> (InitFlags -> Last [String])
-> (Last [String] -> InitFlags -> InitFlags)
-> MkOptDescr
(InitFlags -> Last [String])
(Last [String] -> InitFlags -> InitFlags)
InitFlags
-> OptionField InitFlags
forall get set a.
String
-> [String]
-> String
-> get
-> set
-> MkOptDescr get set a
-> OptionField a
option
[]
[String
"application-dir"]
String
"Directory containing package application executable."
InitFlags -> Last [String]
IT.applicationDirs
( \Last [String]
v InitFlags
flags ->
InitFlags
flags
{ IT.applicationDirs =
mergeListFlag (IT.applicationDirs flags) v
}
)
( String
-> (String -> Last [String])
-> (Last [String] -> [String])
-> MkOptDescr
(InitFlags -> Last [String])
(Last [String] -> InitFlags -> InitFlags)
InitFlags
forall b a.
Monoid b =>
String
-> (String -> b)
-> (b -> [String])
-> MkOptDescr (a -> b) (b -> a -> a) a
reqArg'
String
"DIR"
([String] -> Last [String]
forall a. a -> Last a
Flag ([String] -> Last [String])
-> (String -> [String]) -> String -> Last [String]
forall b c a. (b -> c) -> (a -> b) -> a -> c
. (String -> [String] -> [String]
forall a. a -> [a] -> [a]
: []))
([String] -> Last [String] -> [String]
forall a. a -> Flag a -> a
fromFlagOrDefault [])
)
, String
-> [String]
-> String
-> (InitFlags -> Last [String])
-> (Last [String] -> InitFlags -> InitFlags)
-> MkOptDescr
(InitFlags -> Last [String])
(Last [String] -> InitFlags -> InitFlags)
InitFlags
-> OptionField InitFlags
forall get set a.
String
-> [String]
-> String
-> get
-> set
-> MkOptDescr get set a
-> OptionField a
option
[]
[String
"source-dir", String
"sourcedir"]
String
"Directory containing package library source."
InitFlags -> Last [String]
IT.sourceDirs
( \Last [String]
v InitFlags
flags ->
InitFlags
flags
{ IT.sourceDirs =
mergeListFlag (IT.sourceDirs flags) v
}
)
( String
-> (String -> Last [String])
-> (Last [String] -> [String])
-> MkOptDescr
(InitFlags -> Last [String])
(Last [String] -> InitFlags -> InitFlags)
InitFlags
forall b a.
Monoid b =>
String
-> (String -> b)
-> (b -> [String])
-> MkOptDescr (a -> b) (b -> a -> a) a
reqArg'
String
"DIR"
([String] -> Last [String]
forall a. a -> Last a
Flag ([String] -> Last [String])
-> (String -> [String]) -> String -> Last [String]
forall b c a. (b -> c) -> (a -> b) -> a -> c
. (String -> [String] -> [String]
forall a. a -> [a] -> [a]
: []))
([String] -> Last [String] -> [String]
forall a. a -> Flag a -> a
fromFlagOrDefault [])
)
, String
-> [String]
-> String
-> (InitFlags -> Last [String])
-> (Last [String] -> InitFlags -> InitFlags)
-> MkOptDescr
(InitFlags -> Last [String])
(Last [String] -> InitFlags -> InitFlags)
InitFlags
-> OptionField InitFlags
forall get set a.
String
-> [String]
-> String
-> get
-> set
-> MkOptDescr get set a
-> OptionField a
option
[]
[String
"build-tool"]
String
"Required external build tool."
InitFlags -> Last [String]
IT.buildTools
( \Last [String]
v InitFlags
flags ->
InitFlags
flags
{ IT.buildTools =
mergeListFlag (IT.buildTools flags) v
}
)
( String
-> (String -> Last [String])
-> (Last [String] -> [String])
-> MkOptDescr
(InitFlags -> Last [String])
(Last [String] -> InitFlags -> InitFlags)
InitFlags
forall b a.
Monoid b =>
String
-> (String -> b)
-> (b -> [String])
-> MkOptDescr (a -> b) (b -> a -> a) a
reqArg'
String
"TOOL"
([String] -> Last [String]
forall a. a -> Last a
Flag ([String] -> Last [String])
-> (String -> [String]) -> String -> Last [String]
forall b c a. (b -> c) -> (a -> b) -> a -> c
. (String -> [String] -> [String]
forall a. a -> [a] -> [a]
: []))
([String] -> Last [String] -> [String]
forall a. a -> Flag a -> a
fromFlagOrDefault [])
)
, String
-> [String]
-> String
-> (InitFlags -> Last String)
-> (Last String -> InitFlags -> InitFlags)
-> MkOptDescr
(InitFlags -> Last String)
(Last String -> InitFlags -> InitFlags)
InitFlags
-> OptionField InitFlags
forall get set a.
String
-> [String]
-> String
-> get
-> set
-> MkOptDescr get set a
-> OptionField a
option
String
"w"
[String
"with-compiler"]
String
"give the path to a particular compiler. For 'init', this flag is used \
\to set the bounds inferred for the 'base' package."
InitFlags -> Last String
IT.initHcPath
(\Last String
v InitFlags
flags -> InitFlags
flags{IT.initHcPath = v})
(String
-> MkOptDescr
(InitFlags -> Last String)
(Last String -> InitFlags -> InitFlags)
InitFlags
forall b.
String -> MkOptDescr (b -> Last String) (Last String -> b -> b) b
reqArgFlag String
"PATH")
, (InitFlags -> Last Verbosity)
-> (Last Verbosity -> InitFlags -> InitFlags)
-> OptionField InitFlags
forall flags.
(flags -> Last Verbosity)
-> (Last Verbosity -> flags -> flags) -> OptionField flags
optionVerbosity InitFlags -> Last Verbosity
IT.initVerbosity (\Last Verbosity
v InitFlags
flags -> InitFlags
flags{IT.initVerbosity = v})
]
where
dependenciesReadE :: ReadE [Dependency]
dependenciesReadE :: ReadE [Dependency]
dependenciesReadE =
(String -> String)
-> ParsecParser [Dependency] -> ReadE [Dependency]
forall a. (String -> String) -> ParsecParser a -> ReadE a
parsecToReadE
(String
"Cannot parse dependencies: " String -> String -> String
forall a. [a] -> [a] -> [a]
++)
(ParsecParser Dependency -> ParsecParser [Dependency]
forall (m :: * -> *) a. CabalParsing m => m a -> m [a]
parsecCommaList ParsecParser Dependency
forall a (m :: * -> *). (Parsec a, CabalParsing m) => m a
forall (m :: * -> *). CabalParsing m => m Dependency
parsec)
copyCommand :: CommandUI CopyFlags
copyCommand :: CommandUI CopyFlags
copyCommand =
CommandUI CopyFlags
Cabal.copyCommand
{ commandNotes = Just $ \String
pname ->
String
"Examples:\n"
String -> String -> String
forall a. [a] -> [a] -> [a]
++ String
" "
String -> String -> String
forall a. [a] -> [a] -> [a]
++ String
pname
String -> String -> String
forall a. [a] -> [a] -> [a]
++ String
" v1-copy "
String -> String -> String
forall a. [a] -> [a] -> [a]
++ String
" All the components in the package\n"
String -> String -> String
forall a. [a] -> [a] -> [a]
++ String
" "
String -> String -> String
forall a. [a] -> [a] -> [a]
++ String
pname
String -> String -> String
forall a. [a] -> [a] -> [a]
++ String
" v1-copy foo "
String -> String -> String
forall a. [a] -> [a] -> [a]
++ String
" A component (i.e. lib, exe, test suite)"
, commandUsage =
usageAlternatives "v1-copy" $
[ "[FLAGS]"
, "COMPONENTS [FLAGS]"
]
}
registerCommand :: CommandUI RegisterFlags
registerCommand :: CommandUI RegisterFlags
registerCommand =
CommandUI RegisterFlags
Cabal.registerCommand
{ commandUsage = \String
pname -> String
"Usage: " String -> String -> String
forall a. [a] -> [a] -> [a]
++ String
pname String -> String -> String
forall a. [a] -> [a] -> [a]
++ String
" v1-register [FLAGS]\n"
}
filterRegisterFlags :: RegisterFlags -> Version -> RegisterFlags
filterRegisterFlags :: RegisterFlags -> Version -> RegisterFlags
filterRegisterFlags RegisterFlags
flags Version
cabalLibVersion =
RegisterFlags
flags
{ registerCommonFlags =
filterCommonFlags (registerCommonFlags flags) cabalLibVersion
}
filterCopyFlags :: CopyFlags -> Version -> CopyFlags
filterCopyFlags :: CopyFlags -> Version -> CopyFlags
filterCopyFlags CopyFlags
flags Version
cabalLibVersion =
CopyFlags
flags
{ copyCommonFlags = filterCommonFlags (copyCommonFlags flags) cabalLibVersion
}
data ActAsSetupFlags = ActAsSetupFlags
{ ActAsSetupFlags -> Last BuildType
actAsSetupBuildType :: Flag BuildType
}
deriving ((forall x. ActAsSetupFlags -> Rep ActAsSetupFlags x)
-> (forall x. Rep ActAsSetupFlags x -> ActAsSetupFlags)
-> Generic ActAsSetupFlags
forall x. Rep ActAsSetupFlags x -> ActAsSetupFlags
forall x. ActAsSetupFlags -> Rep ActAsSetupFlags x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cfrom :: forall x. ActAsSetupFlags -> Rep ActAsSetupFlags x
from :: forall x. ActAsSetupFlags -> Rep ActAsSetupFlags x
$cto :: forall x. Rep ActAsSetupFlags x -> ActAsSetupFlags
to :: forall x. Rep ActAsSetupFlags x -> ActAsSetupFlags
Generic)
defaultActAsSetupFlags :: ActAsSetupFlags
defaultActAsSetupFlags :: ActAsSetupFlags
defaultActAsSetupFlags =
ActAsSetupFlags
{ actAsSetupBuildType :: Last BuildType
actAsSetupBuildType = BuildType -> Last BuildType
forall a. a -> Last a
toFlag BuildType
Simple
}
actAsSetupCommand :: CommandUI ActAsSetupFlags
actAsSetupCommand :: CommandUI ActAsSetupFlags
actAsSetupCommand =
CommandUI
{ commandName :: String
commandName = String
"act-as-setup"
, commandSynopsis :: String
commandSynopsis = String
"Run as-if this was a Setup.hs"
, commandDescription :: Maybe (String -> String)
commandDescription = Maybe (String -> String)
forall a. Maybe a
Nothing
, commandNotes :: Maybe (String -> String)
commandNotes = Maybe (String -> String)
forall a. Maybe a
Nothing
, commandUsage :: String -> String
commandUsage = \String
pname ->
String
"Usage: " String -> String -> String
forall a. [a] -> [a] -> [a]
++ String
pname String -> String -> String
forall a. [a] -> [a] -> [a]
++ String
" act-as-setup\n"
, commandDefaultFlags :: ActAsSetupFlags
commandDefaultFlags = ActAsSetupFlags
defaultActAsSetupFlags
, commandOptions :: ShowOrParseArgs -> [OptionField ActAsSetupFlags]
commandOptions = \ShowOrParseArgs
_ ->
[ String
-> [String]
-> String
-> (ActAsSetupFlags -> Last BuildType)
-> (Last BuildType -> ActAsSetupFlags -> ActAsSetupFlags)
-> MkOptDescr
(ActAsSetupFlags -> Last BuildType)
(Last BuildType -> ActAsSetupFlags -> ActAsSetupFlags)
ActAsSetupFlags
-> OptionField ActAsSetupFlags
forall get set a.
String
-> [String]
-> String
-> get
-> set
-> MkOptDescr get set a
-> OptionField a
option
String
""
[String
"build-type"]
String
"Use the given build type."
ActAsSetupFlags -> Last BuildType
actAsSetupBuildType
(\Last BuildType
v ActAsSetupFlags
flags -> ActAsSetupFlags
flags{actAsSetupBuildType = v})
( String
-> ReadE (Last BuildType)
-> (Last BuildType -> [String])
-> MkOptDescr
(ActAsSetupFlags -> Last BuildType)
(Last BuildType -> ActAsSetupFlags -> ActAsSetupFlags)
ActAsSetupFlags
forall b a.
Monoid b =>
String
-> ReadE b
-> (b -> [String])
-> MkOptDescr (a -> b) (b -> a -> a) a
reqArg
String
"BUILD-TYPE"
( (String -> String)
-> ParsecParser (Last BuildType) -> ReadE (Last BuildType)
forall a. (String -> String) -> ParsecParser a -> ReadE a
parsecToReadE
(String
"Cannot parse build type: " String -> String -> String
forall a. [a] -> [a] -> [a]
++)
((BuildType -> Last BuildType)
-> ParsecParser BuildType -> ParsecParser (Last BuildType)
forall a b. (a -> b) -> ParsecParser a -> ParsecParser b
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
fmap BuildType -> Last BuildType
forall a. a -> Last a
toFlag ParsecParser BuildType
forall a (m :: * -> *). (Parsec a, CabalParsing m) => m a
forall (m :: * -> *). CabalParsing m => m BuildType
parsec)
)
((BuildType -> String) -> [BuildType] -> [String]
forall a b. (a -> b) -> [a] -> [b]
map BuildType -> String
forall a. Pretty a => a -> String
prettyShow ([BuildType] -> [String])
-> (Last BuildType -> [BuildType]) -> Last BuildType -> [String]
forall b c a. (b -> c) -> (a -> b) -> a -> c
. Last BuildType -> [BuildType]
forall a. Flag a -> [a]
flagToList)
)
]
}
instance Monoid ActAsSetupFlags where
mempty :: ActAsSetupFlags
mempty = ActAsSetupFlags
forall a. (Generic a, GMonoid (Rep a)) => a
gmempty
mappend :: ActAsSetupFlags -> ActAsSetupFlags -> ActAsSetupFlags
mappend = ActAsSetupFlags -> ActAsSetupFlags -> ActAsSetupFlags
forall a. Semigroup a => a -> a -> a
(<>)
instance Semigroup ActAsSetupFlags where
<> :: ActAsSetupFlags -> ActAsSetupFlags -> ActAsSetupFlags
(<>) = ActAsSetupFlags -> ActAsSetupFlags -> ActAsSetupFlags
forall a. (Generic a, GSemigroup (Rep a)) => a -> a -> a
gmappend
data UserConfigFlags = UserConfigFlags
{ UserConfigFlags -> Last Verbosity
userConfigVerbosity :: Flag Verbosity
, UserConfigFlags -> Last Bool
userConfigForce :: Flag Bool
, UserConfigFlags -> Last [String]
userConfigAppendLines :: Flag [String]
}
deriving ((forall x. UserConfigFlags -> Rep UserConfigFlags x)
-> (forall x. Rep UserConfigFlags x -> UserConfigFlags)
-> Generic UserConfigFlags
forall x. Rep UserConfigFlags x -> UserConfigFlags
forall x. UserConfigFlags -> Rep UserConfigFlags x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cfrom :: forall x. UserConfigFlags -> Rep UserConfigFlags x
from :: forall x. UserConfigFlags -> Rep UserConfigFlags x
$cto :: forall x. Rep UserConfigFlags x -> UserConfigFlags
to :: forall x. Rep UserConfigFlags x -> UserConfigFlags
Generic)
instance Monoid UserConfigFlags where
mempty :: UserConfigFlags
mempty =
UserConfigFlags
{ userConfigVerbosity :: Last Verbosity
userConfigVerbosity = Verbosity -> Last Verbosity
forall a. a -> Last a
toFlag Verbosity
normal
, userConfigForce :: Last Bool
userConfigForce = Bool -> Last Bool
forall a. a -> Last a
toFlag Bool
False
, userConfigAppendLines :: Last [String]
userConfigAppendLines = [String] -> Last [String]
forall a. a -> Last a
toFlag []
}
mappend :: UserConfigFlags -> UserConfigFlags -> UserConfigFlags
mappend = UserConfigFlags -> UserConfigFlags -> UserConfigFlags
forall a. Semigroup a => a -> a -> a
(<>)
instance Semigroup UserConfigFlags where
<> :: UserConfigFlags -> UserConfigFlags -> UserConfigFlags
(<>) = UserConfigFlags -> UserConfigFlags -> UserConfigFlags
forall a. (Generic a, GSemigroup (Rep a)) => a -> a -> a
gmappend
userConfigCommand :: CommandUI UserConfigFlags
userConfigCommand :: CommandUI UserConfigFlags
userConfigCommand =
CommandUI
{ commandName :: String
commandName = String
"user-config"
, commandSynopsis :: String
commandSynopsis = String
"Display and update the user's global cabal configuration."
, commandDescription :: Maybe (String -> String)
commandDescription = (String -> String) -> Maybe (String -> String)
forall a. a -> Maybe a
Just ((String -> String) -> Maybe (String -> String))
-> (String -> String) -> Maybe (String -> String)
forall a b. (a -> b) -> a -> b
$ \String
_ ->
String -> String
wrapText (String -> String) -> String -> String
forall a b. (a -> b) -> a -> b
$
String
"When upgrading cabal, the set of configuration keys and their default"
String -> String -> String
forall a. [a] -> [a] -> [a]
++ String
" values may change. This command provides means to merge the existing"
String -> String -> String
forall a. [a] -> [a] -> [a]
++ String
" config in ~/.config/cabal/config"
String -> String -> String
forall a. [a] -> [a] -> [a]
++ String
" (i.e. all bindings that are actually defined and not commented out)"
String -> String -> String
forall a. [a] -> [a] -> [a]
++ String
" and the default config of the new version.\n"
String -> String -> String
forall a. [a] -> [a] -> [a]
++ String
"\n"
String -> String -> String
forall a. [a] -> [a] -> [a]
++ String
"init: Creates a new config file at either ~/.config/cabal/config or as"
String -> String -> String
forall a. [a] -> [a] -> [a]
++ String
" specified by --config-file, if given. An existing file won't be "
String -> String -> String
forall a. [a] -> [a] -> [a]
++ String
" overwritten unless -f or --force is given.\n"
String -> String -> String
forall a. [a] -> [a] -> [a]
++ String
"diff: Shows a pseudo-diff of the user's ~/.config/cabal/config file and"
String -> String -> String
forall a. [a] -> [a] -> [a]
++ String
" the default configuration that would be created by cabal if the"
String -> String -> String
forall a. [a] -> [a] -> [a]
++ String
" config file did not exist.\n"
String -> String -> String
forall a. [a] -> [a] -> [a]
++ String
"update: Applies the pseudo-diff to the configuration that would be"
String -> String -> String
forall a. [a] -> [a] -> [a]
++ String
" created by default, and write the result back to ~/.config/cabal/config."
, commandNotes :: Maybe (String -> String)
commandNotes = Maybe (String -> String)
forall a. Maybe a
Nothing
, commandUsage :: String -> String
commandUsage = String -> [String] -> String -> String
usageAlternatives String
"user-config" [String
"init", String
"diff", String
"update"]
, commandDefaultFlags :: UserConfigFlags
commandDefaultFlags = UserConfigFlags
forall a. Monoid a => a
mempty
, commandOptions :: ShowOrParseArgs -> [OptionField UserConfigFlags]
commandOptions = \ShowOrParseArgs
_ ->
[ (UserConfigFlags -> Last Verbosity)
-> (Last Verbosity -> UserConfigFlags -> UserConfigFlags)
-> OptionField UserConfigFlags
forall flags.
(flags -> Last Verbosity)
-> (Last Verbosity -> flags -> flags) -> OptionField flags
optionVerbosity UserConfigFlags -> Last Verbosity
userConfigVerbosity (\Last Verbosity
v UserConfigFlags
flags -> UserConfigFlags
flags{userConfigVerbosity = v})
, String
-> [String]
-> String
-> (UserConfigFlags -> Last Bool)
-> (Last Bool -> UserConfigFlags -> UserConfigFlags)
-> MkOptDescr
(UserConfigFlags -> Last Bool)
(Last Bool -> UserConfigFlags -> UserConfigFlags)
UserConfigFlags
-> OptionField UserConfigFlags
forall get set a.
String
-> [String]
-> String
-> get
-> set
-> MkOptDescr get set a
-> OptionField a
option
[Char
'f']
[String
"force"]
String
"Overwrite the config file if it already exists."
UserConfigFlags -> Last Bool
userConfigForce
(\Last Bool
v UserConfigFlags
flags -> UserConfigFlags
flags{userConfigForce = v})
MkOptDescr
(UserConfigFlags -> Last Bool)
(Last Bool -> UserConfigFlags -> UserConfigFlags)
UserConfigFlags
forall a. MkOptDescr (a -> Last Bool) (Last Bool -> a -> a) a
trueArg
, String
-> [String]
-> String
-> (UserConfigFlags -> Last [String])
-> (Last [String] -> UserConfigFlags -> UserConfigFlags)
-> MkOptDescr
(UserConfigFlags -> Last [String])
(Last [String] -> UserConfigFlags -> UserConfigFlags)
UserConfigFlags
-> OptionField UserConfigFlags
forall get set a.
String
-> [String]
-> String
-> get
-> set
-> MkOptDescr get set a
-> OptionField a
option
[Char
'a']
[String
"augment"]
String
"Additional setting to augment the config file (replacing a previous setting if it existed)."
UserConfigFlags -> Last [String]
userConfigAppendLines
( \Last [String]
v UserConfigFlags
flags ->
UserConfigFlags
flags
{ userConfigAppendLines =
Flag $ concat (flagToList (userConfigAppendLines flags) ++ flagToList v)
}
)
(String
-> (String -> Last [String])
-> (Last [String] -> [String])
-> MkOptDescr
(UserConfigFlags -> Last [String])
(Last [String] -> UserConfigFlags -> UserConfigFlags)
UserConfigFlags
forall b a.
Monoid b =>
String
-> (String -> b)
-> (b -> [String])
-> MkOptDescr (a -> b) (b -> a -> a) a
reqArg' String
"CONFIGLINE" ([String] -> Last [String]
forall a. a -> Last a
Flag ([String] -> Last [String])
-> (String -> [String]) -> String -> Last [String]
forall b c a. (b -> c) -> (a -> b) -> a -> c
. (String -> [String] -> [String]
forall a. a -> [a] -> [a]
: [])) ([String] -> Maybe [String] -> [String]
forall a. a -> Maybe a -> a
fromMaybe [] (Maybe [String] -> [String])
-> (Last [String] -> Maybe [String]) -> Last [String] -> [String]
forall b c a. (b -> c) -> (a -> b) -> a -> c
. Last [String] -> Maybe [String]
forall a. Flag a -> Maybe a
flagToMaybe))
]
}
reqArgFlag
:: ArgPlaceHolder
-> MkOptDescr (b -> Flag String) (Flag String -> b -> b) b
reqArgFlag :: forall b.
String -> MkOptDescr (b -> Last String) (Last String -> b -> b) b
reqArgFlag String
ad = String
-> ReadE (Last String)
-> (Last String -> [String])
-> MkOptDescr (b -> Last String) (Last String -> b -> b) b
forall b a.
Monoid b =>
String
-> ReadE b
-> (b -> [String])
-> MkOptDescr (a -> b) (b -> a -> a) a
reqArg String
ad ((String -> Last String) -> ReadE (Last String)
forall a. (String -> a) -> ReadE a
succeedReadE String -> Last String
forall a. a -> Last a
Flag) Last String -> [String]
forall a. Flag a -> [a]
flagToList
liftOptions
:: (b -> a)
-> (a -> b -> b)
-> [OptionField a]
-> [OptionField b]
liftOptions :: forall b a.
(b -> a) -> (a -> b -> b) -> [OptionField a] -> [OptionField b]
liftOptions b -> a
get a -> b -> b
set = (OptionField a -> OptionField b)
-> [OptionField a] -> [OptionField b]
forall a b. (a -> b) -> [a] -> [b]
map ((b -> a) -> (a -> b -> b) -> OptionField a -> OptionField b
forall b a.
(b -> a) -> (a -> b -> b) -> OptionField a -> OptionField b
liftOption b -> a
get a -> b -> b
set)
yesNoOpt :: ShowOrParseArgs -> MkOptDescr (b -> Flag Bool) (Flag Bool -> b -> b) b
yesNoOpt :: forall b.
ShowOrParseArgs
-> MkOptDescr (b -> Last Bool) (Last Bool -> b -> b) b
yesNoOpt ShowOrParseArgs
ShowArgs String
sf [String]
lf = MkOptDescr (b -> Last Bool) (Last Bool -> b -> b) b
forall a. MkOptDescr (a -> Last Bool) (Last Bool -> a -> a) a
trueArg String
sf [String]
lf
yesNoOpt ShowOrParseArgs
_ String
sf [String]
lf = (Last Bool -> Maybe Bool)
-> (Bool -> Last Bool)
-> OptFlags
-> OptFlags
-> MkOptDescr (b -> Last Bool) (Last Bool -> b -> b) b
forall b a.
(b -> Maybe Bool)
-> (Bool -> b)
-> OptFlags
-> OptFlags
-> MkOptDescr (a -> b) (b -> a -> a) a
Command.boolOpt' Last Bool -> Maybe Bool
forall a. Flag a -> Maybe a
flagToMaybe Bool -> Last Bool
forall a. a -> Last a
Flag (String
sf, [String]
lf) ([], (String -> String) -> [String] -> [String]
forall a b. (a -> b) -> [a] -> [b]
map (String
"no-" String -> String -> String
forall a. [a] -> [a] -> [a]
++) [String]
lf) String
sf [String]
lf
optionSolver
:: (flags -> Flag PreSolver)
-> (Flag PreSolver -> flags -> flags)
-> OptionField flags
optionSolver :: forall flags.
(flags -> Flag PreSolver)
-> (Flag PreSolver -> flags -> flags) -> OptionField flags
optionSolver flags -> Flag PreSolver
get Flag PreSolver -> flags -> flags
set =
String
-> [String]
-> String
-> (flags -> Flag PreSolver)
-> (Flag PreSolver -> flags -> flags)
-> MkOptDescr
(flags -> Flag PreSolver) (Flag PreSolver -> flags -> flags) flags
-> OptionField flags
forall get set a.
String
-> [String]
-> String
-> get
-> set
-> MkOptDescr get set a
-> OptionField a
option
[]
[String
"solver"]
(String
"Select dependency solver to use (default: " String -> String -> String
forall a. [a] -> [a] -> [a]
++ PreSolver -> String
forall a. Pretty a => a -> String
prettyShow PreSolver
defaultSolver String -> String -> String
forall a. [a] -> [a] -> [a]
++ String
"). Choices: " String -> String -> String
forall a. [a] -> [a] -> [a]
++ String
allSolvers String -> String -> String
forall a. [a] -> [a] -> [a]
++ String
".")
flags -> Flag PreSolver
get
Flag PreSolver -> flags -> flags
set
( String
-> ReadE (Flag PreSolver)
-> (Flag PreSolver -> [String])
-> MkOptDescr
(flags -> Flag PreSolver) (Flag PreSolver -> flags -> flags) flags
forall b a.
Monoid b =>
String
-> ReadE b
-> (b -> [String])
-> MkOptDescr (a -> b) (b -> a -> a) a
reqArg
String
"SOLVER"
( (String -> String)
-> ParsecParser (Flag PreSolver) -> ReadE (Flag PreSolver)
forall a. (String -> String) -> ParsecParser a -> ReadE a
parsecToReadE
(String -> String -> String
forall a b. a -> b -> a
const (String -> String -> String) -> String -> String -> String
forall a b. (a -> b) -> a -> b
$ String
"solver must be one of: " String -> String -> String
forall a. [a] -> [a] -> [a]
++ String
allSolvers)
(PreSolver -> Flag PreSolver
forall a. a -> Last a
toFlag (PreSolver -> Flag PreSolver)
-> ParsecParser PreSolver -> ParsecParser (Flag PreSolver)
forall a b. (a -> b) -> ParsecParser a -> ParsecParser b
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
`fmap` ParsecParser PreSolver
forall a (m :: * -> *). (Parsec a, CabalParsing m) => m a
forall (m :: * -> *). CabalParsing m => m PreSolver
parsec)
)
(Last String -> [String]
forall a. Flag a -> [a]
flagToList (Last String -> [String])
-> (Flag PreSolver -> Last String) -> Flag PreSolver -> [String]
forall b c a. (b -> c) -> (a -> b) -> a -> c
. (PreSolver -> String) -> Flag PreSolver -> Last String
forall a b. (a -> b) -> Last a -> Last b
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
fmap PreSolver -> String
forall a. Pretty a => a -> String
prettyShow)
)
optionSolverFlags
:: ShowOrParseArgs
-> (flags -> Flag Int)
-> (Flag Int -> flags -> flags)
-> (flags -> Flag ReorderGoals)
-> (Flag ReorderGoals -> flags -> flags)
-> (flags -> Flag CountConflicts)
-> (Flag CountConflicts -> flags -> flags)
-> (flags -> Flag FineGrainedConflicts)
-> (Flag FineGrainedConflicts -> flags -> flags)
-> (flags -> Flag MinimizeConflictSet)
-> (Flag MinimizeConflictSet -> flags -> flags)
-> (flags -> Flag IndependentGoals)
-> (Flag IndependentGoals -> flags -> flags)
-> (flags -> Flag PreferOldest)
-> (Flag PreferOldest -> flags -> flags)
-> (flags -> Flag ShadowPkgs)
-> (Flag ShadowPkgs -> flags -> flags)
-> (flags -> Flag StrongFlags)
-> (Flag StrongFlags -> flags -> flags)
-> (flags -> Flag AllowBootLibInstalls)
-> (Flag AllowBootLibInstalls -> flags -> flags)
-> (flags -> Flag OnlyConstrained)
-> (Flag OnlyConstrained -> flags -> flags)
-> [OptionField flags]
optionSolverFlags :: forall flags.
ShowOrParseArgs
-> (flags -> Flag Int)
-> (Flag Int -> flags -> flags)
-> (flags -> Flag ReorderGoals)
-> (Flag ReorderGoals -> flags -> flags)
-> (flags -> Flag CountConflicts)
-> (Flag CountConflicts -> flags -> flags)
-> (flags -> Flag FineGrainedConflicts)
-> (Flag FineGrainedConflicts -> flags -> flags)
-> (flags -> Flag MinimizeConflictSet)
-> (Flag MinimizeConflictSet -> flags -> flags)
-> (flags -> Flag IndependentGoals)
-> (Flag IndependentGoals -> flags -> flags)
-> (flags -> Flag PreferOldest)
-> (Flag PreferOldest -> flags -> flags)
-> (flags -> Flag ShadowPkgs)
-> (Flag ShadowPkgs -> flags -> flags)
-> (flags -> Flag StrongFlags)
-> (Flag StrongFlags -> flags -> flags)
-> (flags -> Flag AllowBootLibInstalls)
-> (Flag AllowBootLibInstalls -> flags -> flags)
-> (flags -> Flag OnlyConstrained)
-> (Flag OnlyConstrained -> flags -> flags)
-> [OptionField flags]
optionSolverFlags
ShowOrParseArgs
showOrParseArgs
flags -> Flag Int
getmbj
Flag Int -> flags -> flags
setmbj
flags -> Flag ReorderGoals
getrg
Flag ReorderGoals -> flags -> flags
setrg
flags -> Flag CountConflicts
getcc
Flag CountConflicts -> flags -> flags
setcc
flags -> Flag FineGrainedConflicts
getfgc
Flag FineGrainedConflicts -> flags -> flags
setfgc
flags -> Flag MinimizeConflictSet
getmc
Flag MinimizeConflictSet -> flags -> flags
setmc
flags -> Flag IndependentGoals
getig
Flag IndependentGoals -> flags -> flags
setig
flags -> Flag PreferOldest
getpo
Flag PreferOldest -> flags -> flags
setpo
flags -> Flag ShadowPkgs
getsip
Flag ShadowPkgs -> flags -> flags
setsip
flags -> Flag StrongFlags
getstrfl
Flag StrongFlags -> flags -> flags
setstrfl
flags -> Flag AllowBootLibInstalls
getib
Flag AllowBootLibInstalls -> flags -> flags
setib
flags -> Flag OnlyConstrained
getoc
Flag OnlyConstrained -> flags -> flags
setoc =
[ String
-> [String]
-> String
-> (flags -> Flag Int)
-> (Flag Int -> flags -> flags)
-> MkOptDescr
(flags -> Flag Int) (Flag Int -> flags -> flags) flags
-> OptionField flags
forall get set a.
String
-> [String]
-> String
-> get
-> set
-> MkOptDescr get set a
-> OptionField a
option
[]
[String
"max-backjumps"]
(String
"Maximum number of backjumps allowed while solving (default: " String -> String -> String
forall a. [a] -> [a] -> [a]
++ Int -> String
forall a. Show a => a -> String
show Int
defaultMaxBackjumps String -> String -> String
forall a. [a] -> [a] -> [a]
++ String
"). Use a negative number to enable unlimited backtracking. Use 0 to disable backtracking completely.")
flags -> Flag Int
getmbj
Flag Int -> flags -> flags
setmbj
( String
-> ReadE (Flag Int)
-> (Flag Int -> [String])
-> MkOptDescr
(flags -> Flag Int) (Flag Int -> flags -> flags) flags
forall b a.
Monoid b =>
String
-> ReadE b
-> (b -> [String])
-> MkOptDescr (a -> b) (b -> a -> a) a
reqArg
String
"NUM"
((String -> String) -> ParsecParser (Flag Int) -> ReadE (Flag Int)
forall a. (String -> String) -> ParsecParser a -> ReadE a
parsecToReadE (String
"Cannot parse number: " String -> String -> String
forall a. [a] -> [a] -> [a]
++) ((Int -> Flag Int) -> ParsecParser Int -> ParsecParser (Flag Int)
forall a b. (a -> b) -> ParsecParser a -> ParsecParser b
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
fmap Int -> Flag Int
forall a. a -> Last a
toFlag ParsecParser Int
forall (m :: * -> *) a. (CharParsing m, Integral a) => m a
P.signedIntegral))
((Int -> String) -> [Int] -> [String]
forall a b. (a -> b) -> [a] -> [b]
map Int -> String
forall a. Show a => a -> String
show ([Int] -> [String]) -> (Flag Int -> [Int]) -> Flag Int -> [String]
forall b c a. (b -> c) -> (a -> b) -> a -> c
. Flag Int -> [Int]
forall a. Flag a -> [a]
flagToList)
)
, String
-> [String]
-> String
-> (flags -> Last Bool)
-> (Last Bool -> flags -> flags)
-> MkOptDescr
(flags -> Last Bool) (Last Bool -> flags -> flags) flags
-> OptionField flags
forall get set a.
String
-> [String]
-> String
-> get
-> set
-> MkOptDescr get set a
-> OptionField a
option
[]
[String
"reorder-goals"]
String
"Try to reorder goals according to certain heuristics. Slows things down on average, but may make backtracking faster for some packages."
((ReorderGoals -> Bool) -> Flag ReorderGoals -> Last Bool
forall a b. (a -> b) -> Last a -> Last b
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
fmap ReorderGoals -> Bool
forall a. BooleanFlag a => a -> Bool
asBool (Flag ReorderGoals -> Last Bool)
-> (flags -> Flag ReorderGoals) -> flags -> Last Bool
forall b c a. (b -> c) -> (a -> b) -> a -> c
. flags -> Flag ReorderGoals
getrg)
(Flag ReorderGoals -> flags -> flags
setrg (Flag ReorderGoals -> flags -> flags)
-> (Last Bool -> Flag ReorderGoals) -> Last Bool -> flags -> flags
forall b c a. (b -> c) -> (a -> b) -> a -> c
. (Bool -> ReorderGoals) -> Last Bool -> Flag ReorderGoals
forall a b. (a -> b) -> Last a -> Last b
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
fmap Bool -> ReorderGoals
ReorderGoals)
(ShowOrParseArgs
-> MkOptDescr
(flags -> Last Bool) (Last Bool -> flags -> flags) flags
forall b.
ShowOrParseArgs
-> MkOptDescr (b -> Last Bool) (Last Bool -> b -> b) b
yesNoOpt ShowOrParseArgs
showOrParseArgs)
, String
-> [String]
-> String
-> (flags -> Last Bool)
-> (Last Bool -> flags -> flags)
-> MkOptDescr
(flags -> Last Bool) (Last Bool -> flags -> flags) flags
-> OptionField flags
forall get set a.
String
-> [String]
-> String
-> get
-> set
-> MkOptDescr get set a
-> OptionField a
option
[]
[String
"count-conflicts"]
String
"Try to speed up solving by preferring goals that are involved in a lot of conflicts (default)."
((CountConflicts -> Bool) -> Flag CountConflicts -> Last Bool
forall a b. (a -> b) -> Last a -> Last b
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
fmap CountConflicts -> Bool
forall a. BooleanFlag a => a -> Bool
asBool (Flag CountConflicts -> Last Bool)
-> (flags -> Flag CountConflicts) -> flags -> Last Bool
forall b c a. (b -> c) -> (a -> b) -> a -> c
. flags -> Flag CountConflicts
getcc)
(Flag CountConflicts -> flags -> flags
setcc (Flag CountConflicts -> flags -> flags)
-> (Last Bool -> Flag CountConflicts)
-> Last Bool
-> flags
-> flags
forall b c a. (b -> c) -> (a -> b) -> a -> c
. (Bool -> CountConflicts) -> Last Bool -> Flag CountConflicts
forall a b. (a -> b) -> Last a -> Last b
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
fmap Bool -> CountConflicts
CountConflicts)
(ShowOrParseArgs
-> MkOptDescr
(flags -> Last Bool) (Last Bool -> flags -> flags) flags
forall b.
ShowOrParseArgs
-> MkOptDescr (b -> Last Bool) (Last Bool -> b -> b) b
yesNoOpt ShowOrParseArgs
showOrParseArgs)
, String
-> [String]
-> String
-> (flags -> Last Bool)
-> (Last Bool -> flags -> flags)
-> MkOptDescr
(flags -> Last Bool) (Last Bool -> flags -> flags) flags
-> OptionField flags
forall get set a.
String
-> [String]
-> String
-> get
-> set
-> MkOptDescr get set a
-> OptionField a
option
[]
[String
"fine-grained-conflicts"]
String
"Skip a version of a package if it does not resolve the conflicts encountered in the last version, as a solver optimization (default)."
((FineGrainedConflicts -> Bool)
-> Flag FineGrainedConflicts -> Last Bool
forall a b. (a -> b) -> Last a -> Last b
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
fmap FineGrainedConflicts -> Bool
forall a. BooleanFlag a => a -> Bool
asBool (Flag FineGrainedConflicts -> Last Bool)
-> (flags -> Flag FineGrainedConflicts) -> flags -> Last Bool
forall b c a. (b -> c) -> (a -> b) -> a -> c
. flags -> Flag FineGrainedConflicts
getfgc)
(Flag FineGrainedConflicts -> flags -> flags
setfgc (Flag FineGrainedConflicts -> flags -> flags)
-> (Last Bool -> Flag FineGrainedConflicts)
-> Last Bool
-> flags
-> flags
forall b c a. (b -> c) -> (a -> b) -> a -> c
. (Bool -> FineGrainedConflicts)
-> Last Bool -> Flag FineGrainedConflicts
forall a b. (a -> b) -> Last a -> Last b
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
fmap Bool -> FineGrainedConflicts
FineGrainedConflicts)
(ShowOrParseArgs
-> MkOptDescr
(flags -> Last Bool) (Last Bool -> flags -> flags) flags
forall b.
ShowOrParseArgs
-> MkOptDescr (b -> Last Bool) (Last Bool -> b -> b) b
yesNoOpt ShowOrParseArgs
showOrParseArgs)
, String
-> [String]
-> String
-> (flags -> Last Bool)
-> (Last Bool -> flags -> flags)
-> MkOptDescr
(flags -> Last Bool) (Last Bool -> flags -> flags) flags
-> OptionField flags
forall get set a.
String
-> [String]
-> String
-> get
-> set
-> MkOptDescr get set a
-> OptionField a
option
[]
[String
"minimize-conflict-set"]
( String
"When there is no solution, try to improve the error message by finding "
String -> String -> String
forall a. [a] -> [a] -> [a]
++ String
"a minimal conflict set (default: false). May increase run time "
String -> String -> String
forall a. [a] -> [a] -> [a]
++ String
"significantly."
)
((MinimizeConflictSet -> Bool)
-> Flag MinimizeConflictSet -> Last Bool
forall a b. (a -> b) -> Last a -> Last b
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
fmap MinimizeConflictSet -> Bool
forall a. BooleanFlag a => a -> Bool
asBool (Flag MinimizeConflictSet -> Last Bool)
-> (flags -> Flag MinimizeConflictSet) -> flags -> Last Bool
forall b c a. (b -> c) -> (a -> b) -> a -> c
. flags -> Flag MinimizeConflictSet
getmc)
(Flag MinimizeConflictSet -> flags -> flags
setmc (Flag MinimizeConflictSet -> flags -> flags)
-> (Last Bool -> Flag MinimizeConflictSet)
-> Last Bool
-> flags
-> flags
forall b c a. (b -> c) -> (a -> b) -> a -> c
. (Bool -> MinimizeConflictSet)
-> Last Bool -> Flag MinimizeConflictSet
forall a b. (a -> b) -> Last a -> Last b
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
fmap Bool -> MinimizeConflictSet
MinimizeConflictSet)
(ShowOrParseArgs
-> MkOptDescr
(flags -> Last Bool) (Last Bool -> flags -> flags) flags
forall b.
ShowOrParseArgs
-> MkOptDescr (b -> Last Bool) (Last Bool -> b -> b) b
yesNoOpt ShowOrParseArgs
showOrParseArgs)
, String
-> [String]
-> String
-> (flags -> Last Bool)
-> (Last Bool -> flags -> flags)
-> MkOptDescr
(flags -> Last Bool) (Last Bool -> flags -> flags) flags
-> OptionField flags
forall get set a.
String
-> [String]
-> String
-> get
-> set
-> MkOptDescr get set a
-> OptionField a
option
[]
[String
"independent-goals"]
String
"Treat several goals on the command line as independent. If several goals depend on the same package, different versions can be chosen."
((IndependentGoals -> Bool) -> Flag IndependentGoals -> Last Bool
forall a b. (a -> b) -> Last a -> Last b
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
fmap IndependentGoals -> Bool
forall a. BooleanFlag a => a -> Bool
asBool (Flag IndependentGoals -> Last Bool)
-> (flags -> Flag IndependentGoals) -> flags -> Last Bool
forall b c a. (b -> c) -> (a -> b) -> a -> c
. flags -> Flag IndependentGoals
getig)
(Flag IndependentGoals -> flags -> flags
setig (Flag IndependentGoals -> flags -> flags)
-> (Last Bool -> Flag IndependentGoals)
-> Last Bool
-> flags
-> flags
forall b c a. (b -> c) -> (a -> b) -> a -> c
. (Bool -> IndependentGoals) -> Last Bool -> Flag IndependentGoals
forall a b. (a -> b) -> Last a -> Last b
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
fmap Bool -> IndependentGoals
IndependentGoals)
(ShowOrParseArgs
-> MkOptDescr
(flags -> Last Bool) (Last Bool -> flags -> flags) flags
forall b.
ShowOrParseArgs
-> MkOptDescr (b -> Last Bool) (Last Bool -> b -> b) b
yesNoOpt ShowOrParseArgs
showOrParseArgs)
, String
-> [String]
-> String
-> (flags -> Last Bool)
-> (Last Bool -> flags -> flags)
-> MkOptDescr
(flags -> Last Bool) (Last Bool -> flags -> flags) flags
-> OptionField flags
forall get set a.
String
-> [String]
-> String
-> get
-> set
-> MkOptDescr get set a
-> OptionField a
option
[]
[String
"prefer-oldest"]
String
"Prefer the oldest (instead of the latest) versions of packages available. Useful to determine lower bounds in the build-depends section."
((PreferOldest -> Bool) -> Flag PreferOldest -> Last Bool
forall a b. (a -> b) -> Last a -> Last b
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
fmap PreferOldest -> Bool
forall a. BooleanFlag a => a -> Bool
asBool (Flag PreferOldest -> Last Bool)
-> (flags -> Flag PreferOldest) -> flags -> Last Bool
forall b c a. (b -> c) -> (a -> b) -> a -> c
. flags -> Flag PreferOldest
getpo)
(Flag PreferOldest -> flags -> flags
setpo (Flag PreferOldest -> flags -> flags)
-> (Last Bool -> Flag PreferOldest) -> Last Bool -> flags -> flags
forall b c a. (b -> c) -> (a -> b) -> a -> c
. (Bool -> PreferOldest) -> Last Bool -> Flag PreferOldest
forall a b. (a -> b) -> Last a -> Last b
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
fmap Bool -> PreferOldest
PreferOldest)
(ShowOrParseArgs
-> MkOptDescr
(flags -> Last Bool) (Last Bool -> flags -> flags) flags
forall b.
ShowOrParseArgs
-> MkOptDescr (b -> Last Bool) (Last Bool -> b -> b) b
yesNoOpt ShowOrParseArgs
showOrParseArgs)
, String
-> [String]
-> String
-> (flags -> Last Bool)
-> (Last Bool -> flags -> flags)
-> MkOptDescr
(flags -> Last Bool) (Last Bool -> flags -> flags) flags
-> OptionField flags
forall get set a.
String
-> [String]
-> String
-> get
-> set
-> MkOptDescr get set a
-> OptionField a
option
[]
[String
"shadow-installed-packages"]
String
"If multiple package instances of the same version are installed, treat all but one as shadowed."
((ShadowPkgs -> Bool) -> Flag ShadowPkgs -> Last Bool
forall a b. (a -> b) -> Last a -> Last b
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
fmap ShadowPkgs -> Bool
forall a. BooleanFlag a => a -> Bool
asBool (Flag ShadowPkgs -> Last Bool)
-> (flags -> Flag ShadowPkgs) -> flags -> Last Bool
forall b c a. (b -> c) -> (a -> b) -> a -> c
. flags -> Flag ShadowPkgs
getsip)
(Flag ShadowPkgs -> flags -> flags
setsip (Flag ShadowPkgs -> flags -> flags)
-> (Last Bool -> Flag ShadowPkgs) -> Last Bool -> flags -> flags
forall b c a. (b -> c) -> (a -> b) -> a -> c
. (Bool -> ShadowPkgs) -> Last Bool -> Flag ShadowPkgs
forall a b. (a -> b) -> Last a -> Last b
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
fmap Bool -> ShadowPkgs
ShadowPkgs)
(ShowOrParseArgs
-> MkOptDescr
(flags -> Last Bool) (Last Bool -> flags -> flags) flags
forall b.
ShowOrParseArgs
-> MkOptDescr (b -> Last Bool) (Last Bool -> b -> b) b
yesNoOpt ShowOrParseArgs
showOrParseArgs)
, String
-> [String]
-> String
-> (flags -> Last Bool)
-> (Last Bool -> flags -> flags)
-> MkOptDescr
(flags -> Last Bool) (Last Bool -> flags -> flags) flags
-> OptionField flags
forall get set a.
String
-> [String]
-> String
-> get
-> set
-> MkOptDescr get set a
-> OptionField a
option
[]
[String
"strong-flags"]
String
"Do not defer flag choices (this used to be the default in cabal-install <= 1.20)."
((StrongFlags -> Bool) -> Flag StrongFlags -> Last Bool
forall a b. (a -> b) -> Last a -> Last b
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
fmap StrongFlags -> Bool
forall a. BooleanFlag a => a -> Bool
asBool (Flag StrongFlags -> Last Bool)
-> (flags -> Flag StrongFlags) -> flags -> Last Bool
forall b c a. (b -> c) -> (a -> b) -> a -> c
. flags -> Flag StrongFlags
getstrfl)
(Flag StrongFlags -> flags -> flags
setstrfl (Flag StrongFlags -> flags -> flags)
-> (Last Bool -> Flag StrongFlags) -> Last Bool -> flags -> flags
forall b c a. (b -> c) -> (a -> b) -> a -> c
. (Bool -> StrongFlags) -> Last Bool -> Flag StrongFlags
forall a b. (a -> b) -> Last a -> Last b
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
fmap Bool -> StrongFlags
StrongFlags)
(ShowOrParseArgs
-> MkOptDescr
(flags -> Last Bool) (Last Bool -> flags -> flags) flags
forall b.
ShowOrParseArgs
-> MkOptDescr (b -> Last Bool) (Last Bool -> b -> b) b
yesNoOpt ShowOrParseArgs
showOrParseArgs)
, String
-> [String]
-> String
-> (flags -> Last Bool)
-> (Last Bool -> flags -> flags)
-> MkOptDescr
(flags -> Last Bool) (Last Bool -> flags -> flags) flags
-> OptionField flags
forall get set a.
String
-> [String]
-> String
-> get
-> set
-> MkOptDescr get set a
-> OptionField a
option
[]
[String
"allow-boot-library-installs"]
String
"Allow cabal to install base, ghc-prim, integer-simple, integer-gmp, and template-haskell."
((AllowBootLibInstalls -> Bool)
-> Flag AllowBootLibInstalls -> Last Bool
forall a b. (a -> b) -> Last a -> Last b
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
fmap AllowBootLibInstalls -> Bool
forall a. BooleanFlag a => a -> Bool
asBool (Flag AllowBootLibInstalls -> Last Bool)
-> (flags -> Flag AllowBootLibInstalls) -> flags -> Last Bool
forall b c a. (b -> c) -> (a -> b) -> a -> c
. flags -> Flag AllowBootLibInstalls
getib)
(Flag AllowBootLibInstalls -> flags -> flags
setib (Flag AllowBootLibInstalls -> flags -> flags)
-> (Last Bool -> Flag AllowBootLibInstalls)
-> Last Bool
-> flags
-> flags
forall b c a. (b -> c) -> (a -> b) -> a -> c
. (Bool -> AllowBootLibInstalls)
-> Last Bool -> Flag AllowBootLibInstalls
forall a b. (a -> b) -> Last a -> Last b
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
fmap Bool -> AllowBootLibInstalls
AllowBootLibInstalls)
(ShowOrParseArgs
-> MkOptDescr
(flags -> Last Bool) (Last Bool -> flags -> flags) flags
forall b.
ShowOrParseArgs
-> MkOptDescr (b -> Last Bool) (Last Bool -> b -> b) b
yesNoOpt ShowOrParseArgs
showOrParseArgs)
, String
-> [String]
-> String
-> (flags -> Flag OnlyConstrained)
-> (Flag OnlyConstrained -> flags -> flags)
-> MkOptDescr
(flags -> Flag OnlyConstrained)
(Flag OnlyConstrained -> flags -> flags)
flags
-> OptionField flags
forall get set a.
String
-> [String]
-> String
-> get
-> set
-> MkOptDescr get set a
-> OptionField a
option
[]
[String
"reject-unconstrained-dependencies"]
String
"Require these packages to have constraints on them if they are to be selected (default: none)."
flags -> Flag OnlyConstrained
getoc
Flag OnlyConstrained -> flags -> flags
setoc
( String
-> ReadE (Flag OnlyConstrained)
-> (Flag OnlyConstrained -> [String])
-> MkOptDescr
(flags -> Flag OnlyConstrained)
(Flag OnlyConstrained -> flags -> flags)
flags
forall b a.
Monoid b =>
String
-> ReadE b
-> (b -> [String])
-> MkOptDescr (a -> b) (b -> a -> a) a
reqArg
String
"none|all"
( (String -> String)
-> ParsecParser (Flag OnlyConstrained)
-> ReadE (Flag OnlyConstrained)
forall a. (String -> String) -> ParsecParser a -> ReadE a
parsecToReadE
(String -> String -> String
forall a b. a -> b -> a
const String
"reject-unconstrained-dependencies must be 'none' or 'all'")
(OnlyConstrained -> Flag OnlyConstrained
forall a. a -> Last a
toFlag (OnlyConstrained -> Flag OnlyConstrained)
-> ParsecParser OnlyConstrained
-> ParsecParser (Flag OnlyConstrained)
forall a b. (a -> b) -> ParsecParser a -> ParsecParser b
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
`fmap` ParsecParser OnlyConstrained
forall a (m :: * -> *). (Parsec a, CabalParsing m) => m a
forall (m :: * -> *). CabalParsing m => m OnlyConstrained
parsec)
)
(Last String -> [String]
forall a. Flag a -> [a]
flagToList (Last String -> [String])
-> (Flag OnlyConstrained -> Last String)
-> Flag OnlyConstrained
-> [String]
forall b c a. (b -> c) -> (a -> b) -> a -> c
. (OnlyConstrained -> String) -> Flag OnlyConstrained -> Last String
forall a b. (a -> b) -> Last a -> Last b
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
fmap OnlyConstrained -> String
forall a. Pretty a => a -> String
prettyShow)
)
]
usagePackages :: String -> String -> String
usagePackages :: String -> String -> String
usagePackages String
name String
pname =
String
"Usage: " String -> String -> String
forall a. [a] -> [a] -> [a]
++ String
pname String -> String -> String
forall a. [a] -> [a] -> [a]
++ String
" " String -> String -> String
forall a. [a] -> [a] -> [a]
++ String
name String -> String -> String
forall a. [a] -> [a] -> [a]
++ String
" [PACKAGES]\n"
usageFlags :: String -> String -> String
usageFlags :: String -> String -> String
usageFlags String
name String
pname =
String
"Usage: " String -> String -> String
forall a. [a] -> [a] -> [a]
++ String
pname String -> String -> String
forall a. [a] -> [a] -> [a]
++ String
" " String -> String -> String
forall a. [a] -> [a] -> [a]
++ String
name String -> String -> String
forall a. [a] -> [a] -> [a]
++ String
" [FLAGS]\n"
showRemoteRepo :: RemoteRepo -> String
showRemoteRepo :: RemoteRepo -> String
showRemoteRepo = RemoteRepo -> String
forall a. Pretty a => a -> String
prettyShow
readRemoteRepo :: String -> Maybe RemoteRepo
readRemoteRepo :: String -> Maybe RemoteRepo
readRemoteRepo = String -> Maybe RemoteRepo
forall a. Parsec a => String -> Maybe a
simpleParsec
showLocalRepo :: LocalRepo -> String
showLocalRepo :: LocalRepo -> String
showLocalRepo = LocalRepo -> String
forall a. Pretty a => a -> String
prettyShow
readLocalRepo :: String -> Maybe LocalRepo
readLocalRepo :: String -> Maybe LocalRepo
readLocalRepo = String -> Maybe LocalRepo
forall a. Parsec a => String -> Maybe a
simpleParsec
relevantConfigValuesText :: [String] -> String
relevantConfigValuesText :: [String] -> String
relevantConfigValuesText [String]
vs =
String
"Relevant global configuration keys:\n"
String -> String -> String
forall a. [a] -> [a] -> [a]
++ [String] -> String
forall (t :: * -> *) a. Foldable t => t [a] -> [a]
concat [String
" " String -> String -> String
forall a. [a] -> [a] -> [a]
++ String
v String -> String -> String
forall a. [a] -> [a] -> [a]
++ String
"\n" | String
v <- [String]
vs]