You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
ghcup set 9.8.4 is a shorthand for ghcup set ghc 9.8.4. Additionally, blahis a valid version. We don't enforce PVP, so that users can install different bindists side by side.
As such, I don't think we should be introducing special casing here.
Edit:
You also omitted part of the output, which clearly warns you're using on old command:
[ Warn ] This is an old-style command for setting GHC. Use 'ghcup set ghc' instead.
Then you execute ghcup set ghc blah and the error is exactly what we expect:
[ Error ] [GHCup-00130] The version 'blah' of the tool ghc is not installed.
But now that I think about it... what we could do is:
when we catch a "not installed" error AND
the tool version is not PVP compliant (we can trivially check), THEN
we can adjust the error message pointing to the fact that you might have misspelled something
$ /home/hasufell/git/ghcup-hs/dist-newstyle/build/x86_64-linux/ghc-9.6.7.20250131/ghcup-0.1.40.0/x/ghcup/build/ghcup/ghcup set blah
[ Warn ] This is an old-style command for setting GHC. Use 'ghcup set ghc' instead.
[ Error ] [GHCup-00130] The version 'blah' of the tool ghc is not installed.
[ ... ] The version you specified is not a PVP version. Did you misspell?
If that sounds reasonable, we have to figure out which subcommands (and combination of errors) should be adjusted for that behavior. I'm assuming it is not just set.
Currently, if I do
(literally, i.e. a wrong argument
blah
for the subcommandlist
), I get the long generic help message aboutghcup
, i.e. the output ofghcup --help
.Feature request: print the output of
ghcup list --help
in this case.I haven't checked all other subcommands, but e.g.
set
is funny:which is certainly not a nice message.
The text was updated successfully, but these errors were encountered: