Commit 7888be19 authored by refold's avatar refold
Browse files

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

parent 0a1e67ee
...@@ -22,7 +22,7 @@ module Distribution.Client.Setup ...@@ -22,7 +22,7 @@ module Distribution.Client.Setup
, upgradeCommand , upgradeCommand
, infoCommand, InfoFlags(..) , infoCommand, InfoFlags(..)
, fetchCommand, FetchFlags(..) , fetchCommand, FetchFlags(..)
, getCommand, GetFlags(..) , getCommand, unpackCommand, GetFlags(..)
, checkCommand , checkCommand
, uploadCommand, UploadFlags(..) , uploadCommand, UploadFlags(..)
, reportCommand, ReportFlags(..) , reportCommand, ReportFlags(..)
...@@ -562,6 +562,13 @@ getCommand = CommandUI { ...@@ -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 instance Monoid GetFlags where
mempty = defaultGetFlags mempty = defaultGetFlags
mappend a b = GetFlags { mappend a b = GetFlags {
......
...@@ -21,7 +21,7 @@ import Distribution.Client.Setup ...@@ -21,7 +21,7 @@ import Distribution.Client.Setup
, InstallFlags(..), defaultInstallFlags , InstallFlags(..), defaultInstallFlags
, installCommand, upgradeCommand , installCommand, upgradeCommand
, FetchFlags(..), fetchCommand , FetchFlags(..), fetchCommand
, GetFlags(..), getCommand , GetFlags(..), getCommand, unpackCommand
, checkCommand , checkCommand
, updateCommand , updateCommand
, ListFlags(..), listCommand , ListFlags(..), listCommand
...@@ -151,6 +151,8 @@ mainWorker args = topHandler $ ...@@ -151,6 +151,8 @@ mainWorker args = topHandler $
,infoCommand `commandAddAction` infoAction ,infoCommand `commandAddAction` infoAction
,fetchCommand `commandAddAction` fetchAction ,fetchCommand `commandAddAction` fetchAction
,getCommand `commandAddAction` getAction ,getCommand `commandAddAction` getAction
,hiddenCommand $
unpackCommand `commandAddAction` unpackAction
,checkCommand `commandAddAction` checkAction ,checkCommand `commandAddAction` checkAction
,sdistCommand `commandAddAction` sdistAction ,sdistCommand `commandAddAction` sdistAction
,uploadCommand `commandAddAction` uploadAction ,uploadCommand `commandAddAction` uploadAction
...@@ -581,6 +583,14 @@ getAction getFlags extraArgs globalFlags = do ...@@ -581,6 +583,14 @@ getAction getFlags extraArgs globalFlags = do
getFlags getFlags
targets 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 -> [String] -> GlobalFlags -> IO ()
initAction initFlags _extraArgs globalFlags = do initAction initFlags _extraArgs globalFlags = do
let verbosity = fromFlag (initVerbosity initFlags) 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