Skip to content
/ command Public

Conveniently run shell commands in Haskell (extracted from the Shake build system)

Notifications You must be signed in to change notification settings

nh2/command

Folders and files

NameName
Last commit message
Last commit date

Latest commit

3060a99 · Sep 2, 2014

History

6 Commits
Sep 2, 2014
Oct 27, 2013
Oct 28, 2013
Sep 2, 2014

Repository files navigation

command

This is a standalone version of the powerful and intuitive command line functions present in the Shake build system (so that they work in plain IO).

They are intended as an easy-to-remember, easy-to-use alternative to the System.Process functions.

Examples

The function with most convenience is cmd.

cmd "gcc -c myfile.c"     -- compile a file, throwing an exception on failure

cmd understands what you want to do using type inference.

Stdout out <- cmd "gcc -MM myfile.c"                   -- run a command, recording the output
Exit c <- cmd "gcc -c" [myfile]                        -- run a command, recording the exit code
(Exit c, Stderr err) <- cmd "gcc -c myfile.c"          -- run a command, recording the exit code and error output
cmd (Cwd "generated") "gcc -c" [myfile] :: Action ()   -- run a command in a directory

Credit

All credit goes to the Shake author!

I hope he'll take it over as a standalone project.

About

Conveniently run shell commands in Haskell (extracted from the Shake build system)

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published