diff --git a/src/Mtlstats/Prompt.hs b/src/Mtlstats/Prompt.hs index c7a6e49..8f48581 100644 --- a/src/Mtlstats/Prompt.hs +++ b/src/Mtlstats/Prompt.hs @@ -172,11 +172,12 @@ numPromptWithFallback pStr fallback act = Prompt -- to newSeasonPrompt :: Prompt newSeasonPrompt = prompt - { promptProcessChar = \ch str -> if isAlphaNum ch + { promptProcessChar = \ch str -> if validChar ch then str ++ [toUpper ch] else str } where + prompt = strPrompt "Filename to save database: " $ \fn -> if null fn then modify backHome @@ -184,6 +185,8 @@ newSeasonPrompt = prompt saveDatabase $ fn ++ ".json" modify $ progMode .~ NewSeason True + validChar = (||) <$> isAlphaNum <*> (=='-') + -- | Builds a selection prompt selectPrompt :: SelectParams a -> Prompt selectPrompt params = Prompt