Commit 7888be19 authored by refold's avatar refold

Make 'unpack' a (hidden, deprecated) alias for 'get'.

parent 0a1e67ee
......@@ -22,7 +22,7 @@ module Distribution.Client.Setup
, upgradeCommand
, infoCommand, InfoFlags(..)
, fetchCommand, FetchFlags(..)
, getCommand, GetFlags(..)
, getCommand, unpackCommand, GetFlags(..)
, checkCommand
, uploadCommand, UploadFlags(..)
, reportCommand, ReportFlags(..)
......@@ -562,6 +562,13 @@ getCommand = CommandUI {
]
}
-- 'cabal unpack' is a deprecated alias for 'cabal get'.
unpackCommand :: CommandUI GetFlags
unpackCommand = getCommand {
commandName = "unpack",
commandUsage = usagePackages "unpack"
}
instance Monoid GetFlags where
mempty = defaultGetFlags
mappend a b = GetFlags {
......
......@@ -21,7 +21,7 @@ import Distribution.Client.Setup
, InstallFlags(..), defaultInstallFlags
, installCommand, upgradeCommand
, FetchFlags(..), fetchCommand
, GetFlags(..), getCommand
, GetFlags(..), getCommand, unpackCommand
, checkCommand
, updateCommand
, ListFlags(..), listCommand
......@@ -151,6 +151,8 @@ mainWorker args = topHandler $
,infoCommand `commandAddAction` infoAction
,fetchCommand `commandAddAction` fetchAction
,getCommand `commandAddAction` getAction
,hiddenCommand $
unpackCommand `commandAddAction` unpackAction
,checkCommand `commandAddAction` checkAction
,sdistCommand `commandAddAction` sdistAction
,uploadCommand `commandAddAction` uploadAction
......@@ -581,6 +583,14 @@ getAction getFlags extraArgs globalFlags = do
getFlags
targets
unpackAction :: GetFlags -> [String] -> GlobalFlags -> IO ()
unpackAction getFlags extraArgs globalFlags = do
let verbosity = fromFlag (getVerbosity getFlags)
notice verbosity $ "The 'unpack' command is deprecated "
++ "and will be removed in a future release. "
++ "Please use 'cabal get' instead."
getAction getFlags extraArgs globalFlags
initAction :: InitFlags -> [String] -> GlobalFlags -> IO ()
initAction initFlags _extraArgs globalFlags = do
let verbosity = fromFlag (initVerbosity initFlags)
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment