Permalink
Browse files

Optionally tell repl to place `line` at %s

  $ repl heroku %s --app domainy
  >> info

Some cli's require a specific order of options,
this solves that problem.
  • Loading branch information...
1 parent 20cbb4e commit fec1cc18c309cd769e8dad52a95f4f008679b221 Blake Mizerany committed with Dec 15, 2009
Showing with 19 additions and 2 deletions.
  1. +16 −0 README.md
  2. +3 −2 bin/repl
View
@@ -59,6 +59,22 @@ Or even:
Did you mean this?
add
+Or *EVEN*:
+Use %s to tell repl where to put the input
+
+ $ repl heroku %s --app domainy
+ >> info
+ === domainy
+ Web URL: http://domainy.heroku.com/
+ Git Repo: git@heroku.com:domainy.git
+ Dynos: 1
+ Workers: 0
+ Repo size: 288k
+ Slug size: 4k
+ Data size: 0K in 0 table
+ Addons: Piggyback SSL
+ Owner: b****@*******.com
+
If you have [rlwrap(1)][0] installed you'll automatically get the full
benefits of readline: history, reverse searches, etc.
View
@@ -60,6 +60,7 @@ if ARGV[0] == '--debug'
end
command = ARGV.join(' ')
+run = Proc.new {|line| (command + " %s") % [line, nil] }
show_help if command.empty?
if debug
@@ -77,7 +78,7 @@ loop do
exit
end
- puts "$ #{command} #{line}" if debug
- system "#{command} #{line}"
+ puts "$ #{run[line]}" if debug
+ system "#{run[line]}"
warn "Use Ctrl-D (i.e. EOF) to exit" if line =~ /^(exit|quit)$/
end

1 comment on commit fec1cc1

@bry4n
bry4n commented on fec1cc1 Dec 15, 2009

woot! cd ~/repl && git pull

Please sign in to comment.