Merge pull request #72 from mtlstats/allow-dashes
allow dashes in database backup files
This commit is contained in:
commit
bd5bc21661
|
@ -172,11 +172,12 @@ numPromptWithFallback pStr fallback act = Prompt
|
||||||
-- to
|
-- to
|
||||||
newSeasonPrompt :: Prompt
|
newSeasonPrompt :: Prompt
|
||||||
newSeasonPrompt = prompt
|
newSeasonPrompt = prompt
|
||||||
{ promptProcessChar = \ch str -> if isAlphaNum ch
|
{ promptProcessChar = \ch str -> if validChar ch
|
||||||
then str ++ [toUpper ch]
|
then str ++ [toUpper ch]
|
||||||
else str
|
else str
|
||||||
}
|
}
|
||||||
where
|
where
|
||||||
|
|
||||||
prompt = strPrompt "Filename to save database: " $ \fn ->
|
prompt = strPrompt "Filename to save database: " $ \fn ->
|
||||||
if null fn
|
if null fn
|
||||||
then modify backHome
|
then modify backHome
|
||||||
|
@ -184,6 +185,8 @@ newSeasonPrompt = prompt
|
||||||
saveDatabase $ fn ++ ".json"
|
saveDatabase $ fn ++ ".json"
|
||||||
modify $ progMode .~ NewSeason True
|
modify $ progMode .~ NewSeason True
|
||||||
|
|
||||||
|
validChar = (||) <$> isAlphaNum <*> (=='-')
|
||||||
|
|
||||||
-- | Builds a selection prompt
|
-- | Builds a selection prompt
|
||||||
selectPrompt :: SelectParams a -> Prompt
|
selectPrompt :: SelectParams a -> Prompt
|
||||||
selectPrompt params = Prompt
|
selectPrompt params = Prompt
|
||||||
|
|
Loading…
Reference in New Issue
Block a user