add: fix breakage when creating file, ignore backslash in names line

This commit is contained in:
Simon Michael 2019-01-26 20:57:44 -08:00
parent 157ec857d4
commit 6566ef5fa2

View File

@ -279,7 +279,7 @@ parseHelpTemplate t =
[] -> Nothing [] -> Nothing
(l:ls) -> Just (names, shorthelp, longhelplines) (l:ls) -> Just (names, shorthelp, longhelplines)
where where
names = words $ map (\c -> if c==',' then ' ' else c) l names = words $ map (\c -> if c `elem` [',','\\'] then ' ' else c) l
(shorthelpls, longhelpls) = break (== "_FLAGS_") ls (shorthelpls, longhelpls) = break (== "_FLAGS_") ls
shorthelp = unlines $ reverse $ dropWhile null $ reverse shorthelpls shorthelp = unlines $ reverse $ dropWhile null $ reverse shorthelpls
longhelplines = dropWhile null $ drop 1 longhelpls longhelplines = dropWhile null $ drop 1 longhelpls