Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

--help

  • Loading branch information...
commit 400e3aa9dcac57385ed5e4b44ea7f541e36da810 1 parent 6ea4e93
Chris Wanstrath defunkt authored
Showing with 18 additions and 2 deletions.
  1. +18 −2 bin/repl
20 bin/repl
View
@@ -16,11 +16,27 @@
# If you have rlwrap(1) installed you'll get the full benefits of
# readline: history, reverse searches, etc.
+if ARGV.empty? || ARGV.any? { |arg| %w( -h --help -help help ).include?(arg) }
+ puts <<-help
+Usage: repl [options] command ...
+
+Options:
+ --help Display this message
+ --debug Display each command executed
+
+Bug reports, suggestions, updates:
+http://http://github.com/defunkt/repl/issues
+help
+ exit
+end
+
completion_dir = ENV['REPL_COMPLETION_DIR'] || "~/.repl"
if File.exists?(cdir = File.expand_path(completion_dir))
script = ARGV.detect { |a| a !~ /^-/ }
- cfile = Dir[cdir + '/' + script].first
- cfile = nil if cfile && !File.exists?(cfile)
+ if script
+ cfile = Dir[cdir + '/' + script].first
+ cfile = nil if cfile && !File.exists?(cfile)
+ end
end
if !ENV['__REPL_WRAPPED'] && system("which rlwrap > /dev/null")
Please sign in to comment.
Something went wrong with that request. Please try again.