Specifically, this library replaces System.Exit.ExitCode with an abstract data type.
Commando comes in two forms - A library and an executable.
Watch a directory, and when changes occur, run a command.
From the commandline the program is used like so:
> commando -c echo
This will watch the current directory, and when an event occurs, pass the serialized representation of the event as an argument to `echo`.
To use the library just
> import System.Commando
See the System.Commando module documentation for more details.
The Commando executable module is a good example of using Commando as a library.
This is a standalone version of the powerful and intuitive command line functions present in the Shake build system.
They are intended as an easy-to-remember, easy-to-use alternative to the System.Process functions.
All credit goes to the Shake author! I hope he'll take it over as a standalone project.
* Initial version, copied from Shake.
* Quasiquotation syntax for external interpreters
> >>> [sh_| echo hello world! |]
> hello world!
* Custom quasiquoters
> ghci = quoter $ callCommand "ghc" ["-ignore-dot-ghci",
Then you can use ghci in ghci!
> >>> [ghci| putStrLn "hello world!" |] :: IO ()
> hello world!
For more examples, see examples/CustomQQ.hs
* Haskell values embedding
See README.md for an example
the filename of an executable with a list of arguments. see proc for the precise interpretation of the FilePath field.
Runs a command using the shell.
Runs a command using the shell, and returns Handles that may be used to communicate with the process via its stdin, stdout, and stderr respectively. The Handles are initially in binary mode; if you need them to be in text mode then use hSetBinaryMode.
a command line to execute using the shell
Given a program p and arguments args, showCommandForUser p args returns a string suitable for pasting into sh (on POSIX OSs) or cmd.exe (on Windows).
This is a framework for creating commandline applications. It provides various features which give a polished feel to your application.
It is designed to encourage you to provide clear documentation and working examples. It implements default 'help' and 'man' commands for your application, which will layout help text and generate Unix-style man pages.
It provides special handling for applications of the form ''program command args'', the style of interaction common in revision control systems. It will dispatch to handler functions that you provide for each command, and also provide command-specific help to the user.