-
Notifications
You must be signed in to change notification settings - Fork 696
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #6457 from phadej/v2-run-z
Add --ignore-project flag to v2-run
- Loading branch information
Showing
5 changed files
with
127 additions
and
42 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,3 +1,6 @@ | ||
{- cabal: | ||
build-depends: base, containers | ||
-} | ||
{-# LANGUAGE DeriveFunctor #-} | ||
module Main (main) where | ||
|
||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
39 changes: 39 additions & 0 deletions
39
cabal-install/Distribution/Client/CmdRun/ClientRunFlags.hs
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,39 @@ | ||
{-# LANGUAGE DeriveGeneric #-} | ||
{-# LANGUAGE LambdaCase #-} | ||
module Distribution.Client.CmdRun.ClientRunFlags | ||
( ClientRunFlags(..) | ||
, defaultClientRunFlags | ||
, clientRunOptions | ||
) where | ||
|
||
import Distribution.Client.Compat.Prelude | ||
|
||
import Distribution.Simple.Command (OptionField (..), ShowOrParseArgs (..), option) | ||
import Distribution.Simple.Setup (Flag (..), toFlag, trueArg) | ||
|
||
data ClientRunFlags = ClientRunFlags | ||
{ crunIgnoreProject :: Flag Bool | ||
} deriving (Eq, Show, Generic) | ||
|
||
instance Monoid ClientRunFlags where | ||
mempty = gmempty | ||
mappend = (<>) | ||
|
||
instance Semigroup ClientRunFlags where | ||
(<>) = gmappend | ||
|
||
instance Binary ClientRunFlags | ||
instance Structured ClientRunFlags | ||
|
||
defaultClientRunFlags :: ClientRunFlags | ||
defaultClientRunFlags = ClientRunFlags | ||
{ crunIgnoreProject = toFlag False | ||
} | ||
|
||
clientRunOptions :: ShowOrParseArgs -> [OptionField ClientRunFlags] | ||
clientRunOptions _ = | ||
[ option "z" ["ignore-project"] | ||
"Ignore local project configuration" | ||
crunIgnoreProject (\v flags -> flags { crunIgnoreProject = v }) | ||
trueArg | ||
] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters