├── lib └── repl │ └── version.rb ├── repl.gemspec ├── Rakefile ├── LICENSE ├── bin └── repl ├── man ├── repl.1.ronn ├── repl.1 └── repl.1.html └── README.md /lib/repl/version.rb: -------------------------------------------------------------------------------- 1 | module Repl 2 | VERSION = "1.0.0" 3 | end 4 | -------------------------------------------------------------------------------- /repl.gemspec: -------------------------------------------------------------------------------- 1 | $LOAD_PATH.unshift 'lib' 2 | require "repl/version" 3 | 4 | Gem::Specification.new do |s| 5 | s.name = "repl" 6 | s.version = Repl::VERSION 7 | s.date = Time.now.strftime('%Y-%m-%d') 8 | s.summary = "sometimes you need a repl" 9 | s.homepage = "http://github.com/defunkt/repl" 10 | s.email = "chris@ozmm.org" 11 | s.authors = [ "Chris Wanstrath" ] 12 | s.has_rdoc = false 13 | 14 | s.files = %w( README.md Rakefile LICENSE ) 15 | s.files += Dir.glob("bin/**/*") 16 | s.files += Dir.glob("man/**/*") 17 | 18 | s.executables = %w( repl ) 19 | s.description = < :build_man do 19 | exec "man man/repl.1" 20 | end 21 | 22 | desc "Push a new version to Gemcutter" 23 | task :publish do 24 | git "tag v#{version}" 25 | git "push origin v#{version}" 26 | git "push origin master" 27 | git "push origin master:latest" 28 | sh "gem build repl.gemspec" 29 | sh "gem push repl-#{version}.gem" 30 | git "clean -fd" 31 | exec "rake pages" 32 | end 33 | 34 | desc "Publish to GitHub Pages" 35 | task :pages => [ :build_man ] do 36 | cp "man/repl.1.html", "html" 37 | git "checkout gh-pages" 38 | mv "html", "index.html" 39 | git "commit -a -m 'update docs'" 40 | git "push origin gh-pages" 41 | git "checkout master" 42 | puts :done 43 | end 44 | -------------------------------------------------------------------------------- /LICENSE: -------------------------------------------------------------------------------- 1 | Copyright (c) 2009 Chris Wanstrath 2 | 3 | Permission is hereby granted, free of charge, to any person obtaining 4 | a copy of this software and associated documentation files (the 5 | "Software"), to deal in the Software without restriction, including 6 | without limitation the rights to use, copy, modify, merge, publish, 7 | distribute, sublicense, and/or sell copies of the Software, and to 8 | permit persons to whom the Software is furnished to do so, subject to 9 | the following conditions: 10 | 11 | The above copyright notice and this permission notice shall be 12 | included in all copies or substantial portions of the Software. 13 | 14 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, 15 | EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF 16 | MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND 17 | NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE 18 | LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION 19 | OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION 20 | WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. 21 | -------------------------------------------------------------------------------- /bin/repl: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env ruby 2 | 3 | # repl(1) -- sometimes you need a repl 4 | # 5 | # repl is an interactive program which tenderly wraps another, 6 | # non-interactive program. 7 | # 8 | # For example: 9 | # 10 | # $ repl redis-cli 11 | # >> set name chris 12 | # OK 13 | # >> get name 14 | # chris 15 | # 16 | # If you have rlwrap(1) installed you'll get the full benefits of 17 | # readline: history, reverse searches, etc. 18 | 19 | def show_help 20 | puts <<-help 21 | Usage: repl [options] command ... 22 | 23 | Options: 24 | --help Display this message 25 | --stdin Pipe input to command's STDIN 26 | --debug Display each command executed 27 | --man Display the man page 28 | 29 | Bug reports, suggestions, updates: 30 | http://github.com/defunkt/repl/issues 31 | help 32 | exit 33 | end 34 | 35 | if ARGV.empty? || ARGV.any? { |arg| %w( -h --help -help help ).include?(arg) } 36 | show_help 37 | end 38 | 39 | if ARGV.include? '--man' 40 | dir = File.dirname(__FILE__) 41 | exec "man #{dir}/../man/repl.1" 42 | end 43 | 44 | completion_dir = ENV['REPL_COMPLETION_DIR'] || "~/.repl" 45 | if File.exists?(cdir = File.expand_path(completion_dir)) 46 | script = ARGV.detect { |a| a !~ /^-/ } 47 | if script 48 | cfile = Dir[cdir + '/' + File.basename(script)].first 49 | cfile = nil if cfile && !File.exists?(cfile) 50 | end 51 | end 52 | 53 | history_dir = ENV['REPL_HISTORY_DIR'] || "~/" 54 | if File.exists?(hdir = File.expand_path(history_dir)) 55 | if script = ARGV.detect { |a| a !~ /^-/ } 56 | script = File.basename(script) 57 | hfile = "#{hdir}/.#{script}_history" 58 | end 59 | end 60 | 61 | if !ENV['__REPL_WRAPPED'] && system("which rlwrap > /dev/null 2> /dev/null") 62 | ENV['__REPL_WRAPPED'] = '0' 63 | 64 | rlargs = "" 65 | rlargs << " -f #{cfile}" if cfile 66 | rlargs << " -H #{hfile}" if hfile 67 | 68 | exec "rlwrap #{rlargs} #$0 #{ARGV.join(' ')}" 69 | end 70 | 71 | if ARGV[0] == '--debug' 72 | debug = ARGV.delete('--debug') 73 | end 74 | 75 | if ARGV.include? '--stdin' 76 | from_stdin = ARGV.delete('--stdin') 77 | end 78 | 79 | command = ARGV.join(' ') 80 | show_help if command.empty? 81 | 82 | if debug 83 | print 'rlwrap ' if ENV['__REPL_WRAPPED'] 84 | print "-f #{cfile} " if cfile 85 | print "-H #{hfile} " if hfile 86 | puts command.inspect 87 | end 88 | 89 | loop do 90 | print ENV['REPL_PROMPT'] || "#{ARGV[0]}>> " 91 | 92 | begin 93 | line = $stdin.gets.chomp 94 | rescue NoMethodError, Interrupt 95 | exit 96 | end 97 | 98 | if from_stdin 99 | run = "echo \"%s\" | #{command}" % [ line, nil ] 100 | else 101 | run = "#{command} %s" % [ line, nil ] 102 | end 103 | puts "$ #{run}" if debug 104 | system run 105 | warn "Use Ctrl-D (i.e. EOF) to exit" if line =~ /^(exit|quit)$/ 106 | end 107 | -------------------------------------------------------------------------------- /man/repl.1.ronn: -------------------------------------------------------------------------------- 1 | repl(1) - sometimes you need a repl 2 | =================================== 3 | 4 | ## SYNOPSIS 5 | 6 | `repl` <[repl-options]> <...> 7 | 8 | ## DESCRIPTION 9 | 10 | `repl` wraps a non-interactive `command` in an interactive 11 | read-eval-print-loop prompt. Each line you type into the prompt is 12 | executed as arguments to `command`. Anything written to standard 13 | output or standard error by the `command` is displayed. 14 | 15 | If you have `rlwrap(1)` installed you'll automatically get the full 16 | benefits of readline: history, reverse searches, etc. 17 | 18 | `repl` is meant to wrap programs which accept command line arguments 19 | and print to the standard output. It keeps no state between executed 20 | lines and, as such, cannot be used to replace `irb` or the Python 21 | REPL (for example). 22 | 23 | ## EXAMPLES 24 | 25 | Using `repl` with `redis-cli`: 26 | 27 | $ repl redis-cli 28 | >> set name chris 29 | OK 30 | >> get name 31 | chris 32 | >> info 33 | redis_version:1.000 34 | uptime_in_seconds:182991 35 | uptime_in_days:2 36 | .. etc .. 37 | 38 | 39 | Using `repl` with Ruby's `gem`: 40 | 41 | $ repl gem 42 | >> --version 43 | 1.3.5 44 | >> search yajl 45 | 46 | *** LOCAL GEMS *** 47 | 48 | yajl-ruby (0.6.7) 49 | >> search yajl -r 50 | 51 | *** REMOTE GEMS *** 52 | 53 | brianmario-yajl-ruby (0.6.3) 54 | filipegiusti-yajl-ruby (0.6.4) 55 | jdg-yajl-ruby (0.5.12) 56 | oortle-yajl-ruby (0.5.8) 57 | yajl-ruby (0.6.7) 58 | 59 | 60 | Using `repl` with `git`: 61 | 62 | $ repl git 63 | >> branch 64 | gh-pages 65 | * master 66 | >> tag 67 | rm 68 | v0.1.0 69 | v0.1.1 70 | v0.1.2 71 | v0.1.3 72 | >> tag -d rm 73 | Deleted tag 'rm' 74 | >> pwd 75 | git: 'pwd' is not a git-command. See 'git --help'. 76 | 77 | Did you mean this? 78 | add 79 | 80 | ## OPTIONS 81 | 82 | * `-h`, `--help`: 83 | Displays usage information. 84 | 85 | * `--stdin`: 86 | Pipe input to command's STDIN. 87 | 88 | * `--debug`: 89 | Displays debug information while running. 90 | 91 | * `--man`: 92 | Displays this man page. 93 | 94 | ## COMPLETION 95 | 96 | Because `rlwrap` supports completion, `repl` does too. Any file in 97 | `~/.repl` matching the name of the command you start `repl` with will 98 | be used for completion. 99 | 100 | For instance, a file named `~/.repl/redis-cli` containing "get set 101 | info" will cause "get", "set", and "info" to be tab completeable at 102 | the `repl redis-cli` prompt. 103 | 104 | The directory searched for completion files can be configured using 105 | the `REPL_COMPLETION_DIR` environment variable. 106 | 107 | ## COMMAND HISTORY 108 | 109 | Because `rlwrap` supports command history, `repl` does too. Any file in 110 | `~/` matching the name of the command you start `repl` with prefix 111 | with a dot and suffixed with "_history" will be used for completion. 112 | 113 | For instance, a file named `~/.redis-cli_history` containing a newline 114 | separated list of "get set info" will cause "get", "set", and "info" 115 | to be reachable using the up arrow as command history at the `repl 116 | redis-cli` prompt. 117 | 118 | The directory searched for history files can be configured using the 119 | `REPL_HISTORY_DIR` environment variable. 120 | 121 | ## ENVIRONMENT 122 | 123 | ### REPL_PROMPT 124 | 125 | the prompt to display before each line of input. defaults to >> 126 | 127 | ### REPL_COMPLETION_DIR 128 | 129 | directory in which completion files are kept 130 | 131 | ### REPL_HISTORY_DIR 132 | 133 | directory in which command history files are kept 134 | 135 | ## BUGS 136 | 137 | 138 | 139 | ## AUTHOR 140 | 141 | Chris Wanstrath :: chris@ozmm.org :: @defunkt 142 | 143 | ## SEE ALSO 144 | 145 | rlwrap(1), readline(3), , 146 | 147 | -------------------------------------------------------------------------------- /man/repl.1: -------------------------------------------------------------------------------- 1 | .\" generated with Ronn/v0.5 2 | .\" http://github.com/rtomayko/ronn/ 3 | . 4 | .TH "REPL" "1" "May 2010" "DEFUNKT" "" 5 | . 6 | .SH "NAME" 7 | \fBrepl\fR \-\- sometimes you need a repl 8 | . 9 | .SH "SYNOPSIS" 10 | \fBrepl\fR \fI[repl\-options]\fR \fIcommand\fR <...> 11 | . 12 | .SH "DESCRIPTION" 13 | \fBrepl\fR wraps a non\-interactive \fBcommand\fR in an interactive 14 | read\-eval\-print\-loop prompt. Each line you type into the prompt is 15 | executed as arguments to \fBcommand\fR. Anything written to standard 16 | output or standard error by the \fBcommand\fR is displayed. 17 | . 18 | .P 19 | If you have \fBrlwrap(1)\fR installed you'll automatically get the full 20 | benefits of readline: history, reverse searches, etc. 21 | . 22 | .P 23 | \fBrepl\fR is meant to wrap programs which accept command line arguments 24 | and print to the standard output. It keeps no state between executed 25 | lines and, as such, cannot be used to replace \fBirb\fR or the Python 26 | REPL (for example). 27 | . 28 | .SH "EXAMPLES" 29 | Using \fBrepl\fR with \fBredis\-cli\fR: 30 | . 31 | .IP "" 4 32 | . 33 | .nf 34 | 35 | $ repl redis\-cli 36 | >> set name chris 37 | OK 38 | >> get name 39 | chris 40 | >> info 41 | redis_version:1.000 42 | uptime_in_seconds:182991 43 | uptime_in_days:2 44 | .. etc .. 45 | . 46 | .fi 47 | . 48 | .IP "" 0 49 | . 50 | .P 51 | Using \fBrepl\fR with Ruby's \fBgem\fR: 52 | . 53 | .IP "" 4 54 | . 55 | .nf 56 | 57 | $ repl gem 58 | >> \-\-version 59 | 1.3.5 60 | >> search yajl 61 | 62 | *** LOCAL GEMS *** 63 | 64 | yajl\-ruby (0.6.7) 65 | >> search yajl \-r 66 | 67 | *** REMOTE GEMS *** 68 | 69 | brianmario\-yajl\-ruby (0.6.3) 70 | filipegiusti\-yajl\-ruby (0.6.4) 71 | jdg\-yajl\-ruby (0.5.12) 72 | oortle\-yajl\-ruby (0.5.8) 73 | yajl\-ruby (0.6.7) 74 | . 75 | .fi 76 | . 77 | .IP "" 0 78 | . 79 | .P 80 | Using \fBrepl\fR with \fBgit\fR: 81 | . 82 | .IP "" 4 83 | . 84 | .nf 85 | 86 | $ repl git 87 | >> branch 88 | gh\-pages 89 | * master 90 | >> tag 91 | rm 92 | v0.1.0 93 | v0.1.1 94 | v0.1.2 95 | v0.1.3 96 | >> tag \-d rm 97 | Deleted tag 'rm' 98 | >> pwd 99 | git: 'pwd' is not a git\-command. See 'git \-\-help'. 100 | 101 | Did you mean this? 102 | add 103 | . 104 | .fi 105 | . 106 | .IP "" 0 107 | . 108 | .SH "OPTIONS" 109 | . 110 | .TP 111 | \fB\-h\fR, \fB\-\-help\fR 112 | Displays usage information. 113 | . 114 | .TP 115 | \fB\-\-stdin\fR 116 | Pipe input to command's STDIN. 117 | . 118 | .TP 119 | \fB\-\-debug\fR 120 | Displays debug information while running. 121 | . 122 | .TP 123 | \fB\-\-man\fR 124 | Displays this man page. 125 | . 126 | .SH "COMPLETION" 127 | Because \fBrlwrap\fR supports completion, \fBrepl\fR does too. Any file in \fB~/.repl\fR matching the name of the command you start \fBrepl\fR with will 128 | be used for completion. 129 | . 130 | .P 131 | For instance, a file named \fB~/.repl/redis\-cli\fR containing "get set 132 | info" will cause "get", "set", and "info" to be tab completeable at 133 | the \fBrepl redis\-cli\fR prompt. 134 | . 135 | .P 136 | The directory searched for completion files can be configured using 137 | the \fBREPL_COMPLETION_DIR\fR environment variable. 138 | . 139 | .SH "COMMAND HISTORY" 140 | Because \fBrlwrap\fR supports command history, \fBrepl\fR does too. Any file in \fB~/\fR matching the name of the command you start \fBrepl\fR with prefix 141 | with a dot and suffixed with "_history" will be used for completion. 142 | . 143 | .P 144 | For instance, a file named \fB~/.redis\-cli_history\fR containing a newline 145 | separated list of "get set info" will cause "get", "set", and "info" 146 | to be reachable using the up arrow as command history at the \fBrepl 147 | redis\-cli\fR prompt. 148 | . 149 | .P 150 | The directory searched for history files can be configured using the \fBREPL_HISTORY_DIR\fR environment variable. 151 | . 152 | .SH "ENVIRONMENT" 153 | . 154 | .SS "REPL_PROMPT" 155 | the prompt to display before each line of input. defaults to >> 156 | . 157 | .SS "REPL_COMPLETION_DIR" 158 | directory in which completion files are kept 159 | . 160 | .SS "REPL_HISTORY_DIR" 161 | directory in which command history files are kept 162 | . 163 | .SH "BUGS" 164 | \fIhttp://github.com/defunkt/repl/issues\fR 165 | . 166 | .SH "AUTHOR" 167 | Chris Wanstrath :: chris@ozmm.org :: @defunkt 168 | . 169 | .SH "SEE ALSO" 170 | rlwrap(1), readline(3), \fIhttp://github.com\fR, \fIhttp://github.com/defunkt/repl\fR 171 | -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | repl(1) -- sometimes you need a repl 2 | ==================================== 3 | 4 | `repl` is an interactive program which tenderly wraps another, 5 | non-interactive program. 6 | 7 | For example: 8 | 9 | $ repl redis-cli -p 6665 10 | >> set name chris 11 | OK 12 | >> get name 13 | chris 14 | >> info 15 | redis_version:1.000 16 | uptime_in_seconds:182991 17 | uptime_in_days:2 18 | .. etc .. 19 | 20 | 21 | Or: 22 | 23 | $ repl gem 24 | >> --version 25 | 1.3.5 26 | >> search yajl 27 | 28 | *** LOCAL GEMS *** 29 | 30 | yajl-ruby (0.6.7) 31 | >> search yajl -r 32 | 33 | *** REMOTE GEMS *** 34 | 35 | brianmario-yajl-ruby (0.6.3) 36 | filipegiusti-yajl-ruby (0.6.4) 37 | jdg-yajl-ruby (0.5.12) 38 | oortle-yajl-ruby (0.5.8) 39 | yajl-ruby (0.6.7) 40 | 41 | 42 | Or even: 43 | 44 | $ repl git 45 | >> branch 46 | gh-pages 47 | * master 48 | >> tag 49 | rm 50 | v0.1.0 51 | v0.1.1 52 | v0.1.2 53 | v0.1.3 54 | >> tag -d rm 55 | Deleted tag 'rm' 56 | >> pwd 57 | git: 'pwd' is not a git-command. See 'git --help'. 58 | 59 | Did you mean this? 60 | add 61 | 62 | You can also use `%s` to tell repl where to stick the input: 63 | 64 | $ repl heroku %s --app domainy 65 | >> info 66 | === domainy 67 | Web URL: http://domainy.heroku.com/ 68 | Git Repo: git@heroku.com:domainy.git 69 | Dynos: 1 70 | Workers: 0 71 | Repo size: 288k 72 | Slug size: 4k 73 | Data size: 0K in 0 table 74 | Addons: Piggyback SSL 75 | Owner: b****@*******.com 76 | 77 | 78 | If you have [rlwrap(1)][0] installed you'll automatically get the full 79 | benefits of readline: history, reverse searches, etc. 80 | 81 | `repl` is meant to wrap programs which accept command line arguments 82 | and print to the standard output. It keeps no state between executed 83 | lines and, as such, cannot be used to replace `irb` or the Python 84 | REPL (for example). 85 | 86 | 87 | Install 88 | ------- 89 | 90 | ### Standalone 91 | 92 | `repl` is easily installed as a standalone script: 93 | 94 | export REPL_BIN=~/bin/repl 95 | curl -s https://raw.github.com/defunkt/repl/latest/bin/repl > $REPL_BIN 96 | chmod 755 $REPL_BIN 97 | 98 | Change `$REPL_BIN` to your desired location and have at! (Just make 99 | sure it's in your `$PATH`.) 100 | 101 | ### RubyGems 102 | 103 | `repl` can also be installed as a RubyGem: 104 | 105 | $ gem install repl 106 | 107 | 108 | Completion 109 | ---------- 110 | 111 | Because `rlwrap` supports completion, `repl` does too. Any file in 112 | `~/.repl` matching the name of the command you start `repl` with will 113 | be used for completion. 114 | 115 | For instance, a file named `~/.repl/redis-cli` containing "get set 116 | info" will cause "get", "set", and "info" to be tab completeable at 117 | the `repl redis-cli` prompt. 118 | 119 | The directory searched for completion files can be configured using 120 | the `REPL_COMPLETION_DIR` environment variable. 121 | 122 | See the [repl-completion](http://github.com/defunkt/repl-completion) 123 | project for a few common, pre-rolled completion files. 124 | 125 | 126 | Configuration 127 | ------------- 128 | 129 | The following environment variables affect `repl`'s behavior: 130 | 131 | `REPL_PROMPT`: 132 | the prompt to display before each line of input. defaults to >> 133 | 134 | `REPL_COMPLETION_DIR`: 135 | directory in which completion files are kept 136 | 137 | 138 | Contributing 139 | ------------ 140 | 141 | Once you've made your great commits: 142 | 143 | 1. [Fork][1] repl 144 | 2. Create a topic branch - `git checkout -b my_branch` 145 | 3. Push to your branch - `git push origin my_branch` 146 | 4. Create an [Issue][2] with a link to your branch 147 | 5. That's it! 148 | 149 | 150 | Meta 151 | ---- 152 | 153 | * Code: `git clone git://github.com/defunkt/repl.git` 154 | * Home: 155 | * Bugs: 156 | * Gems: 157 | 158 | 159 | Author 160 | ------ 161 | 162 | Chris Wanstrath :: chris@ozmm.org :: @defunkt 163 | 164 | 165 | [0]: http://utopia.knoware.nl/~hlub/rlwrap/ 166 | [1]: http://help.github.com/forking/ 167 | [2]: https://github.com/defunkt/repl/issues 168 | -------------------------------------------------------------------------------- /man/repl.1.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | repl(1) -- sometimes you need a repl 7 | 53 | 54 | 55 |
56 | 57 |

