Skip to content
GitLab
Explore
Sign in
Register
Primary navigation
Search or go to…
Project
G
ghcup-hs
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Iterations
Wiki
Requirements
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Locked files
Build
Pipelines
Jobs
Pipeline schedules
Test cases
Artifacts
Deploy
Releases
Package Registry
Container Registry
Model registry
Operate
Environments
Terraform modules
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Code review analytics
Issue analytics
Insights
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Terms and privacy
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
Haskell
ghcup-hs
Commits
877b55e2
Commit
877b55e2
authored
4 years ago
by
Arjun Kathuria
Browse files
Options
Downloads
Patches
Plain Diff
Adds basic "nuke" command structure so that it reflects in ghcup cli
parent
d9d19643
No related branches found
No related tags found
1 merge request
!101
[WIP] Feature "nuke"
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
app/ghcup/Main.hs
+16
-2
16 additions, 2 deletions
app/ghcup/Main.hs
with
16 additions
and
2 deletions
app/ghcup/Main.hs
+
16
−
2
View file @
877b55e2
...
...
@@ -103,6 +103,7 @@ data Command
|
Upgrade
UpgradeOpts
Bool
|
ToolRequirements
|
ChangeLog
ChangeLogOptions
|
Nuke
#
if
defined
(
BRICK
)
|
Interactive
#
endif
...
...
@@ -219,7 +220,7 @@ invertableSwitch'
->
Mod
FlagFields
Bool
-- ^ option modifier for --no-foo
->
Parser
(
Maybe
Bool
)
invertableSwitch'
longopt
shortopt
defv
enmod
dismod
=
optional
(
flag'
True
(
enmod
<>
long
longopt
<>
if
defv
then
mempty
else
short
shortopt
)
(
flag'
True
(
enmod
<>
long
longopt
<>
if
defv
then
mempty
else
short
shortopt
)
<|>
flag'
False
(
dismod
<>
long
nolongopt
<>
if
defv
then
short
shortopt
else
mempty
)
)
where
...
...
@@ -368,6 +369,14 @@ com =
)
<>
internal
)
<|>
subparser
(
command
"nuke"
(
info
(
pure
Nuke
<**>
helper
)
(
progDesc
"Completely remove ghcup from your system"
))
<>
commandGroup
"Nuclear Commands:"
)
where
installToolFooter
::
String
installToolFooter
=
[
s
|
Discussion:
...
...
@@ -393,7 +402,6 @@ com =
By default returns the URI of the ChangeLog of the latest GHC release.
Pass '-o' to automatically open via xdg-open.
|]
installCabalFooter
::
String
installCabalFooter
=
[
s
|
Discussion:
Installs the specified cabal-install version (or a recommended default one)
...
...
@@ -1654,6 +1662,10 @@ Make sure to clean up #{tmpdir} afterwards.|])
VLeft
e
->
do
runLogger
$
$
(
logError
)
$
T
.
pack
$
prettyShow
e
pure
$
ExitFailure
12
Nuke
->
do
putStrLn
"Nuking in 3...2....1"
putStrLn
"BOOM!"
pure
ExitSuccess
ChangeLog
ChangeLogOptions
{
..
}
->
do
let
tool
=
fromMaybe
GHC
clTool
...
...
@@ -1696,6 +1708,8 @@ Make sure to clean up #{tmpdir} afterwards.|])
case
res
of
ExitSuccess
->
pure
()
ef
@
(
ExitFailure
_
)
->
exitWith
ef
pure
()
fromVersion
::
(
MonadLogger
m
,
MonadFail
m
,
MonadReader
AppState
m
,
MonadThrow
m
,
MonadIO
m
,
MonadCatch
m
)
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment