<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd"> <!--Rendered using the Haskell Html Library v0.2--> <HTML ><HEAD ><META HTTP-EQUIV="Content-Type" CONTENT="text/html; charset=UTF-8" ><TITLE >Distribution.Simple.Program.Run</TITLE ><LINK HREF="haddock.css" REL="stylesheet" TYPE="text/css" ><SCRIPT SRC="haddock-util.js" TYPE="text/javascript" ></SCRIPT ><SCRIPT TYPE="text/javascript" >window.onload = function () {setSynopsis("mini_Distribution-Simple-Program-Run.html")};</SCRIPT ></HEAD ><BODY ><TABLE CLASS="vanilla" CELLSPACING="0" CELLPADDING="0" ><TR ><TD CLASS="topbar" ><TABLE CLASS="vanilla" CELLSPACING="0" CELLPADDING="0" ><TR ><TD ><IMG SRC="haskell_icon.gif" WIDTH="16" HEIGHT="16" ALT=" " ></TD ><TD CLASS="title" >Cabal-1.8.0.6: A framework for packaging Haskell software</TD ><TD CLASS="topbut" ><A HREF="index.html" >Contents</A ></TD ><TD CLASS="topbut" ><A HREF="doc-index.html" >Index</A ></TD ></TR ></TABLE ></TD ></TR ><TR ><TD CLASS="modulebar" ><TABLE CLASS="vanilla" CELLSPACING="0" CELLPADDING="0" ><TR ><TD ><FONT SIZE="6" >Distribution.Simple.Program.Run</FONT ></TD ><TD ALIGN="right" ><TABLE CLASS="narrow" CELLSPACING="0" CELLPADDING="0" ><TR ><TD CLASS="infohead" >Portability</TD ><TD CLASS="infoval" >portable</TD ></TR ><TR ><TD CLASS="infohead" >Maintainer</TD ><TD CLASS="infoval" >cabal-devel@haskell.org</TD ></TR ></TABLE ></TD ></TR ></TABLE ></TD ></TR ><TR ><TD CLASS="s15" ></TD ></TR ><TR ><TD CLASS="section1" >Description</TD ></TR ><TR ><TD CLASS="doc" >This module provides a data type for program invocations and functions to run them. </TD ></TR ><TR ><TD CLASS="s15" ></TD ></TR ><TR ><TD CLASS="section1" >Synopsis</TD ></TR ><TR ><TD CLASS="s15" ></TD ></TR ><TR ><TD CLASS="body" ><TABLE CLASS="vanilla" CELLSPACING="0" CELLPADDING="0" ><TR ><TD CLASS="decl" ><SPAN CLASS="keyword" >data</SPAN > <A HREF="#t%3AProgramInvocation" >ProgramInvocation</A > = <A HREF="#v%3AProgramInvocation" >ProgramInvocation</A > {<TABLE CLASS="vanilla" CELLSPACING="0" CELLPADDING="0" ><TR ><TD CLASS="recfield" ><A HREF="#v%3AprogInvokePath" >progInvokePath</A > :: <A HREF="../base-4.2.0.2/System-IO.html#t%3AFilePath" >FilePath</A ></TD ></TR ><TR ><TD CLASS="recfield" ><A HREF="#v%3AprogInvokeArgs" >progInvokeArgs</A > :: [<A HREF="../base-4.2.0.2/Data-Char.html#t%3AString" >String</A >]</TD ></TR ><TR ><TD CLASS="recfield" ><A HREF="#v%3AprogInvokeEnv" >progInvokeEnv</A > :: [(<A HREF="../base-4.2.0.2/Data-Char.html#t%3AString" >String</A >, <A HREF="../base-4.2.0.2/Data-Char.html#t%3AString" >String</A >)]</TD ></TR ><TR ><TD CLASS="recfield" ><A HREF="#v%3AprogInvokeCwd" >progInvokeCwd</A > :: <A HREF="../base-4.2.0.2/Data-Maybe.html#t%3AMaybe" >Maybe</A > <A HREF="../base-4.2.0.2/System-IO.html#t%3AFilePath" >FilePath</A ></TD ></TR ><TR ><TD CLASS="recfield" ><A HREF="#v%3AprogInvokeInput" >progInvokeInput</A > :: <A HREF="../base-4.2.0.2/Data-Maybe.html#t%3AMaybe" >Maybe</A > <A HREF="../base-4.2.0.2/Data-Char.html#t%3AString" >String</A ></TD ></TR ><TR ><TD CLASS="recfield" ><A HREF="#v%3AprogInvokeInputEncoding" >progInvokeInputEncoding</A > :: <A HREF="Distribution-Simple-Program-Run.html#t%3AIOEncoding" >IOEncoding</A ></TD ></TR ><TR ><TD CLASS="recfield" ><A HREF="#v%3AprogInvokeOutputEncoding" >progInvokeOutputEncoding</A > :: <A HREF="Distribution-Simple-Program-Run.html#t%3AIOEncoding" >IOEncoding</A ></TD ></TR ></TABLE >}</TD ></TR ><TR ><TD CLASS="s8" ></TD ></TR ><TR ><TD CLASS="decl" ><TABLE CLASS="vanilla" CELLSPACING="0" CELLPADDING="0" ><TR ><TD CLASS="decl" ><SPAN CLASS="keyword" >data</SPAN > <A HREF="#t%3AIOEncoding" >IOEncoding</A > </TD ></TR ><TR ><TD CLASS="body" ><TABLE CLASS="vanilla" CELLSPACING="0" CELLPADDING="0" ><TR ><TD CLASS="decl" >= <A HREF="#v%3AIOEncodingText" >IOEncodingText</A ></TD ></TR ><TR ><TD CLASS="decl" >| <A HREF="#v%3AIOEncodingUTF8" >IOEncodingUTF8</A ></TD ></TR ></TABLE ></TD ></TR ></TABLE ></TD ></TR ><TR ><TD CLASS="s8" ></TD ></TR ><TR ><TD CLASS="decl" ><A HREF="#v%3AemptyProgramInvocation" >emptyProgramInvocation</A > :: <A HREF="Distribution-Simple-Program-Run.html#t%3AProgramInvocation" >ProgramInvocation</A ></TD ></TR ><TR ><TD CLASS="s8" ></TD ></TR ><TR ><TD CLASS="decl" ><A HREF="#v%3AsimpleProgramInvocation" >simpleProgramInvocation</A > :: <A HREF="../base-4.2.0.2/System-IO.html#t%3AFilePath" >FilePath</A > -> [<A HREF="../base-4.2.0.2/Data-Char.html#t%3AString" >String</A >] -> <A HREF="Distribution-Simple-Program-Run.html#t%3AProgramInvocation" >ProgramInvocation</A ></TD ></TR ><TR ><TD CLASS="s8" ></TD ></TR ><TR ><TD CLASS="decl" ><A HREF="#v%3AprogramInvocation" >programInvocation</A > :: <A HREF="Distribution-Simple-Program-Types.html#t%3AConfiguredProgram" >ConfiguredProgram</A > -> [<A HREF="../base-4.2.0.2/Data-Char.html#t%3AString" >String</A >] -> <A HREF="Distribution-Simple-Program-Run.html#t%3AProgramInvocation" >ProgramInvocation</A ></TD ></TR ><TR ><TD CLASS="s8" ></TD ></TR ><TR ><TD CLASS="decl" ><A HREF="#v%3AmultiStageProgramInvocation" >multiStageProgramInvocation</A > :: <A HREF="Distribution-Simple-Program-Run.html#t%3AProgramInvocation" >ProgramInvocation</A > -> (<A HREF="Distribution-Simple-Program-Run.html#t%3AProgramInvocation" >ProgramInvocation</A >, <A HREF="Distribution-Simple-Program-Run.html#t%3AProgramInvocation" >ProgramInvocation</A >, <A HREF="Distribution-Simple-Program-Run.html#t%3AProgramInvocation" >ProgramInvocation</A >) -> [<A HREF="../base-4.2.0.2/Data-Char.html#t%3AString" >String</A >] -> [<A HREF="Distribution-Simple-Program-Run.html#t%3AProgramInvocation" >ProgramInvocation</A >]</TD ></TR ><TR ><TD CLASS="s8" ></TD ></TR ><TR ><TD CLASS="decl" ><A HREF="#v%3ArunProgramInvocation" >runProgramInvocation</A > :: <A HREF="Distribution-Verbosity.html#t%3AVerbosity" >Verbosity</A > -> <A HREF="Distribution-Simple-Program-Run.html#t%3AProgramInvocation" >ProgramInvocation</A > -> <A HREF="../base-4.2.0.2/System-IO.html#t%3AIO" >IO</A > <A HREF="../ghc-prim-0.2.0.0/GHC-Unit.html#t%3A%28%29" >()</A ></TD ></TR ><TR ><TD CLASS="s8" ></TD ></TR ><TR ><TD CLASS="decl" ><A HREF="#v%3AgetProgramInvocationOutput" >getProgramInvocationOutput</A > :: <A HREF="Distribution-Verbosity.html#t%3AVerbosity" >Verbosity</A > -> <A HREF="Distribution-Simple-Program-Run.html#t%3AProgramInvocation" >ProgramInvocation</A > -> <A HREF="../base-4.2.0.2/System-IO.html#t%3AIO" >IO</A > <A HREF="../base-4.2.0.2/Data-Char.html#t%3AString" >String</A ></TD ></TR ></TABLE ></TD ></TR ><TR ><TD CLASS="s15" ></TD ></TR ><TR ><TD CLASS="section1" >Documentation</TD ></TR ><TR ><TD CLASS="s15" ></TD ></TR ><TR ><TD CLASS="decl" ><SPAN CLASS="keyword" >data</SPAN > <A NAME="t:ProgramInvocation" ><A NAME="t%3AProgramInvocation" ></A ></A ><B >ProgramInvocation</B > </TD ></TR ><TR ><TD CLASS="body" ><TABLE CLASS="vanilla" CELLSPACING="0" CELLPADDING="0" ><TR ><TD CLASS="ndoc" ><P >Represents a specific invocation of a specific program. </P ><P >This is used as an intermediate type between deciding how to call a program and actually doing it. This provides the opportunity to the caller to adjust how the program will be called. These invocations can either be run directly or turned into shell or batch scripts. </P ></TD ></TR ><TR ><TD CLASS="section4" >Constructors</TD ></TR ><TR ><TD CLASS="body" ><TABLE CLASS="vanilla" CELLSPACING="5" CELLPADDING="0" ><TR ><TD CLASS="arg" ><A NAME="v:ProgramInvocation" ><A NAME="v%3AProgramInvocation" ></A ></A ><B >ProgramInvocation</B ></TD ><TD CLASS="rdoc" ></TD ></TR ><TR ><TD CLASS="body" COLSPAN="2" ><TABLE CLASS="vanilla" CELLSPACING="1" CELLPADDING="0" ><TR ><TD CLASS="arg" ><A NAME="v:progInvokePath" ><A NAME="v%3AprogInvokePath" ></A ></A ><B >progInvokePath</B > :: <A HREF="../base-4.2.0.2/System-IO.html#t%3AFilePath" >FilePath</A ></TD ><TD CLASS="rdoc" ></TD ></TR ><TR ><TD CLASS="arg" ><A NAME="v:progInvokeArgs" ><A NAME="v%3AprogInvokeArgs" ></A ></A ><B >progInvokeArgs</B > :: [<A HREF="../base-4.2.0.2/Data-Char.html#t%3AString" >String</A >]</TD ><TD CLASS="rdoc" ></TD ></TR ><TR ><TD CLASS="arg" ><A NAME="v:progInvokeEnv" ><A NAME="v%3AprogInvokeEnv" ></A ></A ><B >progInvokeEnv</B > :: [(<A HREF="../base-4.2.0.2/Data-Char.html#t%3AString" >String</A >, <A HREF="../base-4.2.0.2/Data-Char.html#t%3AString" >String</A >)]</TD ><TD CLASS="rdoc" ></TD ></TR ><TR ><TD CLASS="arg" ><A NAME="v:progInvokeCwd" ><A NAME="v%3AprogInvokeCwd" ></A ></A ><B >progInvokeCwd</B > :: <A HREF="../base-4.2.0.2/Data-Maybe.html#t%3AMaybe" >Maybe</A > <A HREF="../base-4.2.0.2/System-IO.html#t%3AFilePath" >FilePath</A ></TD ><TD CLASS="rdoc" ></TD ></TR ><TR ><TD CLASS="arg" ><A NAME="v:progInvokeInput" ><A NAME="v%3AprogInvokeInput" ></A ></A ><B >progInvokeInput</B > :: <A HREF="../base-4.2.0.2/Data-Maybe.html#t%3AMaybe" >Maybe</A > <A HREF="../base-4.2.0.2/Data-Char.html#t%3AString" >String</A ></TD ><TD CLASS="rdoc" ></TD ></TR ><TR ><TD CLASS="arg" ><A NAME="v:progInvokeInputEncoding" ><A NAME="v%3AprogInvokeInputEncoding" ></A ></A ><B >progInvokeInputEncoding</B > :: <A HREF="Distribution-Simple-Program-Run.html#t%3AIOEncoding" >IOEncoding</A ></TD ><TD CLASS="rdoc" ></TD ></TR ><TR ><TD CLASS="arg" ><A NAME="v:progInvokeOutputEncoding" ><A NAME="v%3AprogInvokeOutputEncoding" ></A ></A ><B >progInvokeOutputEncoding</B > :: <A HREF="Distribution-Simple-Program-Run.html#t%3AIOEncoding" >IOEncoding</A ></TD ><TD CLASS="rdoc" ></TD ></TR ></TABLE ></TD ></TR ></TABLE ></TD ></TR ></TABLE ></TD ></TR ><TR ><TD CLASS="s15" ></TD ></TR ><TR ><TD CLASS="decl" ><SPAN CLASS="keyword" >data</SPAN > <A NAME="t:IOEncoding" ><A NAME="t%3AIOEncoding" ></A ></A ><B >IOEncoding</B > </TD ></TR ><TR ><TD CLASS="body" ><TABLE CLASS="vanilla" CELLSPACING="0" CELLPADDING="0" ><TR ><TD CLASS="section4" >Constructors</TD ></TR ><TR ><TD CLASS="body" ><TABLE CLASS="vanilla" CELLSPACING="1" CELLPADDING="0" ><TR ><TD CLASS="arg" ><A NAME="v:IOEncodingText" ><A NAME="v%3AIOEncodingText" ></A ></A ><B >IOEncodingText</B ></TD ><TD CLASS="rdoc" ></TD ></TR ><TR ><TD CLASS="arg" ><A NAME="v:IOEncodingUTF8" ><A NAME="v%3AIOEncodingUTF8" ></A ></A ><B >IOEncodingUTF8</B ></TD ><TD CLASS="rdoc" ></TD ></TR ></TABLE ></TD ></TR ></TABLE ></TD ></TR ><TR ><TD CLASS="s15" ></TD ></TR ><TR ><TD CLASS="decl" ><A NAME="v:emptyProgramInvocation" ><A NAME="v%3AemptyProgramInvocation" ></A ></A ><B >emptyProgramInvocation</B > :: <A HREF="Distribution-Simple-Program-Run.html#t%3AProgramInvocation" >ProgramInvocation</A ></TD ></TR ><TR ><TD CLASS="s15" ></TD ></TR ><TR ><TD CLASS="decl" ><A NAME="v:simpleProgramInvocation" ><A NAME="v%3AsimpleProgramInvocation" ></A ></A ><B >simpleProgramInvocation</B > :: <A HREF="../base-4.2.0.2/System-IO.html#t%3AFilePath" >FilePath</A > -> [<A HREF="../base-4.2.0.2/Data-Char.html#t%3AString" >String</A >] -> <A HREF="Distribution-Simple-Program-Run.html#t%3AProgramInvocation" >ProgramInvocation</A ></TD ></TR ><TR ><TD CLASS="s15" ></TD ></TR ><TR ><TD CLASS="decl" ><A NAME="v:programInvocation" ><A NAME="v%3AprogramInvocation" ></A ></A ><B >programInvocation</B > :: <A HREF="Distribution-Simple-Program-Types.html#t%3AConfiguredProgram" >ConfiguredProgram</A > -> [<A HREF="../base-4.2.0.2/Data-Char.html#t%3AString" >String</A >] -> <A HREF="Distribution-Simple-Program-Run.html#t%3AProgramInvocation" >ProgramInvocation</A ></TD ></TR ><TR ><TD CLASS="s15" ></TD ></TR ><TR ><TD CLASS="decl" ><A NAME="v:multiStageProgramInvocation" ><A NAME="v%3AmultiStageProgramInvocation" ></A ></A ><B >multiStageProgramInvocation</B > :: <A HREF="Distribution-Simple-Program-Run.html#t%3AProgramInvocation" >ProgramInvocation</A > -> (<A HREF="Distribution-Simple-Program-Run.html#t%3AProgramInvocation" >ProgramInvocation</A >, <A HREF="Distribution-Simple-Program-Run.html#t%3AProgramInvocation" >ProgramInvocation</A >, <A HREF="Distribution-Simple-Program-Run.html#t%3AProgramInvocation" >ProgramInvocation</A >) -> [<A HREF="../base-4.2.0.2/Data-Char.html#t%3AString" >String</A >] -> [<A HREF="Distribution-Simple-Program-Run.html#t%3AProgramInvocation" >ProgramInvocation</A >]</TD ></TR ><TR ><TD CLASS="doc" ><P >Like the unix xargs program. Useful for when we've got very long command lines that might overflow an OS limit on command line length and so you need to invoke a command multiple times to get all the args in. </P ><P >It takes four template invocations corresponding to the simple, initial, middle and last invocations. If the number of args given is small enough that we can get away with just a single invocation then the simple one is used: </P ><PRE > $ simple args </PRE ><P >If the number of args given means that we need to use multiple invocations then the templates for the initial, middle and last invocations are used: </P ><PRE > $ initial args_0 $ middle args_1 $ middle args_2 ... $ final args_n </PRE ></TD ></TR ><TR ><TD CLASS="s15" ></TD ></TR ><TR ><TD CLASS="decl" ><A NAME="v:runProgramInvocation" ><A NAME="v%3ArunProgramInvocation" ></A ></A ><B >runProgramInvocation</B > :: <A HREF="Distribution-Verbosity.html#t%3AVerbosity" >Verbosity</A > -> <A HREF="Distribution-Simple-Program-Run.html#t%3AProgramInvocation" >ProgramInvocation</A > -> <A HREF="../base-4.2.0.2/System-IO.html#t%3AIO" >IO</A > <A HREF="../ghc-prim-0.2.0.0/GHC-Unit.html#t%3A%28%29" >()</A ></TD ></TR ><TR ><TD CLASS="s15" ></TD ></TR ><TR ><TD CLASS="decl" ><A NAME="v:getProgramInvocationOutput" ><A NAME="v%3AgetProgramInvocationOutput" ></A ></A ><B >getProgramInvocationOutput</B > :: <A HREF="Distribution-Verbosity.html#t%3AVerbosity" >Verbosity</A > -> <A HREF="Distribution-Simple-Program-Run.html#t%3AProgramInvocation" >ProgramInvocation</A > -> <A HREF="../base-4.2.0.2/System-IO.html#t%3AIO" >IO</A > <A HREF="../base-4.2.0.2/Data-Char.html#t%3AString" >String</A ></TD ></TR ><TR ><TD CLASS="s15" ></TD ></TR ><TR ><TD CLASS="botbar" >Produced by <A HREF="http://www.haskell.org/haddock/" >Haddock</A > version 2.6.1</TD ></TR ></TABLE ></BODY ></HTML >