Skip to content

Commit 02bfdfd

Browse files
harpocrates23Skidoo
authored andcommitted
Deprecate hscolour, add hyperlink-source synonyms
* warning in hscolour's description * warning when hscolour is run * added 'hyperlinked-source' (the name Haddock has for the option) as a synonym for 'hyperlink-source' Follows up comments from #5140.
1 parent 15e793a commit 02bfdfd

File tree

3 files changed

+9
-2
lines changed

3 files changed

+9
-2
lines changed

Cabal/ChangeLog.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -37,6 +37,7 @@
3737
* Options listed in `ghc-options`, `cc-options`, `ld-options`,
3838
`cxx-options`, `cpp-options` are not deduplicated anymore
3939
([#4449](https://github.com/haskell/cabal/issues/4449)).
40+
* Deprecated `cabal hscolour` in favour of `cabal haddock --hyperlink-source` ([#5236](https://github.com/haskell/cabal/pull/5236/)).
4041

4142
----
4243

Cabal/Distribution/Simple/Haddock.hs

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -751,6 +751,11 @@ hscolour' onNoHsColour haddockTarget pkg_descr lbi suffixes flags =
751751
where
752752
go :: ConfiguredProgram -> IO ()
753753
go hscolourProg = do
754+
warn verbosity $
755+
"the 'cabal hscolour' command is deprecated in favour of 'cabal " ++
756+
"haddock --hyperlink-source' and will be removed in the next major " ++
757+
"release."
758+
754759
setupMessage verbosity "Running hscolour for" (packageId pkg_descr)
755760
createDirectoryIfMissingVerbose verbosity True $
756761
hscolourPref haddockTarget distPref pkg_descr

Cabal/Distribution/Simple/Setup.hs

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1221,7 +1221,8 @@ hscolourCommand = CommandUI
12211221
, commandSynopsis =
12221222
"Generate HsColour colourised code, in HTML format."
12231223
, commandDescription = Just (\_ -> "Requires the hscolour program.\n")
1224-
, commandNotes = Nothing
1224+
, commandNotes = Just $ \_ ->
1225+
"Deprecated in favour of 'cabal haddock --hyperlink-source'."
12251226
, commandUsage = \pname ->
12261227
"Usage: " ++ pname ++ " hscolour [FLAGS]\n"
12271228
, commandDefaultFlags = defaultHscolourFlags
@@ -1513,7 +1514,7 @@ haddockOptions showOrParseArgs =
15131514
haddockCss (\v flags -> flags { haddockCss = v })
15141515
(reqArgFlag "PATH")
15151516

1516-
,option "" ["hyperlink-source","hyperlink-sources"]
1517+
,option "" ["hyperlink-source","hyperlink-sources","hyperlinked-source"]
15171518
"Hyperlink the documentation to the source code"
15181519
haddockLinkedSource (\v flags -> flags { haddockLinkedSource = v })
15191520
trueArg

0 commit comments

Comments
 (0)