repl(1)

58 | 59 |
    60 |
  1. repl(1)
  2. 61 |
  3. 62 |
  4. repl(1)
  5. 63 |
64 | 65 |

NAME

66 |

repl -- sometimes you need a repl

67 | 68 |

SYNOPSIS

69 | 70 |

repl [repl-options] command <...>

71 | 72 |

DESCRIPTION

73 | 74 |

repl wraps a non-interactive command in an interactive 75 | read-eval-print-loop prompt. Each line you type into the prompt is 76 | executed as arguments to command. Anything written to standard 77 | output or standard error by the command is displayed.

78 | 79 |

If you have rlwrap(1) installed you'll automatically get the full 80 | benefits of readline: history, reverse searches, etc.

81 | 82 |

repl is meant to wrap programs which accept command line arguments 83 | and print to the standard output. It keeps no state between executed 84 | lines and, as such, cannot be used to replace irb or the Python 85 | REPL (for example).

86 | 87 |

EXAMPLES

88 | 89 |

Using repl with redis-cli:

90 | 91 |
$ repl redis-cli
 92 | >> set name chris
 93 | OK
 94 | >> get name
 95 | chris
 96 | >> info
 97 | redis_version:1.000
 98 | uptime_in_seconds:182991
 99 | uptime_in_days:2
