On Nov 14, 2008, at 4:23 AM, szimek wrote:

> Hi,

Hello.

> I've got an array of user logins and need to provide a way to select
> one or more of them with auto-completion. Currently I've got code
> straight from readline example:
>
> users = ask("Select users: ", user_logins) do |q|
>    q.readline = true
> end
>
> The problem is that it says "You must choose one of...." if I select
> more than one login. How to allow to select multiple choices?

Is it okay to ask the user to enter one login per line with a blank  
line to end?  If so, this code should work:

#!/usr/bin/env ruby -wKU

require "rubygems"
require "highline/import"

LOGINS = %w[bob joe dave alice hal]

selected = ask("Select Users:", LOGINS + [""]) do |q|
   q.readline = true
   q.gather   = ""
end
p selected

__END__

Hope that helps.

James Edward Gray II