cmdtheline-0.2.3: Declarative command-line option parsing and documentation library.

Safe HaskellSafe-Inferred

System.Console.CmdTheLine.Util

Contents

Synopsis

File path validation

Existing path check

fileExists :: Term String -> Term StringSource

fileExists term checks that String in term is a path to an existing file. If it is not, exit with an explanatory message for the user.

dirExists :: Term String -> Term StringSource

dirExists term checks that String in term is a path to an existing directory. If it is not, exit with an explanatory message for the user.

pathExists :: Term String -> Term StringSource

pathExists term checks that String in term is a path to an existing file or directory. If it is not, exit with an explanatory message for the user.

Existing paths check

filesExist :: Term [String] -> Term [String]Source

filesExist term is as fileExists but for a term containing a list of file paths.

dirsExist :: Term [String] -> Term [String]Source

dirsExist term is as dirExists but for a term containing a list of directory paths.

pathsExist :: Term [String] -> Term [String]Source

pathsExist term is as pathExists but for a term containing a list of paths.

Valid path

validPath :: Term String -> Term StringSource

validPath term checks that String in term is a valid path under the current operating system. If it is not, exit with an explanatory message for the user.