100 | .. etc ..
101 | 
102 | 103 |

Using repl with Ruby's gem:

104 | 105 |
$ repl gem
106 | >> --version
107 | 1.3.5
108 | >> search yajl
109 | 
110 | *** LOCAL GEMS ***
111 | 
112 | yajl-ruby (0.6.7)
113 | >> search yajl -r
114 | 
115 | *** REMOTE GEMS ***
116 | 
117 | brianmario-yajl-ruby (0.6.3)
118 | filipegiusti-yajl-ruby (0.6.4)
119 | jdg-yajl-ruby (0.5.12)
120 | oortle-yajl-ruby (0.5.8)
121 | yajl-ruby (0.6.7)
122 | 
123 | 124 |

Using repl with git:

125 | 126 |
$ repl git
127 | >> branch
128 |   gh-pages
129 | * master
130 | >> tag
131 | rm
132 | v0.1.0
133 | v0.1.1
134 | v0.1.2
135 | v0.1.3
136 | >> tag -d rm
137 | Deleted tag 'rm'
138 | >> pwd
139 | git: 'pwd' is not a git-command. See 'git --help'.
140 | 
141 | Did you mean this?
142 |   add
143 | 
144 | 145 |

OPTIONS

146 | 147 |
148 |
-h, --help

Displays usage information.

