@@ -50,6 +50,7 @@ module Distribution.Client.Setup
50
50
, userConfigCommand , UserConfigFlags (.. )
51
51
, manpageCommand
52
52
, haddockCommand
53
+ , cleanCommand
53
54
54
55
, parsePackageArgs
55
56
-- TODO: stop exporting these:
@@ -92,6 +93,7 @@ import Distribution.Simple.Setup
92
93
( ConfigFlags (.. ), BuildFlags (.. ), ReplFlags
93
94
, TestFlags (.. ), BenchmarkFlags (.. )
94
95
, SDistFlags (.. ), HaddockFlags (.. )
96
+ , CleanFlags (.. )
95
97
, readPackageDbList , showPackageDbList
96
98
, Flag (.. ), toFlag , flagToMaybe , flagToList , maybeToFlag
97
99
, BooleanFlag (.. ), optionVerbosity
@@ -194,6 +196,7 @@ globalCommand commands = CommandUI {
194
196
, " new-exec"
195
197
, " new-update"
196
198
, " new-install"
199
+ , " new-clean"
197
200
, " v1-build"
198
201
, " v1-configure"
199
202
, " v1-repl"
@@ -205,6 +208,7 @@ globalCommand commands = CommandUI {
205
208
, " v1-exec"
206
209
, " v1-update"
207
210
, " v1-install"
211
+ , " v1-clean"
208
212
]
209
213
maxlen = maximum $ [length name | (name, _) <- cmdDescs]
210
214
align str = str ++ replicate (maxlen - length str) ' '
@@ -275,6 +279,7 @@ globalCommand commands = CommandUI {
275
279
, addCmd " new-exec"
276
280
, addCmd " new-update"
277
281
, addCmd " new-install"
282
+ , addCmd " new-clean"
278
283
, par
279
284
, startGroup " legacy command aliases"
280
285
, addCmd " v1-build"
@@ -288,6 +293,7 @@ globalCommand commands = CommandUI {
288
293
, addCmd " v1-exec"
289
294
, addCmd " v1-update"
290
295
, addCmd " v1-install"
296
+ , addCmd " v1-clean"
291
297
] ++ if null otherCmds then [] else par
292
298
: startGroup " other"
293
299
: [addCmd n | n <- otherCmds])
@@ -403,7 +409,7 @@ globalCommand commands = CommandUI {
403
409
404
410
configureCommand :: CommandUI ConfigFlags
405
411
configureCommand = c
406
- { commandName = " v1- configure"
412
+ { commandName = " configure"
407
413
, commandDefaultFlags = mempty
408
414
, commandDescription = Just $ \ _ -> wrapText $
409
415
" Configure how the package is built by setting "
@@ -1221,16 +1227,11 @@ upgradeCommand = configureCommand {
1221
1227
commandOptions = commandOptions installCommand
1222
1228
}
1223
1229
1224
- {-
1225
- cleanCommand :: CommandUI ()
1226
- cleanCommand = makeCommand name shortDesc longDesc emptyFlags options
1227
- where
1228
- name = "clean"
1229
- shortDesc = "Removes downloaded files"
1230
- longDesc = Nothing
1231
- emptyFlags = ()
1232
- options _ = []
1233
- -}
1230
+ cleanCommand :: CommandUI CleanFlags
1231
+ cleanCommand = Cabal. cleanCommand
1232
+ { commandUsage = \ pname ->
1233
+ " Usage: " ++ pname ++ " v1-clean [FLAGS]\n "
1234
+ }
1234
1235
1235
1236
checkCommand :: CommandUI (Flag Verbosity )
1236
1237
checkCommand = CommandUI {
@@ -1753,8 +1754,7 @@ installCommand = CommandUI {
1753
1754
1754
1755
haddockCommand :: CommandUI HaddockFlags
1755
1756
haddockCommand = Cabal. haddockCommand
1756
- { commandName = " v1-haddock"
1757
- , commandUsage = usageAlternatives " v1-haddock" $
1757
+ { commandUsage = usageAlternatives " v1-haddock" $
1758
1758
[ " [FLAGS]" , " COMPONENTS [FLAGS]" ]
1759
1759
}
1760
1760
0 commit comments