Skip to content

Commit 2c280d5

Browse files
authored
Merge pull request #489 from BinderDavid/add-cabal-to-list
Prepare the error message index for cabal
2 parents cc1f169 + 161d8e0 commit 2c280d5

File tree

3 files changed

+7
-2
lines changed

3 files changed

+7
-2
lines changed

README.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,7 @@ Today, the Haskell Message Index supports three tools. Any user-facing Haskell-r
1414
| GHC | 9.6.1 | `GHC-` |
1515
| Stack | 2.9.3 | `S-` |
1616
| GHCup | 0.1.19.0 | `GHCup-` |
17+
| Cabal | 3.12 | `Cabal-` |
1718

1819
## Contributing to the Message Index
1920

message-index/create-message-template.hs

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -27,14 +27,15 @@ normalize = fmap toLower . strip
2727

2828
-- Querying for the tool: GHC / GHCup / Stack
2929

30-
data Tool = GHC | GHCup | Stack deriving (Show)
30+
data Tool = GHC | GHCup | Stack | Cabal deriving (Show)
3131

3232
readTool :: IO Tool
3333
readTool = do
3434
putStrLn "· Which tool's error code do you want to document?"
3535
putStrLn " 1) GHC"
3636
putStrLn " 2) GHCup"
3737
putStrLn " 3) Stack"
38+
putStrLn " 4) Cabal"
3839
putStr "Input (Default = GHC): "
3940
ln <- getLine
4041
case normalize ln of
@@ -44,6 +45,8 @@ readTool = do
4445
"ghcup" -> pure GHCup
4546
"3" -> pure Stack
4647
"stack" -> pure Stack
48+
"4" -> pure Cabal
49+
"cabal" -> pure Cabal
4750
"" -> pure GHC
4851
_ -> do
4952
putStrLn "Didn't understand input. Please type a tool name or a number."
@@ -202,7 +205,7 @@ createFiles tmpl = do
202205
putStrLn "· Creating scaffolding..."
203206

204207
-- Create the new directory "messages/XXX-NNNNNN/" and "messages/XXX-NNNNNN/index.md"
205-
let message_dir = "messages" </> case tool tmpl of { GHC -> "GHC-"; GHCup -> "GHCup-"; Stack -> "S-" } ++ code tmpl
208+
let message_dir = "messages" </> case tool tmpl of { GHC -> "GHC-"; GHCup -> "GHCup-"; Stack -> "S-"; Cabal -> "Cabal-" } ++ code tmpl
206209
createDirectoryIfMissing True message_dir
207210
let index_filename = message_dir </> "index.md"
208211
let toplvl_index =

test/create-message-template/golden1.expected.txt

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,7 @@ You can leave any of the text fields blank and fill them in by hand later.
55
1) GHC
66
2) GHCup
77
3) Stack
8+
4) Cabal
89
Input (Default = GHC):
910
· What is the numeric code that you want to document?
1011
For example, enter "01234" if you want to document GHC-01234.

0 commit comments

Comments
 (0)