149 |
--stdin

Pipe input to command's STDIN.

150 |
--debug

Displays debug information while running.

151 |
--man

Displays this man page.

152 |
153 | 154 | 155 |

COMPLETION

156 | 157 |

Because rlwrap supports completion, repl does too. Any file in 158 | ~/.repl matching the name of the command you start repl with will 159 | be used for completion.

160 | 161 |

For instance, a file named ~/.repl/redis-cli containing "get set 162 | info" will cause "get", "set", and "info" to be tab completeable at 163 | the repl redis-cli prompt.

164 | 165 |

The directory searched for completion files can be configured using 166 | the REPL_COMPLETION_DIR environment variable.

167 | 168 |

COMMAND HISTORY

169 | 170 |

Because rlwrap supports command history, repl does too. Any file in 171 | ~/ matching the name of the command you start repl with prefix 172 | with a dot and suffixed with "_history" will be used for completion.

173 | 174 |

For instance, a file named ~/.redis-cli_history containing a newline 175 | separated list of "get set info" will cause "get", "set", and "info" 176 | to be reachable using the up arrow as command history at the repl 177 | redis-cli prompt.

178 | 179 |

The directory searched for history files can be configured using the 180 | REPL_HISTORY_DIR environment variable.

181 | 182 |

ENVIRONMENT

183 | 184 |

REPL_PROMPT

185 | 186 |

the prompt to display before each line of input. defaults to >>

187 | 188 |

REPL_COMPLETION_DIR

189 | 190 |

directory in which completion files are kept

191 | 192 |

REPL_HISTORY_DIR

193 | 194 |

directory in which command history files are kept

195 | 196 |

BUGS

197 | 198 |

http://github.com/defunkt/repl/issues

199 | 200 |

AUTHOR

201 | 202 |

Chris Wanstrath :: chris@ozmm.org :: @defunkt

203 | 204 |

SEE ALSO

205 | 206 |

rlwrap(1), readline(3), http://github.com, 207 | http://github.com/defunkt/repl

208 | 209 | 210 |
    211 |
  1. DEFUNKT
  2. 212 |
  3. May 2010
  4. 213 |
  5. repl(1)
  6. 214 |
215 | 216 |
217 | 218 | 219 | --------------------------------------------------------------------------------