shellwords-0.1.4.3: Parse strings into words, like a shell would
Safe HaskellSafe-Inferred
LanguageHaskell2010

ShellWords

Synopsis

Splitting shell words

parseText :: Text -> Either String [Text] Source #

Parse and return Text values

Quoting for shells

quote :: String -> String Source #

Escape special characters in a string, so that it will retain its literal meaning when used as a part of command in a Unix shell.

It tries to avoid introducing any unnecessary quotes or escape characters, but specifics regarding quoting style are left unspecified.

join :: [String] -> String Source #

Joins arguments into a single command line suitable for execution in a Unix shell.

Each argument is quoted using quote to preserve its literal meaning when parsed by Unix shell.

Note: This function is essentially an (infallible) inverse of parse.

Low-level parser