<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
  <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
  <meta http-equiv="Content-Style-Type" content="text/css" />
  <meta name="generator" content="pandoc" />
  <title>eddie(1)</title>
  <style type="text/css">code{white-space: pre;}</style>
</head>
<body>
<div id="header">
<h1 class="title">eddie(1)</h1>
</div>
<h1 id="name">NAME</h1>
<p>eddie - run Haskell filters from the command line</p>
<h1 id="synopsys">SYNOPSYS</h1>
<p><strong>eddie</strong> [ <em>options</em> ] [ <em>EXPRESSION</em> ] <em>file</em> ...</p>
<h1 id="description">DESCRIPTION</h1>
<p><strong>eddie</strong> evalutes the provided <em>expression</em> on either the contents of <em>the file</em> arguments concatenated together, or standard input if no <em>file</em> arguments are present.</p>
<p>The <code>--lines</code>, <code>--files</code> and <code>--names</code> options can be used to cause <em>expression</em> to be used to process each line, each file, or tuple of <code>(name, content)</code> for each file, respectively. The <code>--lists</code> option can be used with <code>--lines</code>, <code>--files</code> and <code>--names</code> to cause the <em>files</em> to be processed as a list instead of one element at a time.</p>
<p>The <code>ClassyPrelude</code> module is used instead of the default <code>Prelude</code> when building expressions. The default type for input and output is <code>Text</code>, but input or both can be changed to <code>ByteString</code> with the <code>--binary</code> and <code>--text</code> options.</p>
<p>Other modules may be added with the <code>--Module</code> and <code>--module</code> options.</p>
<h1 id="options">OPTIONS</h1>
<dl>
<dt><strong>--expression</strong></dt>
<dd><p>The <strong>--expression</strong> <em>EXPRESSION</em> (short form <strong>-e</strong> <em>EXPRESSION</em> ) option concatenates it's value to the Haskell expression being evaluated with a newline separator. Multiple occurrences can be used to build up a multi-line expression.</p>
<p>If no <strong>-e</strong> <em>EXPRESSION</em> option is present, the first non-flag argument will be used for the Haskell expression.</p>
</dd>
<dt><strong>--lines</strong></dt>
<dd><p>The <strong>--lines</strong> (short form <strong>-l</strong>) option causes <strong>eddie</strong> to process the input one line at a time. The <em>EXPRESSION</em> will be run on each line and the results concatenated together (using unlines).</p>
<p>The command</p>
<pre><code>eddie -l *EXPRESSION file* ...</code></pre>
<p>is equivalent to the command</p>
<pre><code>eddie &quot;unlines . map *EXPRESSION*  . lines&quot; *file* ...</code></pre>
<p>Note that the <strong>--lines</strong>, <strong>--files</strong> and <strong>--names</strong> options cannot be used together.</p>
</dd>
<dt><strong>--files</strong></dt>
<dd><p>The <strong>--files</strong> (short form <strong>-f</strong>) causes each file to be processed individually.</p>
<p>Note that the <strong>--lines</strong>, <strong>--files</strong> and <strong>--names</strong> options cannot be used together.</p>
</dd>
<dt><strong>--names</strong></dt>
<dd><p>The <strong>--names</strong> (short form <strong>-n</strong>) causes each file to be processed individually, as a tuple of <code>(name, content)</code>.</p>
<p>Note that the <strong>--lines</strong>, <strong>--files</strong> and <strong>--names</strong> options cannot be used together.</p>
</dd>
<dt><strong>--list</strong></dt>
<dd><p>The <strong>--list</strong> (short form <strong>-L</strong>) option causes <strong>eddie</strong> to pass the expression a list of lines or files. This requires one of the <strong>--list</strong>, <strong>--files</strong> or <strong>--names</strong> options be used.</p>
<p>The command</p>
<pre><code>eddie -l -L *EXPRESSION file* ...</code></pre>
<p>is equivalent to the command</p>
<pre><code>eddie *EXPRESSION* . lines&quot; *file* ...</code></pre>
</dd>
<dt><strong>--binary</strong></dt>
<dd>The <strong>--binary</strong> (short form <strong>-b</strong>) option changes the data from <code>Text</code> to <code>ByteString</code>. This disable all processing of the input and output.
</dd>
<dt><strong>--text</strong></dt>
<dd><p>The <strong>--text</strong> (short form <strong>-t</strong>) option switches the output from <code>ByteString</code> back to <code>Text</code> if the <strong>--binary</strong> option was used.</p>
<p>Using <strong>--text</strong> without <strong>--binary</strong> is an error.</p>
</dd>
<dt><strong>--input-encoding</strong></dt>
<dd><p>The <strong>--input-encoding</strong> <em>ENCODING</em> (no short form) option sets the encoding of the input file(s) to <em>ENCODING</em>.</p>
<p>It is an error to use <strong>--input-encoding</strong> with <strong>--binary</strong>.</p>
</dd>
<dt><strong>--output-encoding</strong></dt>
<dd><p>The <strong>--output-encoding</strong> <em>ENCODING</em> (no short form) option sets the encoding of the output file to <em>ENCODING</em>.</p>
<p>It is an error to use <strong>--output-encoding</strong> with <strong>--binary</strong> unless <strong>--text</strong> is also specified.</p>
</dd>
<dt><strong>--encoding</strong></dt>
<dd><p>The <strong>--encoding</strong> <em>ENCODING</em> (no short form) option sets the encoding of all text files to <em>ENCODING</em>, whether for input or output.</p>
<p>It is an error to use <strong>--encoding</strong> with <strong>--binary</strong> unless <strong>--text</strong> is also specified.</p>
</dd>
<dt><strong>--module</strong></dt>
<dd>The <strong>--module</strong> <em>NAME</em> (short form <strong>-m</strong> <em>NAME</em>) option is used to import module <em>NAME</em> into Haskell before evaluating the expression.
</dd>
<dt><strong>--Module</strong></dt>
<dd>The <strong>--Module</strong> <em>NAME</em>,<em>AS</em> (short form <strong>-M</strong> <em>NAME</em>,<em>AS</em>) option imports the <em>NAME</em> module using a qualified import with an as clause, with <em>AS</em> being the value for the as clause.
</dd>
</dl>
<h1 id="diagnostics">DIAGNOSTICS</h1>
<p>If the command runs with no problems, eddie will exit with a status of 0. If there are problems with the options, such that the expression is never evaluated, then eddie will exit with a status of 1. If Haskell returns an error - probably a compilation problem - then eddie will exit with the status of 2.</p>
<h1 id="see-also">SEE ALSO</h1>
<p>The wiki at <a href="https://chiselapp.com/user/mwm/repository/eddie/wcontent" class="uri">https://chiselapp.com/user/mwm/repository/eddie/wcontent</a> for examples.</p>
<h1 id="bugs">BUGS</h1>
<p>See the issues list at <a href="https://chiselapp.com/user/mwm/repository/eddie/rptview?rn=1" class="uri">https://chiselapp.com/user/mwm/repository/eddie/rptview?rn=1</a>.</p>
<h1 id="author">AUTHOR</h1>
<p>Mike Meyer <script type="text/javascript">
<!--
h='&#x6d;&#x69;&#114;&#x65;&#100;&#46;&#x6f;&#114;&#x67;';a='&#64;';n='&#x6d;&#x77;&#x6d;';e=n+a+h;
document.write('<a h'+'ref'+'="ma'+'ilto'+':'+e+'" clas'+'s="em' + 'ail">'+e+'<\/'+'a'+'>');
// -->
</script><noscript>&#x6d;&#x77;&#x6d;&#32;&#x61;&#116;&#32;&#x6d;&#x69;&#114;&#x65;&#100;&#32;&#100;&#x6f;&#116;&#32;&#x6f;&#114;&#x67;</noscript></p>
</body>
</html>
