@@ -36,6 +36,7 @@ import Distribution.Client.Setup
36
36
, ReportFlags (.. )
37
37
, UploadFlags (.. )
38
38
, UserConfigFlags (.. )
39
+ , PathFlags (.. )
39
40
, actAsSetupCommand
40
41
, benchmarkCommand
41
42
, buildCommand
@@ -69,6 +70,7 @@ import Distribution.Client.Setup
69
70
, unpackCommand
70
71
, uploadCommand
71
72
, userConfigCommand
73
+ , pathCommand
72
74
, withRepoContext
73
75
)
74
76
import Distribution.Simple.Setup
@@ -102,6 +104,9 @@ import Distribution.Client.Config
102
104
, loadConfig
103
105
, userConfigDiff
104
106
, userConfigUpdate
107
+ , defaultCacheDir
108
+ , defaultLogsDir
109
+ , defaultStoreDir
105
110
)
106
111
import qualified Distribution.Client.List as List
107
112
( info
@@ -368,6 +373,7 @@ mainWorker args = do
368
373
, regularCmd reportCommand reportAction
369
374
, regularCmd initCommand initAction
370
375
, regularCmd userConfigCommand userConfigAction
376
+ , regularCmd pathCommand pathAction
371
377
, regularCmd genBoundsCommand genBoundsAction
372
378
, regularCmd CmdOutdated. outdatedCommand CmdOutdated. outdatedAction
373
379
, wrapperCmd hscolourCommand hscolourVerbosity hscolourDistPref
@@ -1320,3 +1326,14 @@ manpageAction commands flags extraArgs _ = do
1320
1326
then dropExtension pname
1321
1327
else pname
1322
1328
manpageCmd cabalCmd commands flags
1329
+
1330
+ pathAction :: PathFlags -> [String ] -> Action
1331
+ pathAction pathflags _extraArgs _globalFlags = do
1332
+ let verbosity = fromFlag (pathVerbosity pathflags)
1333
+ cfg <- loadConfig verbosity mempty
1334
+ putStrLn . (" cache-dir: " ++ ) =<< maybe defaultCacheDir pure
1335
+ (flagToMaybe $ globalCacheDir $ savedGlobalFlags cfg)
1336
+ putStrLn . (" logs-dir: " ++ ) =<< maybe defaultLogsDir pure
1337
+ (flagToMaybe $ globalLogsDir $ savedGlobalFlags cfg)
1338
+ putStrLn . (" store-dir: " ++ ) =<< maybe defaultStoreDir pure
1339
+ (flagToMaybe $ globalStoreDir $ savedGlobalFlags cfg)
0 commit comments