Merge pull request #72 from mtlstats/allow-dashes

allow dashes in database backup files
This commit is contained in:
Jonathan Lamothe 2020-02-04 00:25:09 -05:00 committed by GitHub
commit bd5bc21661
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -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