{- | Module : $Header$ Description : Some message constants. Author : Nils 'bash0r' Jonsson Copyright : (c) 2015 Nils 'bash0r' Jonsson License : MIT Maintainer : aka.bash0r@gmail.com Stability : unstable Portability : non-portable (Portability is untested.) This module defines some messages -} module Headergen.Messages ( corruptedMessage , noResourcesCreatedMessage , noHeadergenDefMessage , exitMessage , moduleMessage , descriptionMessage , authorMessage , copyRightMessage , licenseMessage , maintainerMessage , stabilityMessage , portabilityMessage , template ) where import Headergen.Configuration import Headergen.Utility -- | A message stating corruption of .headergen.def. corruptedMessage :: String corruptedMessage = "The .headergen.def is corrupted.\n" ++ exitMessage -- | A message stating that no resources have been created. noResourcesCreatedMessage :: String noResourcesCreatedMessage = "No resources have been created.\n" ++ exitMessage -- | A message stating that no .headergen.def was found. noHeadergenDefMessage :: String noHeadergenDefMessage = "There is no .headergen.def in any parent directory.\n" ++ exitMessage -- | A message stating exit of application. exitMessage :: String exitMessage = "Exitting now.\n" -- | A message stating that input for module definition is required. moduleMessage :: String moduleMessage = "Module [$Header$]: " -- | A message stating that input for description definition is required. descriptionMessage :: String descriptionMessage = "Description [ ]: " -- | A message stating that input for author definition is required. authorMessage :: String authorMessage = "Author [ ]: " -- | A message stating that input for copyright definition is required. copyRightMessage :: String -> String copyRightMessage crt = "Copyright [" ++ trimText 8 crt ++ "]: " -- | A message stating that input for license definition is required. licenseMessage :: String licenseMessage = "License [MIT ]: " -- | A message stating that input for maintainer definition is required. maintainerMessage :: String maintainerMessage = "Maintainer [ ]: " -- | A message stating that input for stability definition is required. stabilityMessage :: String stabilityMessage = "Stability [unstable]: " -- | A message stating that input for portability definition is required. portabilityMessage :: String portabilityMessage = "Portability [non-port]: " -- | A template function creating a new header from a configuration. template :: Configuration -> String template (Configuration mod des aut cop lic mai sta por) = "{- |\n" ++ "Module : " ++ mod ++ "\n" ++ "Description : " ++ des ++ "\n" ++ "Author : " ++ aut ++ "\n" ++ "Copyright : " ++ cop ++ "\n" ++ "License : " ++ lic ++ "\n" ++ "\n" ++ "Maintainer : " ++ mai ++ "\n" ++ "Stability : " ++ sta ++ "\n" ++ "Portability : " ++ por ++ "\n" ++ "\n" ++ "TODO: module description\n" ++ "-}\n\n"