@@ -26,7 +26,11 @@ import RIO.Process ( withProcessContextNoLogging )
26
26
import Stack.Build ( buildCmd )
27
27
import Stack.BuildInfo ( hpackVersion , versionString' )
28
28
import Stack.Clean ( CleanCommand (.. ), cleanCmd )
29
- import Stack.ConfigCmd as ConfigCmd
29
+ import Stack.ConfigCmd
30
+ ( cfgCmdBuildFiles , cfgCmdBuildFilesName , cfgCmdEnv
31
+ , cfgCmdEnvName , configCmdEnvParser , cfgCmdName , cfgCmdSet
32
+ , cfgCmdSetName , configCmdSetParser
33
+ )
30
34
import Stack.Constants
31
35
( globalFooter , osIsWindows , relFileStack , relFileStackDotExe
32
36
, stackProgName
@@ -72,7 +76,9 @@ import qualified Stack.Path ( path )
72
76
import Stack.Prelude
73
77
import Stack.Query ( queryCmd )
74
78
import Stack.Runners
75
- ( ShouldReexec (.. ), withConfig , withDefaultEnvConfig )
79
+ ( ShouldReexec (.. ), withBuildConfig , withConfig
80
+ , withDefaultEnvConfig
81
+ )
76
82
import Stack.SDist ( sdistCmd )
77
83
import Stack.Script ( ScriptOpts (.. ), scriptCmd )
78
84
import Stack.SetupCmd ( setupCmd )
@@ -224,19 +230,28 @@ commandLineHandler currentDir progName mExecutablePath isInterpreter =
224
230
(cleanOptsParser Clean )
225
231
226
232
config = addSubCommands'
227
- ConfigCmd. cfgCmdName
233
+ cfgCmdName
228
234
" Subcommands for accessing and modifying configuration values."
229
235
( do
230
236
addCommand'
231
- ConfigCmd. cfgCmdSetName
232
- " Sets a key in configuration file to value."
237
+ cfgCmdSetName
238
+ " Set a key in a configuration file to value."
233
239
(withConfig NoReexec . cfgCmdSet)
234
240
configCmdSetParser
235
241
addCommandWithLocalInstallRootFooter
236
- ConfigCmd. cfgCmdEnvName
242
+ cfgCmdEnvName
237
243
" Print environment variables for use in a shell."
238
244
(withConfig YesReexec . withDefaultEnvConfig . cfgCmdEnv)
239
245
configCmdEnvParser
246
+ addCommand'
247
+ cfgCmdBuildFilesName
248
+ " Generate (when applicable) a Cabal file from a package \
249
+ \ description in the Hpack format and/or a lock file for Stack's \
250
+ \project-level configuration."
251
+ -- It is withBuildConfig that yields the desired actions;
252
+ -- cfgCmdBuildFiles itself yields nothing of interest.
253
+ (withConfig YesReexec . withBuildConfig . cfgCmdBuildFiles)
254
+ (pure () )
240
255
)
241
256
242
257
docker = addSubCommands'
0 commit comments