I
Iñaki Baz Castillo
Hi, I want to use Ruby Readline for a custom console. Commands are
"ddd", "bbb", "aaa", "ccc" and I want they to be shown in *that* order
when pressing TAB with empty buffered line. Example code:
--------------------------------------------------------------------
#!/usr/bin/ruby
require "readline"
commands =3D %w{ddd bbb aaa ccc}
Readline.completion_proc =3D proc do |s|
commands
end
while line =3D Readline.readline(">>> ", true)
end
---------------------------------------------------------------------
Running it:
aaa bbb ccc ddd
I strongly need that the commands are shown in the original order! but
Readline shorts them:
ddd bbb aaa ccc
Being a C ruby code I expect it's hard to monkey patch it. Maybe I
miss something to keep the order of the array?
Thanks a lot.
--=20
I=C3=B1aki Baz Castillo
<[email protected]>
"ddd", "bbb", "aaa", "ccc" and I want they to be shown in *that* order
when pressing TAB with empty buffered line. Example code:
--------------------------------------------------------------------
#!/usr/bin/ruby
require "readline"
commands =3D %w{ddd bbb aaa ccc}
Readline.completion_proc =3D proc do |s|
commands
end
while line =3D Readline.readline(">>> ", true)
end
---------------------------------------------------------------------
Running it:
aaa bbb ccc ddd
I strongly need that the commands are shown in the original order! but
Readline shorts them:
ddd bbb aaa ccc
Being a C ruby code I expect it's hard to monkey patch it. Maybe I
miss something to keep the order of the array?
Thanks a lot.
--=20
I=C3=B1aki Baz Castillo
<[email protected]>