From 44c2e1a9ae7111790b74f885a956d2120903f4a5 Mon Sep 17 00:00:00 2001 From: toonn Date: Mon, 28 Feb 2022 11:47:10 +0100 Subject: [PATCH] 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. --- .../src/Distribution/Client/Init/Interactive/Command.hs | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/cabal-install/src/Distribution/Client/Init/Interactive/Command.hs b/cabal-install/src/Distribution/Client/Init/Interactive/Command.hs index 10c758cc213..6223a8c3cd3 100644 --- a/cabal-install/src/Distribution/Client/Init/Interactive/Command.hs +++ b/cabal-install/src/Distribution/Client/Init/Interactive/Command.hs @@ -328,7 +328,11 @@ licensePrompt flags = getLicense flags $ do case simpleParsec l of Nothing -> do - putStrLn "The license must be a valid SPDX expression." + putStrLn ( "The license must be a valid SPDX expression:" + ++ "\n - On the SPDX License List: https://spdx.org/licenses/" + ++ "\n - NONE, if you do not want to grant any license" + ++ "\n - LicenseRef-( alphanumeric | - | . )+" + ) licensePrompt flags Just l' -> return l' where