Skip to content

Commit 44c2e1a

Browse files
authored
Provide explanation for invalid license identifier (#6200)
After discussion in #hackage it seemed prudent to add some minimal explanation of what a valid SPDX identifier might look like in the error message.
1 parent c46eb51 commit 44c2e1a

File tree

1 file changed

+5
-1
lines changed
  • cabal-install/src/Distribution/Client/Init/Interactive

1 file changed

+5
-1
lines changed

cabal-install/src/Distribution/Client/Init/Interactive/Command.hs

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -328,7 +328,11 @@ licensePrompt flags = getLicense flags $ do
328328

329329
case simpleParsec l of
330330
Nothing -> do
331-
putStrLn "The license must be a valid SPDX expression."
331+
putStrLn ( "The license must be a valid SPDX expression:"
332+
++ "\n - On the SPDX License List: https://spdx.org/licenses/"
333+
++ "\n - NONE, if you do not want to grant any license"
334+
++ "\n - LicenseRef-( alphanumeric | - | . )+"
335+
)
332336
licensePrompt flags
333337
Just l' -> return l'
334338
where

0 commit comments

Comments
 (0)