diff --git a/README.md b/README.md index 21f8ca35..11297d33 100644 --- a/README.md +++ b/README.md @@ -14,6 +14,7 @@ Today, the Haskell Message Index supports three tools. Any user-facing Haskell-r | GHC | 9.6.1 | `GHC-` | | Stack | 2.9.3 | `S-` | | GHCup | 0.1.19.0 | `GHCup-` | +| Cabal | 3.12 | `Cabal-` | ## Contributing to the Message Index diff --git a/message-index/create-message-template.hs b/message-index/create-message-template.hs index 50ec3eb4..3b30097a 100644 --- a/message-index/create-message-template.hs +++ b/message-index/create-message-template.hs @@ -27,7 +27,7 @@ normalize = fmap toLower . strip -- Querying for the tool: GHC / GHCup / Stack -data Tool = GHC | GHCup | Stack deriving (Show) +data Tool = GHC | GHCup | Stack | Cabal deriving (Show) readTool :: IO Tool readTool = do @@ -35,6 +35,7 @@ readTool = do putStrLn " 1) GHC" putStrLn " 2) GHCup" putStrLn " 3) Stack" + putStrLn " 4) Cabal" putStr "Input (Default = GHC): " ln <- getLine case normalize ln of @@ -44,6 +45,8 @@ readTool = do "ghcup" -> pure GHCup "3" -> pure Stack "stack" -> pure Stack + "4" -> pure Cabal + "cabal" -> pure Cabal "" -> pure GHC _ -> do putStrLn "Didn't understand input. Please type a tool name or a number." @@ -202,7 +205,7 @@ createFiles tmpl = do putStrLn "· Creating scaffolding..." -- Create the new directory "messages/XXX-NNNNNN/" and "messages/XXX-NNNNNN/index.md" - let message_dir = "messages" case tool tmpl of { GHC -> "GHC-"; GHCup -> "GHCup-"; Stack -> "S-" } ++ code tmpl + let message_dir = "messages" case tool tmpl of { GHC -> "GHC-"; GHCup -> "GHCup-"; Stack -> "S-"; Cabal -> "Cabal-" } ++ code tmpl createDirectoryIfMissing True message_dir let index_filename = message_dir "index.md" let toplvl_index = diff --git a/test/create-message-template/golden1.expected.txt b/test/create-message-template/golden1.expected.txt index 34f97936..cd36627f 100644 --- a/test/create-message-template/golden1.expected.txt +++ b/test/create-message-template/golden1.expected.txt @@ -5,6 +5,7 @@ You can leave any of the text fields blank and fill them in by hand later. 1) GHC 2) GHCup 3) Stack + 4) Cabal Input (Default = GHC): · What is the numeric code that you want to document? For example, enter "01234" if you want to document GHC-01234.