Permalink
Switch branches/tags
Find file
Fetching contributors…
Cannot retrieve contributors at this time
219 lines (170 sloc) 6.31 KB
<!DOCTYPE html>
<html>
<head>
<meta http-equiv='content-type' value='text/html;charset=utf8'>
<meta name='generator' value='Ronn/v0.5'>
<title>repl(1) -- sometimes you need a repl</title>
<style type='text/css'>
body {margin:0}
#man, #man code, #man pre, #man tt, #man kbd, #man samp {
font-family:consolas,monospace;
font-size:16px;
line-height:1.3;
color:#343331;
background:#fff; }
#man { max-width:89ex; text-align:justify; margin:0 25px 25px 25px }
#man h1, #man h2, #man h3 { color:#232221;clear:left }
#man h1 { font-size:28px; margin:15px 0 30px 0; text-align:center }
#man h2 { font-size:18px; margin-bottom:0; margin-top:10px; line-height:1.3; }
#man h3 { font-size:16px; margin:0 0 0 4ex; }
#man p, #man ul, #man ol, #man dl, #man pre { margin:0 0 18px 0; }
#man pre {
color:#333231;
background:#edeceb;
padding:5px 7px;
margin:0px 0 20px 0;
border-left:2ex solid #ddd}
#man pre + h2, #man pre + h3 {
margin-top:22px;
}
#man h2 + pre, #man h3 + pre {
margin-top:5px;
}
#man > p, #man > ul, #man > ol, #man > dl, #man > pre { margin-left:8ex; }
#man dt { margin:0; clear:left }
#man dt.flush { float:left; width:8ex }
#man dd { margin:0 0 0 9ex }
#man code, #man strong, #man b { font-weight:bold; color:#131211; }
#man pre code { font-weight:normal; color:#232221; background:inherit }
#man em, var, u {
font-style:normal; color:#333231; border-bottom:1px solid #999; }
#man h1.man-title { display:none; }
#man ol.man, #man ol.man li { margin:2px 0 10px 0; padding:0;
float:left; width:33%; list-style-type:none;
text-transform:uppercase; font-size:18px; color:#999;
letter-spacing:1px;}
#man ol.man { width:100%; }
#man ol.man li.tl { text-align:left }
#man ol.man li.tc { text-align:center;letter-spacing:4px }
#man ol.man li.tr { text-align:right }
#man ol.man a { color:#999 }
#man ol.man a:hover { color:#333231 }
</style>
</head>
<body>
<div id='man'>
<h1 class='man-title'>repl(1)</h1>
<ol class='head man'>
<li class='tl'>repl(1)</li>
<li class='tc'></li>
<li class='tr'>repl(1)</li>
</ol>
<h2 id='NAME'>NAME</h2>
<p><code>repl</code> -- sometimes you need a repl</p>
<h2>SYNOPSIS</h2>
<p><code>repl</code> <var>[repl-options]</var> <var>command</var> &lt;...></p>
<h2>DESCRIPTION</h2>
<p><code>repl</code> wraps a non-interactive <code>command</code> in an interactive
read-eval-print-loop prompt. Each line you type into the prompt is
executed as arguments to <code>command</code>. Anything written to standard
output or standard error by the <code>command</code> is displayed.</p>
<p>If you have <code>rlwrap(1)</code> installed you'll automatically get the full
benefits of readline: history, reverse searches, etc.</p>
<p><code>repl</code> is meant to wrap programs which accept command line arguments
and print to the standard output. It keeps no state between executed
lines and, as such, cannot be used to replace <code>irb</code> or the Python
REPL (for example).</p>
<h2>EXAMPLES</h2>
<p>Using <code>repl</code> with <code>redis-cli</code>:</p>
<pre><code>$ repl redis-cli
&gt;&gt; set name chris
OK
&gt;&gt; get name
chris
&gt;&gt; info
redis_version:1.000
uptime_in_seconds:182991
uptime_in_days:2
.. etc ..
</code></pre>
<p>Using <code>repl</code> with Ruby's <code>gem</code>:</p>
<pre><code>$ repl gem
&gt;&gt; --version
1.3.5
&gt;&gt; search yajl
*** LOCAL GEMS ***
yajl-ruby (0.6.7)
&gt;&gt; search yajl -r
*** REMOTE GEMS ***
brianmario-yajl-ruby (0.6.3)
filipegiusti-yajl-ruby (0.6.4)
jdg-yajl-ruby (0.5.12)
oortle-yajl-ruby (0.5.8)
yajl-ruby (0.6.7)
</code></pre>
<p>Using <code>repl</code> with <code>git</code>:</p>
<pre><code>$ repl git
&gt;&gt; branch
gh-pages
* master
&gt;&gt; tag
rm
v0.1.0
v0.1.1
v0.1.2
v0.1.3
&gt;&gt; tag -d rm
Deleted tag 'rm'
&gt;&gt; pwd
git: 'pwd' is not a git-command. See 'git --help'.
Did you mean this?
add
</code></pre>
<h2>OPTIONS</h2>
<dl>
<dt><code>-h</code>, <code>--help</code></dt><dd><p>Displays usage information.</p></dd>
<dt class="flush"><code>--stdin</code></dt><dd><p>Pipe input to command's STDIN.</p></dd>
<dt class="flush"><code>--debug</code></dt><dd><p>Displays debug information while running.</p></dd>
<dt class="flush"><code>--man</code></dt><dd><p>Displays this man page.</p></dd>
</dl>
<h2>COMPLETION</h2>
<p>Because <code>rlwrap</code> supports completion, <code>repl</code> does too. Any file in
<code>~/.repl</code> matching the name of the command you start <code>repl</code> with will
be used for completion.</p>
<p>For instance, a file named <code>~/.repl/redis-cli</code> containing "get set
info" will cause "get", "set", and "info" to be tab completeable at
the <code>repl redis-cli</code> prompt.</p>
<p>The directory searched for completion files can be configured using
the <code>REPL_COMPLETION_DIR</code> environment variable.</p>
<h2>COMMAND HISTORY</h2>
<p>Because <code>rlwrap</code> supports command history, <code>repl</code> does too. Any file in
<code>~/</code> matching the name of the command you start <code>repl</code> with prefix
with a dot and suffixed with "_history" will be used for completion.</p>
<p>For instance, a file named <code>~/.redis-cli_history</code> containing a newline
separated list of "get set info" will cause "get", "set", and "info"
to be reachable using the up arrow as command history at the <code>repl
redis-cli</code> prompt.</p>
<p>The directory searched for history files can be configured using the
<code>REPL_HISTORY_DIR</code> environment variable.</p>
<h2>ENVIRONMENT</h2>
<h3>REPL_PROMPT</h3>
<p>the prompt to display before each line of input. defaults to >></p>
<h3>REPL_COMPLETION_DIR</h3>
<p>directory in which completion files are kept</p>
<h3>REPL_HISTORY_DIR</h3>
<p>directory in which command history files are kept</p>
<h2>BUGS</h2>
<p><a href="http://github.com/defunkt/repl/issues">http://github.com/defunkt/repl/issues</a></p>
<h2>AUTHOR</h2>
<p>Chris Wanstrath :: chris@ozmm.org :: @defunkt</p>
<h2>SEE ALSO</h2>
<p>rlwrap(1), readline(3), <a href="http://github.com">http://github.com</a>,
<a href="http://github.com/defunkt/repl">http://github.com/defunkt/repl</a></p>
<ol class='foot man'>
<li class='tl'>DEFUNKT</li>
<li class='tc'>May 2010</li>
<li class='tr'>repl(1)</li>
</ol>
</div>
</body>
</html>