aboutsummaryrefslogtreecommitdiffstats
path: root/tool/redmine-backporter.rb
diff options
context:
space:
mode:
authornobu <nobu@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2015-01-20 03:09:56 +0000
committernobu <nobu@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2015-01-20 03:09:56 +0000
commit6cb0b95fe3edea270cb424e4ccaeed65febb0d63 (patch)
tree6d39928bf67fadbd1e45537e3a6c81ee6c0a63ca /tool/redmine-backporter.rb
parent2076f1e0090775fb80d4ea97b0034be0f4e6a496 (diff)
downloadruby-6cb0b95fe3edea270cb424e4ccaeed65febb0d63.tar.gz
redmine-backporter.rb: improve mygets
* tool/redmine-backporter.rb (mygets): newline to finish, fix DEL code, erase the last character at DEL/BS, and use \C escapes. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@49343 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'tool/redmine-backporter.rb')
-rwxr-xr-xtool/redmine-backporter.rb11
1 files changed, 5 insertions, 6 deletions
diff --git a/tool/redmine-backporter.rb b/tool/redmine-backporter.rb
index 2e5d7d32e5..ea56dc19c2 100755
--- a/tool/redmine-backporter.rb
+++ b/tool/redmine-backporter.rb
@@ -202,17 +202,16 @@ def mygets
line = ''
while 1
case c = console.getch
- when "\r"
+ when "\r", "\n"
puts
line << c
return line
- when "\x07", "\b" # DEL/BS
- print "\b"
- line.chop!
- when "\x15" # C-u
+ when "\C-?", "\b" # DEL/BS
+ print "\b \b" if line.chop!
+ when "\C-u"
print cls
line.clear
- when "\x04" # C-d
+ when "\C-d"
return nil if line.empty?
line << c
else