[Haskell-cafe] Parsing command lines

Kalman Noel noel.kalman at googlemail.com
Sun May 31 05:04:11 EDT 2009

Patai Gergely schrieb:
> is there a function that can safely split a command line into a FilePath
> to the executable and its parameters? 

In the yi source code, in HConf.Utils, there's a function that does part
of what you want, but maybe incorrectly (because I wrote it, and it
traverses the string in a rather primtive way).

-- | Break up a string the way a shell breaks up a command into arguments.
-- Similar to 'words', but respects quotes and escaped spaces.  TODO: Verify
-- this function.

shellWords :: String -> [String]

More information about the Haskell-Cafe mailing list