Skip to content
GitLab
Explore
Sign in
Register
Primary navigation
Search or go to…
Project
G
ghcup
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Iterations
Requirements
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Locked files
Deploy
Releases
Model registry
Monitor
Incidents
Analyze
Value stream analytics
Contributor 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
Merge requests
!74
Implement changelog subcommand wrt
#72
Code
Review changes
Check out branch
Download
Patches
Plain diff
Merged
Implement changelog subcommand wrt
#72
changelog-subcommand
into
master
Overview
0
Commits
1
Changes
1
Merged
Ghost User
requested to merge
changelog-subcommand
into
master
6 years ago
Overview
0
Commits
1
Changes
1
Expand
0
0
Merge request reports
Compare
master
master (base)
and
latest version
latest version
12f9f155
1 commit,
6 years ago
1 file
+
88
−
0
Inline
Compare changes
Side-by-side
Inline
Show whitespace changes
Show one file at a time
ghcup
+
88
−
0
Options
@@ -192,6 +192,7 @@ SUBCOMMANDS:
rm Remove an already installed GHC
install-cabal Install cabal-install
debug-info Print debug info (e.g. detected system/distro)
changelog Show the changelog of a GHC release (online)
DISCUSSION:
ghcup installs the Glasgow Haskell Compiler from the official
@@ -420,6 +421,32 @@ DISCUSSION:
exit
1
}
# @FUNCTION: changelog_usage
# @DESCRIPTION:
# Print the help message for 'ghcup set' to STDERR
# and exit the script with status code 1.
changelog_usage
()
{
(>
&2
echo
"ghcup-changelog
View the online changelog for the given GHC version
USAGE:
${
SCRIPT
}
changelog [FLAGS] [VERSION|TAG]
FLAGS:
-h, --help Prints help information
ARGS:
[VERSION|TAG] E.g.
\"
8.4.3
\"
or
\"
8.6.3
\"
or
a tag like
\"
recommended
\"
or
\"
latest
\"
(default: discovers latest version)
DISCUSSION:
Opens the online changelog for the given GHC version via
xdg-open.
"
)
exit
1
}
@@ -1667,6 +1694,39 @@ list() {
}
##############################
#--[ Subcommand changelog ]--#
##############################
# @FUNCTION: changelog_url
# @USAGE: <ghcversion>
# @DESCRIPTION:
# Print the changelog url for the given GHC version to stdout.
# @STDOUT: the changelog url
changelog_url
()
{
[
-z
"
$1
"
]
&&
die
"Internal error: no argument given to changelog"
printf
"https://downloads.haskell.org/~ghc/%s/docs/html/users_guide/%s-notes.html"
"
$1
"
"
$1
"
}
# @FUNCTION: changelog
# @USAGE: <ghcversion>
# @DESCRIPTION:
# Opens the changelog for the given ghc version via xdg-open.
changelog
()
{
[
-z
"
$1
"
]
&&
die
"Internal error: no argument given to changelog"
url
=
$(
changelog_url
"
$1
"
)
xdg-open
"
${
url
}
"
||
die
"failed to xdg-open the following url:
${
url
}
"
unset
url
}
#######################
#--[ Sanity checks ]--#
@@ -1912,6 +1972,34 @@ while [ $# -gt 0 ] ; do
done
list
"
${
TOOL
}
"
break
;;
changelog
)
shift
1
while
[
$#
-gt
0
]
;
do
case
$1
in
-h
|
--help
)
changelog_usage
;;
-f
|
--force
)
FORCE
=
true
shift
1
;;
*
)
GHC_VER
=
$1
break
;;
esac
done
if
[
-z
"
${
GHC_VER
}
"
]
;
then
_tool_ver
=
"
$(
get_tool_ver_from_tag
"ghc"
"latest"
)
"
if
[
-z
"
${
_tool_ver
}
"
]
;
then
die
"Could not find a latest GHC version, please report a bug at
${
BUG_URL
}
!"
fi
changelog
"
${
_tool_ver
}
"
else
# could be a version or a tag, let's check
if
array_contains
"
${
GHC_VER
}
"
"
$(
known_tool_versions
"ghc"
)
"
;
then
changelog
"
${
GHC_VER
}
"
elif
array_contains
"
${
GHC_VER
}
"
"
$(
known_tool_tags
"ghc"
)
"
;
then
changelog
"
$(
get_tool_ver_from_tag
"ghc"
"
${
GHC_VER
}
"
)
"
else
die
"
\"
${
GHC_VER
}
\"
is not a known version or tag!"
fi
fi
break
;;
*
)
usage
;;
esac
break
;;
Loading